### Define source packages for Libs
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/DefinePackages.cmake)
+add_custom_target(tests COMMENT "Recompiling the tests")
+
### Build some Maintainer files
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/UnitTesting.cmake)
-add_custom_target(tests COMMENT "Recompiling the tests")
-
### Make Libs
if(NOT WIN32)
include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MakeLib.cmake)
target_compile_features(python-bindings PRIVATE cxx_std_14)
target_link_libraries(python-bindings PUBLIC simgrid)
set_target_properties(python-bindings PROPERTIES LIBRARY_OUTPUT_NAME simgrid)
+ add_dependencies(tests python-bindings)
set_property(TARGET python-bindings
APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
else()
foreach (x bugged1 bugged2 bugged3 centralized_mutex electric_fence bugged1_liveness bugged2_liveness)
if(SIMGRID_HAVE_MC)
- add_executable (${x} ${x}.c)
+ add_executable (${x} EXCLUDE_FROM_ALL ${x}.c)
target_link_libraries(${x} simgrid)
+ add_dependencies(tests ${x})
endif()
set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c)
set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deploy_${x}.xml)
if(SIMGRID_HAVE_MC)
if(HAVE_C_STACK_CLEANER)
- add_executable (bugged1_liveness_cleaner_on bugged1_liveness.c)
+ add_executable (bugged1_liveness_cleaner_on EXCLUDE_FROM_ALL bugged1_liveness.c)
target_link_libraries(bugged1_liveness_cleaner_on simgrid)
set_target_properties(bugged1_liveness_cleaner_on PROPERTIES COMPILE_FLAGS "-DGARBAGE_STACK -fstack-cleaner")
+ add_dependencies(tests bugged1_liveness_cleaner_on)
- add_executable (bugged1_liveness_cleaner_off bugged1_liveness.c)
+ add_executable (bugged1_liveness_cleaner_off EXCLUDE_FROM_ALL bugged1_liveness.c)
target_link_libraries(bugged1_liveness_cleaner_off simgrid)
set_target_properties(bugged1_liveness_cleaner_off PROPERTIES COMPILE_FLAGS "-DGARBAGE_STACK -fno-stack-cleaner")
+ add_dependencies(tests bugged1_liveness_cleaner_off)
endif()
endif()
include_directories(BEFORE "${CMAKE_HOME_DIRECTORY}/include/smpi")
foreach (test ${umpire_tests_passing} ${umpire_tests_deadlock} ${umpire_tests_problematic} )
- add_executable(${test} ${test}.c)
+ add_executable(${test} EXCLUDE_FROM_ALL ${test}.c)
+ add_dependencies(tests ${test})
target_link_libraries(${test} simgrid)
set_source_files_properties(${test}.c PROPERTIES COMPILE_FLAGS "-Dlint -Wno-error -Wno-return-type")
set(umpire_tesh ${umpire_tesh} ${test})
add_executable (unit-tmgr src/surf/trace_mgr_test.cpp)
target_link_libraries(unit-tmgr simgrid boost_unit_test_framework)
ADD_TEST(unit-tmgr ${CMAKE_BINARY_DIR}/unit-tmgr --build_info=yes)
- set_property(
- TARGET unit-tmgr
- APPEND PROPERTY
- INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}"
- )
+ set_property(TARGET unit-tmgr APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+ add_dependencies(tests unit-tmgr)
if (SIMGRID_HAVE_MC)
# snapshot
add_executable (unit-mc-snapshot src/mc/sosp/mc_snapshot_test.cpp)
target_link_libraries(unit-mc-snapshot simgrid boost_unit_test_framework)
ADD_TEST(unit-mc-snapshot ${CMAKE_BINARY_DIR}/unit-mc-snapshot --build_info=yes)
- set_property(
- TARGET unit-mc-snapshot
- APPEND PROPERTY
- INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}"
- )
+ set_property(TARGET unit-mc-snapshot APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+ add_dependencies(tests unit-mc-snapshot)
# pagestore
add_executable (unit-mc-pagestore src/mc/sosp/PageStore_test.cpp)
target_link_libraries(unit-mc-pagestore simgrid boost_unit_test_framework)
ADD_TEST(unit-mc-pagestore ${CMAKE_BINARY_DIR}/unit-mc-pagestore --build_info=yes)
- set_property(
- TARGET unit-mc-pagestore
- APPEND PROPERTY
- INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}"
- )
+ set_property(TARGET unit-mc-pagestore APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
+ add_dependencies(tests unit-mc-pagestore)
endif()
else()
COMMAND ${CMAKE_HOME_DIRECTORY}/tools/sg_unit_extractor.pl --root=src/ --outdir=${CMAKE_CURRENT_BINARY_DIR}/src/ ${FILES_CONTAINING_UNITTESTS}
)
-add_executable (testall ${EXTRACTED_TEST_SOURCE_FILES})
+add_executable (testall EXCLUDE_FROM_ALL ${EXTRACTED_TEST_SOURCE_FILES})
+add_dependencies(tests testall)
target_link_libraries(testall simgrid)
set_property(
TARGET testall
-add_executable (graphicator graphicator.c)
+add_executable (graphicator EXCLUDE_FROM_ALL graphicator.c)
+add_dependencies (tests graphicator)
target_link_libraries(graphicator simgrid)
set_target_properties(graphicator PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
ADD_TESH(graphicator --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR}/bin --cd ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/graphicator.tesh)