-# CHORD EXAMPLE
-add_executable (s4u-dht-chord dht-chord/s4u-dht-chord.cpp dht-chord/s4u-dht-chord-node.cpp)
-target_link_libraries(s4u-dht-chord simgrid)
-set_target_properties(s4u-dht-chord PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-chord)
-foreach (file s4u-dht-chord s4u-dht-chord-node)
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/${file}.cpp)
-endforeach()
-set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord.hpp)
-
-# KADEMLIA EXAMPLE
-add_executable (s4u-dht-kademlia dht-kademlia/s4u-dht-kademlia.cpp dht-kademlia/node.cpp
- dht-kademlia/routing_table.cpp dht-kademlia/answer.cpp)
-target_link_libraries(s4u-dht-kademlia simgrid)
-set_target_properties(s4u-dht-kademlia PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dht-kademlia)
-foreach (file answer routing_table node s4u-dht-kademlia)
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/${file}.hpp)
-endforeach()
-set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/message.hpp)
-
-# BITTORRENT EXAMPLE
-add_executable (s4u-bittorrent app-bittorrent/s4u-bittorrent.cpp app-bittorrent/s4u-peer.cpp
- app-bittorrent/s4u-tracker.cpp)
-target_link_libraries(s4u-bittorrent simgrid)
-set_target_properties(s4u-bittorrent PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/app-bittorrent)
-foreach (file s4u-bittorrent s4u-peer s4u-tracker)
- set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/${file}.hpp)
-endforeach()
+# Model-checking liveness
+if(SIMGRID_HAVE_MC)
+ IF(HAVE_UCONTEXT_CONTEXTS AND SIMGRID_PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
+ ADD_TESH(s4u-mc-bugged1-liveness-ucontext --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ --cd ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness
+ ${CMAKE_HOME_DIRECTORY}/examples/s4u/mc-bugged1-liveness/s4u-mc-bugged1-liveness.tesh)
+
+ ADD_TESH(s4u-mc-bugged1-liveness-visited-ucontext --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness
+ --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms
+ --cd ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness
+ ${CMAKE_HOME_DIRECTORY}/examples/s4u/mc-bugged1-liveness/s4u-mc-bugged1-liveness-visited.tesh)
+ IF(HAVE_C_STACK_CLEANER)
+ # This test checks if the stack cleaner is making a difference:
+ ADD_TEST(s4u-mc-bugged1-liveness-stack-cleaner ${CMAKE_HOME_DIRECTORY}/examples/s4u/mc-bugged1-liveness/s4u-mc-bugged1-liveness-stack-cleaner
+ ${CMAKE_HOME_DIRECTORY}/examples/s4u/mc-bugged1-liveness/
+ ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness/)
+ ENDIF()
+ ENDIF()
+
+ if (enable_coverage)
+ SET_TESTS_PROPERTIES(mc-bugged1-liveness-visited-ucontext PROPERTIES RUN_SERIAL "TRUE")
+ endif()
+ENDIF()
+
+# The tests the parallel variant of of DHTs
+
+if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
+ # Thread-local storage (TLS) is needed for parallel execution, but it doesn't
+ # play well with Ucontexts on 64bit SunOS (at least on x86_64).
+ set(parallel-factories "thread;raw;boost")
+else()
+ set(parallel-factories "thread;ucontext;raw;boost")
+endif()