From: Frederic Suter Date: Tue, 1 Mar 2016 22:49:11 +0000 (+0100) Subject: declare test right in the CMakelists X-Git-Tag: v3_13~592^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3e78e046f7768f45e64ab8f7720937b0ca4e3a00 declare test right in the CMakelists + and use foreach loop when possible --- diff --git a/teshsuite/msg/host_on_off/CMakeLists.txt b/teshsuite/msg/host_on_off/CMakeLists.txt index d34ab6597b..65ebe4f51c 100644 --- a/teshsuite/msg/host_on_off/CMakeLists.txt +++ b/teshsuite/msg/host_on_off/CMakeLists.txt @@ -5,9 +5,9 @@ foreach(x host_on_off host_on_off_wait host_on_off_recv) set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.tesh) set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c) - ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x} --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/${x}/${x}.tesh) + ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/host_on_off ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off/${x}.tesh) endforeach() -set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_d.xml PARENT_SCOPE) -set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) -set(tesh_files ${tesh_files} PARENT_SCOPE) \ No newline at end of file +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_d.xml PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) +set(tesh_files ${tesh_files} PARENT_SCOPE) \ No newline at end of file diff --git a/teshsuite/msg/host_on_off_processes/CMakeLists.txt b/teshsuite/msg/host_on_off_processes/CMakeLists.txt index 91946d3671..1077205679 100644 --- a/teshsuite/msg/host_on_off_processes/CMakeLists.txt +++ b/teshsuite/msg/host_on_off_processes/CMakeLists.txt @@ -1,15 +1,8 @@ add_executable (host_on_off_processes host_on_off_processes.c) target_link_libraries(host_on_off_processes simgrid) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_processes.tesh - PARENT_SCOPE) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_processes_d.xml - PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_processes.c - PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_processes.tesh PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_processes_d.xml PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_processes.c PARENT_SCOPE) + +ADD_TESH_FACTORIES(tesh-msg-host-on-off-processes "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off_processes --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/host_on_off_processes ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh) diff --git a/teshsuite/msg/pid/CMakeLists.txt b/teshsuite/msg/pid/CMakeLists.txt index 988789a58f..1f5477ae3d 100644 --- a/teshsuite/msg/pid/CMakeLists.txt +++ b/teshsuite/msg/pid/CMakeLists.txt @@ -1,15 +1,8 @@ add_executable (pid pid.c) target_link_libraries(pid simgrid) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/pid.tesh - PARENT_SCOPE) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml - PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/pid.c - PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/pid.tesh PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/pid.c PARENT_SCOPE) + +ADD_TESH_FACTORIES(tesh-msg-pid "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/pid ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid/pid.tesh) diff --git a/teshsuite/msg/process/CMakeLists.txt b/teshsuite/msg/process/CMakeLists.txt index 903406549e..530bb37350 100644 --- a/teshsuite/msg/process/CMakeLists.txt +++ b/teshsuite/msg/process/CMakeLists.txt @@ -1,15 +1,8 @@ add_executable (process process.c) target_link_libraries(process simgrid) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/process.tesh - PARENT_SCOPE) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/process_d.xml - PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/process.c - PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/process.tesh PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/process.c PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/process_d.xml PARENT_SCOPE) + +ADD_TESH_FACTORIES(tesh-msg-process "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/process ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process/process.tesh) diff --git a/teshsuite/msg/process_join/CMakeLists.txt b/teshsuite/msg/process_join/CMakeLists.txt index adb7caccaf..17b581f0d8 100644 --- a/teshsuite/msg/process_join/CMakeLists.txt +++ b/teshsuite/msg/process_join/CMakeLists.txt @@ -1,15 +1,8 @@ add_executable (process_join process_join.c) target_link_libraries(process_join simgrid) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/process_join.tesh - PARENT_SCOPE) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/process_join_d.xml - PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/process_join.c - PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/process_join.tesh PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/process_join.c PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/process_join_d.xml PARENT_SCOPE) + +ADD_TESH_FACTORIES(tesh-msg-process-join "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/process_join ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join/process_join.tesh) diff --git a/teshsuite/msg/storage/CMakeLists.txt b/teshsuite/msg/storage/CMakeLists.txt index 68bc0d895c..b756abf448 100644 --- a/teshsuite/msg/storage/CMakeLists.txt +++ b/teshsuite/msg/storage/CMakeLists.txt @@ -1,18 +1,14 @@ -add_executable (storage_basic storage_basic.c) -target_link_libraries(storage_basic simgrid) -add_executable (concurrent_rw concurrent_rw.c) -target_link_libraries(concurrent_rw simgrid) +foreach(x storage_basic concurrent_rw) + add_executable (${x} ${x}.c) + target_link_libraries(${x} simgrid) + + set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.tesh) + set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}.c) + + ADD_TESH_FACTORIES(tesh-msg-${x} "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/storage ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/${x}.tesh) +endforeach() + +set(tesh_files ${tesh_files} PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml PARENT_SCOPE) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/storage_basic.tesh - PARENT_SCOPE) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/deployment.xml - PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/storage_basic.c - ${CMAKE_CURRENT_SOURCE_DIR}/concurrent_rw.c - PARENT_SCOPE) diff --git a/teshsuite/msg/task_destroy_cancel/CMakeLists.txt b/teshsuite/msg/task_destroy_cancel/CMakeLists.txt index bfcd350dcb..645bb7f57e 100644 --- a/teshsuite/msg/task_destroy_cancel/CMakeLists.txt +++ b/teshsuite/msg/task_destroy_cancel/CMakeLists.txt @@ -1,15 +1,8 @@ add_executable (task_destroy_cancel task_destroy_cancel.c) target_link_libraries(task_destroy_cancel simgrid) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.tesh - PARENT_SCOPE) -set(xml_files - ${xml_files} - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml - PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.c - PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.tesh PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.c PARENT_SCOPE) +set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml PARENT_SCOPE) + +ADD_TESH_FACTORIES(tesh-msg-task-destroy-cancel "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/task_destroy_cancel ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh) diff --git a/teshsuite/msg/trace/CMakeLists.txt b/teshsuite/msg/trace/CMakeLists.txt index f7c52b26ed..b9413eba73 100644 --- a/teshsuite/msg/trace/CMakeLists.txt +++ b/teshsuite/msg/trace/CMakeLists.txt @@ -1,10 +1,8 @@ add_executable (test_trace_integration test_trace_integration.c) target_link_libraries(test_trace_integration simgrid) -set(tesh_files - ${tesh_files} - ${CMAKE_CURRENT_SOURCE_DIR}/trace.tesh - PARENT_SCOPE) +set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/trace.tesh PARENT_SCOPE) +set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/test_trace_integration.c PARENT_SCOPE) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/test-hbp1.0-hbp1.0-hbp1.0.xml @@ -20,7 +18,5 @@ set(xml_files ${CMAKE_CURRENT_SOURCE_DIR}/test-hbp1-c1s1-c3s2.xml ${CMAKE_CURRENT_SOURCE_DIR}/test-hbp2.5-hbp1.5.xml PARENT_SCOPE) -set(teshsuite_src - ${teshsuite_src} - ${CMAKE_CURRENT_SOURCE_DIR}/test_trace_integration.c - PARENT_SCOPE) + +ADD_TESH_FACTORIES(tesh-msg-trace "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/trace --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace/trace.tesh) diff --git a/tools/cmake/Tests.cmake b/tools/cmake/Tests.cmake index b84d934cc5..0607a422c6 100644 --- a/tools/cmake/Tests.cmake +++ b/tools/cmake/Tests.cmake @@ -191,14 +191,6 @@ IF(NOT enable_memcheck) ## INTERFACES ## ### MSG ### # BEGIN TESH TESTS - ADD_TESH_FACTORIES(tesh-msg-host-on-off-processes "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off_processes --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/host_on_off_processes ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh) - ADD_TESH_FACTORIES(tesh-msg-pid "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/pid ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/pid/pid.tesh) - ADD_TESH_FACTORIES(tesh-msg-process "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/process ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process/process.tesh) - ADD_TESH_FACTORIES(tesh-msg-process-join "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/process_join ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/process_join/process_join.tesh) - ADD_TESH_FACTORIES(tesh-msg-storage-basic "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/storage ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/storage/storage_basic.tesh) - ADD_TESH_FACTORIES(tesh-msg-task-destroy-cancel "thread;ucontext;raw" --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel --cd ${CMAKE_BINARY_DIR}/teshsuite/msg/task_destroy_cancel ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh) - ADD_TESH_FACTORIES(tesh-msg-trace "thread;ucontext;raw" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/msg/trace --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace ${CMAKE_HOME_DIRECTORY}/teshsuite/msg/trace/trace.tesh) - ADD_TESH(msg-file --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/io.tesh) ADD_TESH(msg-storage --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/storage.tesh) ADD_TESH(msg-remote-io --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/ --setenv srcdir=${CMAKE_HOME_DIRECTORY}/ --cd ${CMAKE_HOME_DIRECTORY}/examples/ ${CMAKE_HOME_DIRECTORY}/examples/msg/io/remote.tesh)