2 foreach(x random-bug mutex-handling)
4 if(NOT DEFINED ${x}_sources)
5 set(${x}_sources ${x}/${x}.cpp)
8 if(NOT DEFINED ${x}_disable)
9 add_executable (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp)
10 target_link_libraries(${x} simgrid)
11 set_target_properties(${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
12 set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
13 target_compile_options(${x} PRIVATE ${CMAKE_C_DEBUG_FLAGS})
14 add_dependencies(tests-mc ${x})
17 set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
19 foreach(file ${${x}_sources})
20 set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${file})
28 add_executable (without-mutex-handling EXCLUDE_FROM_ALL mutex-handling/mutex-handling.cpp)
29 target_link_libraries(without-mutex-handling simgrid)
30 set_target_properties(without-mutex-handling PROPERTIES COMPILE_FLAGS -DDISABLE_THE_MUTEX=1)
31 set_target_properties(without-mutex-handling PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling)
32 add_dependencies(tests-mc without-mutex-handling)
34 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)
36 ADD_TESH(tesh-mc-mutex-handling --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling mutex-handling.tesh --cfg=model-check/reduction:none)
37 ADD_TESH(tesh-mc-mutex-handling-dpor --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling mutex-handling.tesh --cfg=model-check/reduction:dpor)
38 ADD_TESH(tesh-mc-without-mutex-handling --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling without-mutex-handling.tesh --cfg=model-check/reduction:none)
39 ADD_TESH(tesh-mc-without-mutex-handling-dpor --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/mc/mutex-handling --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/mc/mutex-handling without-mutex-handling.tesh --cfg=model-check/reduction:dpor)
40 ADD_TESH(mc-random-bug --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.tesh)
44 ADD_TEST(cover-mc-mutex-handling ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling/mutex-handling ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml)
49 simple_barrier_ok simple_barrier_deadlock
50 simple_barrier_with_threads_ok simple_barrier_with_threads_deadlock
54 # simple_cond_broadcast_ok simple_cond_broadcast_deadlock
55 # simple_cond_broadcast_with_semaphore_ok
56 # simple_cond_broadcast_with_semaphore_deadlock1 simple_cond_broadcast_with_semaphore_deadlock2
58 # simple_cond_deadlock
59 simple_mutex_ok simple_mutex_deadlock
60 simple_mutex_with_threads_ok simple_mutex_with_threads_deadlock
62 simple_semaphore_deadlock simple_semaphores_deadlock
64 simple_semaphores_with_threads_ok simple_semaphores_with_threads_deadlock
68 barber_shop_ok barber_shop_deadlock
69 philosophers_semaphores_ok philosophers_semaphores_deadlock
70 philosophers_mutex_ok philosophers_mutex_deadlock
71 producer_consumer_ok producer_consumer_deadlock
73 # philosophers_spurious_deadlock # infinite no-op loop
74 # producer_consumer_spurious_nok # infinite no-op loop
77 set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/mcmini/${x}.c)
78 set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/mcmini/${x}.tesh)
80 if("${CMAKE_SYSTEM}" MATCHES "Linux" AND ${enable_testsuite_McMini})
81 add_executable (mcmini-${x} EXCLUDE_FROM_ALL mcmini/${x}.c)
82 set_target_properties(mcmini-${x} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mcmini)
83 target_link_libraries(mcmini-${x} PRIVATE Threads::Threads)
84 add_dependencies(tests-mc mcmini-${x})
86 ADD_TESH(mc-mini-${x} --setenv libdir=${CMAKE_BINARY_DIR}/lib --setenv bindir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/mcmini/${x}.tesh)
90 set(teshsuite_src ${teshsuite_src} PARENT_SCOPE)
91 set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-replay.tesh
92 ${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/without-mutex-handling.tesh PARENT_SCOPE)