Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not build the examples by default, only when running 'make tests'
[simgrid.git] / teshsuite / simdag / CMakeLists.txt
1 foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test
2           comm-mxn-all2all comm-mxn-independent comm-mxn-scatter comm-p2p-latency-1
3           comm-p2p-latency-2 comm-p2p-latency-3 comm-p2p-latency-bound comp-only-par comp-only-seq incomplete)
4   add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.c)
5   target_link_libraries(${x}  simgrid)
6   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
7   add_dependencies(tests ${x})
8
9   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
10   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
11 endforeach()
12
13 foreach(x evaluate-parse-time evaluate-get-route-time)
14   add_executable       (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
15   target_link_libraries(${x} simgrid)
16   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
17   add_dependencies(tests ${x})
18
19   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.c)
20 endforeach()
21
22 foreach(x flatifier is-router)
23   add_executable       (${x} EXCLUDE_FROM_ALL ${x}/${x}.cpp)
24   target_link_libraries(${x}  simgrid)
25   set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
26   set_property(TARGET ${x} APPEND PROPERTY INCLUDE_DIRECTORIES "${INTERNAL_INCLUDES}")
27   add_dependencies(tests ${x})
28
29   set(tesh_files    ${tesh_files}    ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.tesh)
30   set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/${x}/${x}.cpp)
31 endforeach()
32
33 set(teshsuite_src ${teshsuite_src}  PARENT_SCOPE)
34 set(tesh_files    ${tesh_files}     ${CMAKE_CURRENT_SOURCE_DIR}/flatifier/bogus_two_hosts_asymetric.tesh
35                                     ${CMAKE_CURRENT_SOURCE_DIR}/flatifier/bogus_missing_gateway.tesh
36                                     ${CMAKE_CURRENT_SOURCE_DIR}/flatifier/bogus_disk_attachment.tesh
37                                     ${CMAKE_CURRENT_SOURCE_DIR}/basic-parsing-test/basic-parsing-test-sym-full.tesh
38                                     ${CMAKE_CURRENT_SOURCE_DIR}/basic-parsing-test/basic-parsing-test-bypass.tesh
39                                     PARENT_SCOPE)
40 set(xml_files     ${xml_files}      ${CMAKE_CURRENT_SOURCE_DIR}/platforms/four_hosts_floyd.xml
41                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_hosts_multi_hop.xml
42                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/host_attributes.xml
43                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/link_attributes.xml
44                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/one_cluster_multicore.xml
45                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/one_cluster_splitduplex.xml
46                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/one_cluster_router_id.xml
47                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/one_cluster.xml
48                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_4p_1switch.xml
49                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/properties.xml
50                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/test_of_is_router.xml
51                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/three_hosts_non_symmetric_route.xml
52                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_clusters_one_name.xml
53                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_clusters_router_id.xml
54                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_clusters.xml
55                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/bogus_missing_src_gateway.xml
56                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/bogus_missing_dst_gateway.xml
57                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/bogus_two_hosts_asymetric.xml
58                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_hosts_one_link_splitduplex.xml
59                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/two_hosts_one_link.xml
60                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/Dijkstra.xml
61                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1bb.xml
62                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1fl.xml
63                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1sl.xml
64                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1sl_hetero.xml
65                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/platform_2p_1switch.xml
66                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/bogus_disk_attachment.xml        PARENT_SCOPE)
67 set(txt_files     ${txt_files}      ${CMAKE_CURRENT_SOURCE_DIR}/platforms/carol.fail
68                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/bob.trace
69                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/erin.avail
70                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.bw
71                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.fail
72                                     ${CMAKE_CURRENT_SOURCE_DIR}/platforms/link.lat                         PARENT_SCOPE)
73
74 foreach(x availability basic0 basic1 basic3 basic4 basic5 basic6 basic-link-test basic-parsing-test
75           comm-mxn-all2all comm-mxn-independent comm-mxn-scatter comm-p2p-latency-1 flatifier is-router
76           comm-p2p-latency-2 comm-p2p-latency-3 comm-p2p-latency-bound comp-only-par comp-only-seq incomplete)
77   ADD_TESH(tesh-simdag-${x} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/${x} ${x}.tesh)
78 endforeach()
79
80 # test for code coverage
81 ADD_TEST(test-help            ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test --help)
82 ADD_TEST(test-help-models     ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test --help-models)
83 ADD_TEST(test-tracing-help    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test --help-tracing)
84
85 ADD_TESH(tesh-simdag-parser-bypass   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic-parsing-test --setenv srcdir=${CMAKE_HOME_DIRECTORY} basic-parsing-test-bypass.tesh)
86 ADD_TESH(tesh-simdag-parser-sym-full --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/basic-parsing-test basic-parsing-test-sym-full.tesh)
87
88 ADD_TEST(tesh-simdag-full-links01    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters.xml FULL_LINK)
89 ADD_TEST(tesh-simdag-full-links02    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/platforms/two_clusters_one_name.xml FULL_LINK)
90 ADD_TEST(tesh-simdag-one-link-g5k    ${CMAKE_BINARY_DIR}/teshsuite/simdag/basic-parsing-test/basic-parsing-test ${CMAKE_HOME_DIRECTORY}/examples/platforms/g5k.xml ONE_LINK)
91
92 if(enable_debug AND NOT enable_memcheck)
93   # these tests need assertions. Exclude them from memcheck, as they normally die, leaving lots of unfree'd objects
94   ADD_TESH(tesh-parser-bogus-symmetric         --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/flatifier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier/bogus_two_hosts_asymetric.tesh)
95   ADD_TESH(tesh-parser-bogus-missing-gw        --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/flatifier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier/bogus_missing_gateway.tesh)
96   ADD_TESH(tesh-parser-bogus-disk-attachment   --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simdag/flatifier --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier ${CMAKE_HOME_DIRECTORY}/teshsuite/simdag/flatifier/bogus_disk_attachment.tesh)
97
98    #These tests fail on Windows as the signal returned is not the same as Unix would send.
99   if(WIN32)
100     set_property(TEST tesh-parser-bogus-symmetric PROPERTY WILL_FAIL TRUE)
101     set_property(TEST tesh-parser-bogus-missing-gw PROPERTY WILL_FAIL TRUE)
102     set_property(TEST tesh-parser-bogus-disk-attachment PROPERTY WILL_FAIL TRUE)
103   endif()
104 endif()