Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / teshsuite / mc / CMakeLists.txt
1
2 foreach(x random-bug mutex-handling)
3
4   if(NOT DEFINED ${x}_sources)
5     set(${x}_sources ${x}/${x}.cpp)
6   endif()
7
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})
15   endif()
16
17   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
18
19   foreach(file ${${x}_sources})
20     set(teshsuite_src  ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${file})
21   endforeach()
22
23   unset(${x}_sources)
24   unset(${x}_disable)
25
26 endforeach()
27
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)
33
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)
35 IF(SIMGRID_HAVE_MC)
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)
41 ENDIF()
42
43 if(enable_coverage)
44   ADD_TEST(cover-mc-mutex-handling ${CMAKE_CURRENT_BINARY_DIR}/mutex-handling/mutex-handling ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml)
45 endif()
46
47
48 foreach(x
49             simple_barrier_ok              simple_barrier_deadlock
50             simple_barrier_with_threads_ok simple_barrier_with_threads_deadlock
51
52 #            simple_cond_ok 
53
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
57
58 #                 simple_cond_deadlock
59              simple_mutex_ok simple_mutex_deadlock
60              simple_mutex_with_threads_ok simple_mutex_with_threads_deadlock
61
62              simple_semaphore_deadlock simple_semaphores_deadlock
63              simple_semaphores_ok
64              simple_semaphores_with_threads_ok simple_semaphores_with_threads_deadlock
65              
66              simple_threads_ok
67
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    
72              
73              # philosophers_spurious_deadlock # infinite no-op loop             
74              # producer_consumer_spurious_nok # infinite no-op loop
75              )
76
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)
79
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})
85
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)
87   endif()
88 endforeach()
89
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)