From: Martin Quinson Date: Thu, 3 Mar 2022 14:18:04 +0000 (+0100) Subject: cmake simplification so that you only have to edit one list when adding an hijack... X-Git-Tag: v3.31~236 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/60d51e48bd15c54db7c761b10f485cf5599e33a7 cmake simplification so that you only have to edit one list when adding an hijack of MC onto an existing test --- diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index 86ea66065e..6d15aa7694 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -49,18 +49,6 @@ if(SIMGRID_HAVE_MC) set(_mc-bugged1-liveness_disable 1) endif() - # Hijack some regular tests to run them on top of the MC - foreach (example synchro-mutex synchro-semaphore) - ADD_TESH(s4u-mc-${example} - --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} - --setenv libdir=${CMAKE_BINARY_DIR}/lib - --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms - --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example} - --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} - ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-mc-${example}.tesh) - endforeach() - - # This example never ends, disable it for now set(_mc-bugged2-liveness_disable 1) @@ -90,9 +78,20 @@ else() set(_${example}_disable 1) endforeach() endif() -# The tesh files of MC hijacked tests must always be added to the distribution -foreach (example synchro-mutex) + +# Hijack some regular tests to run them on top of the MC +foreach (example synchro-mutex synchro-semaphore) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-mc-${example}.tesh) + + if (SIMGRID_HAVE_MC) + ADD_TESH(s4u-mc-${example} + --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} + --setenv libdir=${CMAKE_BINARY_DIR}/lib + --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms + --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example} + --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} + ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-mc-${example}.tesh) + endif() endforeach()