Skip to content

Commit

Permalink
Use resource lock to avoid parallel execution
Browse files Browse the repository at this point in the history
Both tests ex_compare_seed_value and ex_sim_tutorial2_create_digis depend on
the test ex_sim_tutorial2 which is specified by the required fixture. Since
both tests also read the same output file they must not run in parallel. This
is ensured by the resource lock.
  • Loading branch information
fuhlig1 committed Jun 27, 2023
1 parent 6355627 commit 0e9e78e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/simulation/Tutorial2/macros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright (C) 2014-2019 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
Expand All @@ -22,23 +22,25 @@ set_tests_properties(ex_sim_tutorial2 PROPERTIES
TIMEOUT ${maxTestTime}
PASS_REGULAR_EXPRESSION "Macro finished successfully"
FIXTURES_SETUP fixtures.ex_sim_tutorial2_sim
RESOURCE_LOCK ex_sim_tutorial2_paramFile
)

add_test(NAME ex_compare_seed_value
add_test(NAME ex_sim_tutorial2_compare_seed_value
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/compare_seed_value.sh \"tutorial2_pions.params_p2.000_t0_n10.root\" 333)
set_tests_properties(ex_compare_seed_value PROPERTIES
set_tests_properties(ex_sim_tutorial2_compare_seed_value PROPERTIES
TIMEOUT ${maxTestTime}
FIXTURES_REQUIRED fixtures.ex_sim_tutorial2_sim
FIXTURES_SETUP fixtures.ex_compare_seed_value
RESOURCE_LOCK ex_sim_tutorial2_paramFile
)

add_test(NAME ex_sim_tutorial2_create_digis
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/create_digis.sh)
set_tests_properties(ex_sim_tutorial2_create_digis PROPERTIES
FIXTURES_REQUIRED fixtures.ex_compare_seed_value
FIXTURES_REQUIRED fixtures.ex_sim_tutorial2_sim
TIMEOUT ${maxTestTime}
PASS_REGULAR_EXPRESSION "Macro finished successfully"
FIXTURES_SETUP fixtures.ex_sim_tutorial2_digi
RESOURCE_LOCK ex_sim_tutorial2_paramFile
)

add_test(NAME ex_sim_tutorial2_read_digis
Expand Down

0 comments on commit 0e9e78e

Please sign in to comment.