Skip to content

Commit

Permalink
changed the way the test_name was added and add_test was called with it
Browse files Browse the repository at this point in the history
  • Loading branch information
shahbajsohal committed Aug 1, 2023
1 parent 8fb651c commit ecb56f9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions examples/templates/cmakelists_C_ex.in
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,13 @@ foreach(idx RANGE ${len})
# libraries to link against
target_link_libraries(${example_target} ${SUNDIALS_TARGETS} ${EXTRA_LIBS})

# add the example to ctest
if("${example_args}" STREQUAL "")
set(test_name ${example})
if("${example_args}" MATCHES "<none>")
set(test_name ${example_target})
add_test(NAME ${test_name} COMMAND ${example_target})
else()
string(REGEX REPLACE " " "_" test_name ${example}_${example_args})
string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args})
separate_arguments(example_args_wo_quotes UNIX_COMMAND ${example_args})
add_test(NAME ${test_name} COMMAND ${example_target} ${example_args_wo_quotes})
endif()
string(REPLACE "<none>" "" example_args "${example_args}")
separate_arguments(example_args_wo_quotes UNIX_COMMAND "${example_args}")
add_test(NAME ${test_name} COMMAND ${example_target} ${example_args_wo_quotes})

endforeach()

0 comments on commit ecb56f9

Please sign in to comment.