1 IF(enable_smpi AND NOT WIN32)
2 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicc)
3 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpicxx)
4 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff)
5 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif90)
6 execute_process(COMMAND chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun)
9 SET(TESH_OPTION "--ignore-jenkins")
10 SET(TESH_COMMAND "${PYTHON_EXECUTABLE}" ${CMAKE_BINARY_DIR}/bin/tesh)
16 #some tests may take forever on non futexes systems, using busy_wait with n cores < n workers
17 # default to posix for these tests if futexes are not supported
19 SET(CONTEXTS_SYNCHRO --cfg contexts/synchro:posix)
24 LIST(REMOVE_AT ARGT 0)
26 STRING(REPLACE "§" "\;" ARGT "${ARGT}")
29 ADD_TEST(${NAME} ${TESH_COMMAND} --wrapper "${TESH_WRAPPER}" ${TESH_OPTION} ${ARGT})
31 ADD_TEST(${NAME} ${TESH_COMMAND} ${TESH_OPTION} ${ARGT})
35 MACRO(ADD_TESH_FACTORIES NAME FACTORIES)
37 LIST(REMOVE_AT ARGR 0) # remove name
38 FOREACH(I ${FACTORIES}) # remove all factories
39 LIST(REMOVE_AT ARGR 0)
41 FOREACH(FACTORY ${FACTORIES})
42 if ((${FACTORY} STREQUAL "thread" AND HAVE_THREAD_CONTEXTS) OR
43 (${FACTORY} STREQUAL "boost" AND HAVE_BOOST_CONTEXTS) OR
44 (${FACTORY} STREQUAL "raw" AND HAVE_RAW_CONTEXTS) OR
45 (${FACTORY} STREQUAL "ucontext" AND HAVE_UCONTEXT_CONTEXTS))
46 ADD_TESH("${NAME}-${FACTORY}" "--cfg" "contexts/factory:${FACTORY}" ${ARGR})
53 SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/\;${CMAKE_BINARY_DIR}/teshsuite/java/\;${SIMGRID_JAR}")
54 STRING(REPLACE "\;" "§" TESH_CLASSPATH "${TESH_CLASSPATH}")
56 SET(TESH_CLASSPATH "${CMAKE_BINARY_DIR}/examples/java/:${CMAKE_BINARY_DIR}/teshsuite/java/:${SIMGRID_JAR}")
61 ADD_TESH_FACTORIES(mc-bugged1 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
62 ADD_TESH_FACTORIES(mc-bugged2 "ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
63 IF(HAVE_UCONTEXT_CONTEXTS AND SIMGRID_PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
64 ADD_TESH(mc-bugged1-liveness-ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh)
65 ADD_TESH(mc-bugged1-liveness-ucontext-sparse --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_sparse.tesh)
66 ADD_TESH(mc-bugged1-liveness-visited-ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_visited.tesh)
67 ADD_TESH(mc-bugged1-liveness-visited-ucontext-sparse --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness_visited_sparse.tesh)
68 IF(HAVE_C_STACK_CLEANER)
69 # This test checks if the stack cleaner is making a difference:
70 ADD_TEST(mc-bugged1-liveness-stack-cleaner ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/bugged1_liveness_stack_cleaner ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/ ${CMAKE_BINARY_DIR}/examples/msg/mc/)
75 IF(enable_smpi_MPICH3_testsuite AND SMPI_FORTRAN AND HAVE_THREAD_CONTEXTS)
76 ADD_TEST(test-smpi-mpich3-thread-f77 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/stack-size:8000 -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION})
77 SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
78 ADD_TEST(test-smpi-mpich3-thread-f90 ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ ${PERL_EXECUTABLE} ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests ${TESH_OPTION} -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -privatization=${HAVE_PRIVATIZATION} -execarg=--cfg=smpi/privatization:${HAVE_PRIVATIZATION} -execarg=--cfg=contexts/factory:thread)
79 SET_TESTS_PROPERTIES(test-smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
83 # Tests testing simulation from C but using lua for platform files. Executed like this
84 # ~$ ./masterslave platform.lua deploy.lua
85 ADD_TESH(lua-platform-masterslave --setenv srcdir=${CMAKE_HOME_DIRECTORY} --setenv bindir=${CMAKE_BINARY_DIR} --cd ${CMAKE_BINARY_DIR} ${CMAKE_HOME_DIRECTORY}/teshsuite/lua/lua_platforms.tesh)
86 SET_TESTS_PROPERTIES(lua-platform-masterslave PROPERTIES ENVIRONMENT "LUA_CPATH=${CMAKE_BINARY_DIR}/lib/lib?.${LIB_EXE}")
89 ADD_TEST(testall ${CMAKE_BINARY_DIR}/testall)
91 # New tests should use the Boost Unit Test Framework
92 if(Boost_UNIT_TEST_FRAMEWORK_FOUND)
93 add_executable (unit_tmgr src/surf/trace_mgr_test.cpp)
94 target_link_libraries(unit_tmgr simgrid ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
95 ADD_TEST(unit_tmgr ${CMAKE_BINARY_DIR}/unit_tmgr --build_info=yes)
98 set(EXTRA_DIST ${EXTRA_DIST} src/surf/trace_mgr_test.cpp)
101 # Also test the tutorial, if SIMGRID_INSTALL_PATH is defined and gcc used
102 if(CMAKE_COMPILER_IS_GNUCC AND
103 (NOT "${SIMGRID_INSTALL_PATH}" STREQUAL ""))
104 ADD_TEST(tuto-msg-0 sh -c "make -C ${CMAKE_SOURCE_DIR}/doc/tuto-msg masterworker && ${CMAKE_SOURCE_DIR}/doc/tuto-msg/masterworker ${CMAKE_SOURCE_DIR}/examples/platforms/small_platform.xml ${CMAKE_SOURCE_DIR}/doc/tuto-msg/deployment0.xml")
105 ADD_TEST(tuto-msg-1 sh -c "make -C ${CMAKE_SOURCE_DIR}/doc/tuto-msg masterworker-sol1 && ${CMAKE_SOURCE_DIR}/doc/tuto-msg/masterworker-sol1 ${CMAKE_SOURCE_DIR}/examples/platforms/small_platform.xml ${CMAKE_SOURCE_DIR}/doc/tuto-msg/deployment1.xml")
106 ADD_TEST(tuto-msg-2 sh -c "make -C ${CMAKE_SOURCE_DIR}/doc/tuto-msg masterworker-sol2 && ${CMAKE_SOURCE_DIR}/doc/tuto-msg/masterworker-sol2 ${CMAKE_SOURCE_DIR}/examples/platforms/small_platform.xml ${CMAKE_SOURCE_DIR}/doc/tuto-msg/deployment2.xml")
107 ADD_TEST(tuto-msg-3 sh -c "make -C ${CMAKE_SOURCE_DIR}/doc/tuto-msg masterworker-sol3 && ${CMAKE_SOURCE_DIR}/doc/tuto-msg/masterworker-sol3 ${CMAKE_SOURCE_DIR}/examples/platforms/small_platform.xml ${CMAKE_SOURCE_DIR}/doc/tuto-msg/deployment3.xml")
108 ADD_TEST(tuto-msg-4 sh -c "make -C ${CMAKE_SOURCE_DIR}/doc/tuto-msg masterworker-sol4 && ${CMAKE_SOURCE_DIR}/doc/tuto-msg/masterworker-sol4 ${CMAKE_SOURCE_DIR}/examples/platforms/small_platform.xml ${CMAKE_SOURCE_DIR}/doc/tuto-msg/deployment3.xml")
110 FOREACH(TUTOTEST tuto-msg-0 tuto-msg-1 tuto-msg-2 tuto-msg-3 tuto-msg-4)
111 SET_TESTS_PROPERTIES(${TUTOTEST}
112 PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")