Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add more Mc Mini tests
[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 #              
50 #             simple_cond_broadcast_deadlock   simple_barrier_deadlock  simple_cond_deadlock
51              simple_mutex_ok simple_mutex_deadlock
52              simple_mutex_with_threads_ok simple_mutex_with_threads_deadlock
53
54              simple_semaphore_deadlock simple_semaphores_deadlock
55              simple_semaphores_ok
56              simple_semaphores_with_threads_ok simple_semaphores_with_threads_deadlock
57 #            
58 #            philosophers_spurious_deadlock
59 #            simple_barrier_with_threads_deadlock
60 #            simple_cond_broadcast_with_semaphore_deadlock1  simple_cond_broadcast_with_semaphore_deadlock2
61              
62              barber_shop_ok             barber_shop_deadlock
63              philosophers_semaphores_ok philosophers_semaphores_deadlock
64              philosophers_mutex_ok      philosophers_mutex_deadlock
65              producer_consumer_ok       producer_consumer_deadlock    
66              
67              
68              # producer_consumer_spurious_nok # infinite no-op loop
69              
70 #             simple_barrier_ok simple_barrier_with_threads_ok simple_cond_broadcast_ok
71 #             simple_cond_broadcast_with_semaphore_ok simple_cond_ok 
72 #               simple_threads_ok
73              )
74
75   set(teshsuite_src  ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/mcmini/${x}.c)
76   set(tesh_files     ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/mcmini/${x}.tesh)
77
78   if("${CMAKE_SYSTEM}" MATCHES "Linux" AND ${enable_testsuite_McMini})
79     add_executable       (mcmini-${x}  EXCLUDE_FROM_ALL mcmini/${x}.c)         
80     set_target_properties(mcmini-${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mcmini)
81     target_link_libraries(mcmini-${x}  PRIVATE Threads::Threads)
82     add_dependencies(tests-mc mcmini-${x})
83
84     ADD_TESH(mc-mini-${x} --setenv libdir=${CMAKE_BINARY_DIR}/lib --setenv bindir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/mcmini/${x}.tesh)
85   endif()
86 endforeach()
87
88 set(teshsuite_src  ${teshsuite_src}                                                                        PARENT_SCOPE)
89 set(tesh_files     ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/random-bug/random-bug-replay.tesh
90                                     ${CMAKE_CURRENT_SOURCE_DIR}/mutex-handling/without-mutex-handling.tesh PARENT_SCOPE)