Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a target to recompile all ns3 tests (and only them)
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 16 Apr 2023 09:03:31 +0000 (11:03 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 16 Apr 2023 09:03:31 +0000 (11:03 +0200)
CMakeLists.txt
examples/cpp/CMakeLists.txt
teshsuite/s4u/CMakeLists.txt

index 25f7ba2..4157980 100644 (file)
@@ -755,6 +755,8 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
 add_custom_target(tests    COMMENT "Recompiling the tests")
 add_custom_target(tests-mc COMMENT "Recompiling the MC tests and tools.")
 add_dependencies(tests tests-mc)
+add_custom_target(tests-ns3 COMMENT "Recompiling the ns3 tests and tools.")
+add_dependencies(tests tests-ns3)
 
 ### Build some Maintainer files
 include(${CMAKE_HOME_DIRECTORY}/tools/cmake/MaintainerMode.cmake)
index a43cfda..d7999d2 100644 (file)
@@ -125,6 +125,10 @@ if(SIMGRID_HAVE_NS3)
     set(tesh_files    ${tesh_files}   ${CMAKE_HOME_DIRECTORY}/examples/cpp/network-ns3/s4u-network-ns3-timed.tesh)
   endif()
 
+foreach (example network-ns3 network-ns3-wifi)
+  add_dependencies(tests-ns3 s4u-${example})
+endforeach()
+
 else()
   # Even if ns3 is not found, we need to override the teshfile name and make sure that everything gets included in the archive
   set(_network-ns3_teshfile         ${CMAKE_HOME_DIRECTORY}/examples/cpp/network-ns3/s4u-network-ns3-notime.tesh)
index 83969f8..56d9e61 100644 (file)
@@ -105,7 +105,7 @@ if(SIMGRID_HAVE_NS3)
     add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
     target_link_libraries(${x}  simgrid)
     set_target_properties(${x}  PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${x})
-    add_dependencies(tests ${x})
+    add_dependencies(tests-ns3 ${x})
     ADD_TESH(tesh-s4u-${x} --setenv srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x} --setenv platfdir=${CMAKE_HOME_DIRECTORY}/examples/platforms --cd ${CMAKE_BINARY_DIR}/teshsuite/s4u/${x} ${CMAKE_HOME_DIRECTORY}/teshsuite/s4u/${x}/${x}.tesh)
   endforeach()
 endif()