X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f15e92e5de94e0d84b2084de6e1648ce64dadbed..5e22041a2c1ba01ba5c2337e39ebd9a590780182:/teshsuite/mc/CMakeLists.txt diff --git a/teshsuite/mc/CMakeLists.txt b/teshsuite/mc/CMakeLists.txt index 451a0ea3d4..b4b76485e3 100644 --- a/teshsuite/mc/CMakeLists.txt +++ b/teshsuite/mc/CMakeLists.txt @@ -1,34 +1,39 @@ -# MC-only C++ binaries -foreach(x dwarf dwarf-expression) - if (SIMGRID_HAVE_MC) +if (NOT SIMGRID_HAVE_MC) + set(dwarf_disable 1) + set(dwarf-expression_disable 1) +endif() + + +foreach(x dwarf dwarf-expression random-bug mutex-handling) + + if(NOT DEFINED ${x}_sources) + set(${x}_sources ${x}/${x}.cpp) + endif() + + if(NOT DEFINED ${x}_disable) add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp) target_link_libraries(${x} simgrid) set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") - add_dependencies(tests ${x}) + add_dependencies(tests-mc ${x}) endif() set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh) - set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp) -endforeach() -# MC-independent C++ binaries -foreach(x random-bug mutex-handling) - add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp) - target_link_libraries(${x} simgrid) - set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x}) - set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}") - add_dependencies(tests ${x}) + foreach(file ${${x}_sources}) + set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${file}) + endforeach() + + unset(${x}_sources) + unset(${x}_disable) - set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh) - set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp) endforeach() add_executable (without-mutex-handling EXCLUDE_FROM_ALL mutex-handling/mutex-handling.cpp) target_link_libraries(without-mutex-handling simgrid) set_target_properties(without-mutex-handling PROPERTIES COMPILE_FLAGS -DDISABLE_THE_MUTEX=1) set_target_properties(without-mutex-handling PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling) -add_dependencies(tests without-mutex-handling) +add_dependencies(tests-mc without-mutex-handling) set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-nocrash.tesh @@ -50,3 +55,7 @@ IF(SIMGRID_HAVE_MC) ENDIF() ADD_TESH(mc-random-bug-replay --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/random-bug --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/random-bug random-bug-replay.tesh) + +if(enable_coverage) + ADD_TEST(cover-mc-mutex-handling ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling/mutex-handling ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml) +endif()