X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f64f084e4d025a764f8c779fe55d241ceae9443f..ecd057376de847d40e1e29e2bf33e95eae3f835f:/examples/cpp/CMakeLists.txt diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt index 3b9056e583..1e4132106e 100644 --- a/examples/cpp/CMakeLists.txt +++ b/examples/cpp/CMakeLists.txt @@ -1,4 +1,3 @@ - # Regular examples: with only one source and tested with all factories by default ################################################################################# ### Define the examples' specificities @@ -20,19 +19,12 @@ if(WIN32) set(_maestro-set_disable 1) endif() -set(MC_regular_tests mc-bugged1 mc-bugged2 mc-failing-assert mc-electric-fence) -foreach (example ${MC_regular_tests}) - if(NOT SIMGRID_HAVE_MC) - set(_${example}_disable 1) - endif() - set(_${example}_factories "^thread") -endforeach() - if(SIMGRID_HAVE_MC) - add_executable (s4u-mc-bugged1-liveness EXCLUDE_FROM_ALL mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp) - target_link_libraries(s4u-mc-bugged1-liveness simgrid) - set_target_properties(s4u-mc-bugged1-liveness PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness) - add_dependencies(tests-mc s4u-mc-bugged1-liveness) + # These tests timeout with threads, maybe because of dwarf parsing? not sure + foreach(example mc-bugged1 mc-bugged2 mc-failing-assert mc-electric-fence) + set(_${example}_factories "^thread") # Timeout + add_dependencies(tests-mc s4u-${example}) + endforeach() if(HAVE_C_STACK_CLEANER) add_executable (s4u-mc-bugged1-liveness-cleaner-on EXCLUDE_FROM_ALL s4u-mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp) @@ -45,8 +37,72 @@ if(SIMGRID_HAVE_MC) set_target_properties(s4u-mc-bugged1-liveness-cleaner-off PROPERTIES COMPILE_FLAGS "-DGARBAGE_STACK -fno-stack-cleaner") add_dependencies(tests-mc s4u-mc-bugged1-liveness-cleaner-off) endif() + + # Model-checking liveness + if(HAVE_UCONTEXT_CONTEXTS AND SIMGRID_PROCESSOR_x86_64) + # liveness model-checking works only on 64bits (for now ...) + set(_mc-bugged1-liveness_factories "ucontext") + add_dependencies(tests-mc s4u-mc-bugged1-liveness) + set(_mc-bugged2-liveness_factories "ucontext") + + # This example never ends, disable it for now + set(_mc-bugged2-liveness_disable 1) + + 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/cpp/mc-bugged1-liveness/s4u-mc-bugged1-liveness-visited.tesh) + IF(HAVE_C_STACK_CLEANER) + add_dependencies(tests-mc s4u-mc-bugged1-liveness-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/cpp/mc-bugged1-liveness/s4u-mc-bugged1-liveness-stack-cleaner + ${CMAKE_HOME_DIRECTORY}/examples/cpp/mc-bugged1-liveness/ + ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness/) + ENDIF() + else() + set(_mc-bugged1-liveness_disable 1) + set(_mc-bugged2-liveness_disable 1) + endif() + + if(enable_coverage) + foreach (example mc-bugged1 mc-bugged2 mc-electric-fence mc-failing-assert) + ADD_TEST(cover-${example} ${CMAKE_CURRENT_BINARY_DIR}/${example}/s4u-${example} ${CMAKE_HOME_DIRECTORY}/examples/platforms/model_checker_platform.xml) + endforeach() + ADD_TEST(cover-mc-bugged1-liveness ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml 1 1001) + endif() + +else() + foreach (example mc-bugged1 mc-bugged2 mc-centralized-mutex mc-failing-assert mc-electric-fence + mc-bugged1-liveness mc-bugged2-liveness) + set(_${example}_disable 1) + endforeach() endif() +# Hijack some regular tests to run them on top of the MC +foreach (example synchro-barrier synchro-mutex synchro-semaphore) + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${example}/s4u-mc-${example}.tesh) + + if (SIMGRID_HAVE_MC) + ADD_TESH(s4u-mc-${example} + --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} + --setenv libdir=${CMAKE_BINARY_DIR}/lib + --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms + --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example} + --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} + ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-mc-${example}.tesh) + + add_dependencies(tests-mc s4u-${example}) + endif() +endforeach() + +if (SIMGRID_HAVE_MC) + # Dependency on the regular tests + foreach(example mc-centralized-mutex) + add_dependencies(tests-mc s4u-${example}) + endforeach() +endif() + + if(NOT HAVE_GRAPHVIZ) set(_dag-from-dot_disable 1) endif() @@ -59,20 +115,21 @@ endif() # Deal with each example -foreach (example actor-create actor-daemon actor-exiting actor-join actor-kill +foreach (example activity-testany activity-waitany + actor-create actor-daemon actor-exiting actor-join actor-kill actor-lifetime actor-migrate actor-suspend actor-yield actor-stacksize app-bittorrent app-chainsend app-token-ring - comm-pingpong comm-ready comm-serialize comm-suspend comm-wait comm-waitany comm-waitall comm-waituntil + comm-pingpong comm-ready comm-serialize comm-suspend comm-testany comm-wait comm-waitany comm-waitall comm-waituntil comm-dependent comm-host2host comm-failure comm-throttling cloud-capping cloud-migration cloud-simple - dag-comm dag-from-dot dag-failure dag-io dag-simple + dag-comm dag-from-dax dag-from-dot dag-failure dag-io dag-scheduling dag-simple dht-chord dht-kademlia energy-exec energy-boot energy-link energy-vm energy-exec-ptask energy-wifi engine-filtering engine-run-partial exec-async exec-basic exec-dvfs exec-remote exec-waitany exec-waitfor exec-dependent exec-unassigned - exec-ptask-multicore exec-cpu-nonlinear exec-cpu-factors exec-failure + exec-ptask-multicore exec-ptask-multicore-latency exec-cpu-nonlinear exec-cpu-factors exec-failure exec-threads maestro-set - mc-bugged1 mc-bugged2 mc-electric-fence mc-failing-assert + mc-bugged1 mc-bugged1-liveness mc-bugged2 mc-bugged2-liveness mc-centralized-mutex mc-electric-fence mc-failing-assert network-ns3 network-ns3-wifi network-wifi io-async io-priority io-degradation io-file-system io-file-remote io-disk-raw io-dependent platform-failures platform-profile platform-properties @@ -136,41 +193,6 @@ foreach(variant fun class) endforeach() set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers.tesh) -# Model-checking -if(SIMGRID_HAVE_MC) - foreach (example ${MC_regular_tests}) - if(NOT DEFINED _${example}_disable) - add_dependencies(tests-mc s4u-${example}) - endif() - endforeach() - - # Model-checking liveness - IF(HAVE_UCONTEXT_CONTEXTS AND SIMGRID_PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...) - add_dependencies(tests-mc s4u-mc-bugged1-liveness) - 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/cpp/mc-bugged1-liveness/s4u-mc-bugged1-liveness.tesh) - -# This example hit the 5' timeout on CI, disable it for now -# 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/cpp/mc-bugged1-liveness/s4u-mc-bugged1-liveness-visited.tesh) - IF(HAVE_C_STACK_CLEANER) - add_dependencies(tests-mc s4u-mc-bugged1-liveness-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/cpp/mc-bugged1-liveness/s4u-mc-bugged1-liveness-stack-cleaner - ${CMAKE_HOME_DIRECTORY}/examples/cpp/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) @@ -191,6 +213,31 @@ foreach(example app-bittorrent app-masterworkers ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}.tesh) endforeach() +# Test non-DPOR reductions on a given MC test +foreach(example mc-failing-assert) + if(SIMGRID_HAVE_MC) +# State equality is not tested because it would take about 15 hours to run that test on my machine. +# We should first optimize mmalloc_heap_differ() which takes ~4sec for each pair to compare (maybe {175 x 174/ 2} pairs here) +# See the comment on mmalloc_heap_differ() in compare.cpp for more info on why it's hard to optimize. +# +# ADD_TESH(s4u-${example}-statequality --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} +# --setenv libdir=${CMAKE_BINARY_DIR}/lib +# --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms +# --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example} +# --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} +# ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-statequality.tesh) + + ADD_TESH(s4u-${example}-nodpor --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/${example} + --setenv libdir=${CMAKE_BINARY_DIR}/lib + --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms + --setenv srcdir=${CMAKE_CURRENT_SOURCE_DIR}/${example} + --cd ${CMAKE_CURRENT_SOURCE_DIR}/${example} + ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-nodpor.tesh) + endif() + set(tesh_files ${tesh_files} ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-statequality.tesh) + set(tesh_files ${tesh_files} ${CMAKE_HOME_DIRECTORY}/examples/cpp/${example}/s4u-${example}-nodpor.tesh) +endforeach() + # Examples not accepting factories ################################## @@ -212,40 +259,25 @@ foreach (example exec-ptask trace-categories trace-masterworkers trace-platform endforeach() if (NOT enable_memcheck AND NOT WIN32) - ADD_TESH(simix-breakpoint --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/comm-pingpong + ADD_TESH(debug-breakpoint --setenv bindir=${CMAKE_CURRENT_BINARY_DIR}/comm-pingpong --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms - ${CMAKE_CURRENT_SOURCE_DIR}/comm-pingpong/simix-breakpoint.tesh) -endif() - -if(enable_coverage AND SIMGRID_HAVE_MC) - foreach (example mc-bugged1 mc-bugged2 mc-electric-fence mc-failing-assert) - ADD_TEST(cover-${example} ${CMAKE_CURRENT_BINARY_DIR}/${example}/s4u-${example} ${CMAKE_HOME_DIRECTORY}/examples/platforms/model_checker_platform.xml) - endforeach() - ADD_TEST(cover-mc-bugged1-liveness ${CMAKE_CURRENT_BINARY_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness ${CMAKE_HOME_DIRECTORY}/examples/platforms/small_platform.xml 1 1001) + ${CMAKE_CURRENT_SOURCE_DIR}/comm-pingpong/debug-breakpoint.tesh) endif() # Add all extra files to the archive #################################### set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.cpp PARENT_SCOPE) -set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/comm-pingpong/simix-breakpoint.tesh +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/comm-pingpong/debug-breakpoint.tesh ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness.tesh ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness-visited.tesh PARENT_SCOPE) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-actor-create_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/actor-lifetime/s4u-actor-lifetime_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/actor-yield/s4u-actor-yield_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/app-bittorrent/s4u-app-bittorrent_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/app-masterworkers/s4u-app-masterworkers_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/comm-suspend/s4u-comm-suspend_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/comm-wait/s4u-comm-wait_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/comm-waitany/s4u-comm-waitany_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/comm-waitall/s4u-comm-waitall_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/comm-ready/s4u-comm-ready_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/comm-waituntil/s4u-comm-waituntil_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/dag-scheduling/Montage_25.xml ${CMAKE_CURRENT_SOURCE_DIR}/dht-chord/s4u-dht-chord_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/s4u-dht-kademlia_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/energy-boot/platform_boot.xml ${CMAKE_CURRENT_SOURCE_DIR}/io-file-remote/s4u-io-file-remote_d.xml - ${CMAKE_CURRENT_SOURCE_DIR}/platform-properties/s4u-platform-properties_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/platform-failures/s4u-platform-failures_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm_d.xml @@ -259,10 +291,13 @@ set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/actor-create/s4u-a ${CMAKE_CURRENT_SOURCE_DIR}/network-ns3/one_cluster_d.xml PARENT_SCOPE) set(bin_files ${bin_files} ${CMAKE_CURRENT_SOURCE_DIR}/dht-kademlia/generate.py ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/s4u-mc-bugged1-liveness-stack-cleaner - ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/promela_bugged1_liveness PARENT_SCOPE) -set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dot/dag.dot + ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged1-liveness/promela_bugged1_liveness + ${CMAKE_CURRENT_SOURCE_DIR}/mc-bugged2-liveness/promela_bugged2_liveness PARENT_SCOPE) +set(txt_files ${txt_files} ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dax/simple_dax_with_cycle.xml + ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dax/smalldax.xml + ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dot/dag.dot + ${CMAKE_CURRENT_SOURCE_DIR}/dag-from-dot/dag_with_cycle.dot ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p0.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm-split-p1.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay-comm/s4u-replay-comm.txt ${CMAKE_CURRENT_SOURCE_DIR}/replay-io/s4u-replay-io.txt PARENT_SCOPE) -