Skip to content

Commit

Permalink
functionalize the running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkzerwas committed Sep 24, 2024
1 parent 1b5c5f5 commit 69fb932
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@ set(TEST_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake-check.sh")
set(TEST_TIMEOUT 3500)
set(TEST_ENVIRONMENT "K4GENERATORSCONFIG=${PROJECT_BINARY_DIR}/bin")

# the generators to be run
set(generatorList Babayaga KKMC Madgraph Pythia Sherpa Whizard )

# generato the run list for the dependencies
foreach(generator ${generatorList})
# list(APPEND InputAndRunList "InputAndRun_${generator}" )
# string(CONCAT InputAndRunList ${InputAndRunList} InputAndRun_${generator} " ")
list(APPEND InputAndRunList InputAndRun_${generator})
message(${generator} " appended to the runlist ")
endforeach()
message("The string is " ${InputAndRunList} )

# add the first test: setting up and comapring the yaml files
add_test(NAME setupGeneratorRuns COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake-check-yaml.sh" )
set_tests_properties("setupGeneratorRuns"
PROPERTIES
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
ENVIRONMENT ${TEST_ENVIRONMENT}
)

# second test running the generators
function(add_custom_test name generator)
add_test(NAME ${name}_${generator} COMMAND ${TEST_COMMAND} ${generator} -r)
set_tests_properties(${name}_${generator}
Expand All @@ -30,13 +32,17 @@ function(add_custom_test name generator)
endfunction()

# Add tests using the function with simplified names
add_custom_test(InputAndRun Sherpa)
add_custom_test(InputAndRun KKMC)
add_custom_test(InputAndRun Whizard)
add_custom_test(InputAndRun Babayaga)
add_custom_test(InputAndRun Pythia)
add_custom_test(InputAndRun Madgraph)
foreach(generator ${generatorList})
add_custom_test(InputAndRun ${generator} )
endforeach()
#add_custom_test(InputAndRun Sherpa)
#add_custom_test(InputAndRun KKMC)
#add_custom_test(InputAndRun Whizard)
#add_custom_test(InputAndRun Babayaga)
#add_custom_test(InputAndRun Pythia)
#add_custom_test(InputAndRun Madgraph)

# thirs test (after all others have been run: gather the xsections
add_test(NAME xsectionRuns COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake-check-xsection.sh" )
set_tests_properties("xsectionRuns"
PROPERTIES
Expand Down

0 comments on commit 69fb932

Please sign in to comment.