Logo AND Algorithmique Numérique Distribuée

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