From 2484c1dd57b84bf1e1ff6c11294a258588c4d006 Mon Sep 17 00:00:00 2001 From: Matt Dawson Date: Fri, 12 Jan 2024 14:01:16 -0800 Subject: [PATCH 1/2] run example test in sub folders --- test/CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 01cfa50a..0bf1c5d3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,9 +34,17 @@ endif() ################################################################################ # Run examples as tests -add_test(NAME TUV_5_4 COMMAND tuv-x examples/tuv_5_4.json - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -add_test(NAME TS1_TSMLT COMMAND tuv-x examples/ts1_tsmlt.json - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +add_custom_target(make-tuv54-example-dir ALL COMMAND ${CMAKE_COMMAND} + -E make_directory ${CMAKE_BINARY_DIR}/example_tuv_5_4) +add_custom_target(link-tuv54-example-data ALL COMMAND ${CMAKE_COMMAND} + -E create_symlink ${CMAKE_BINARY_DIR}/data ${CMAKE_BINARY_DIR}/example_tuv_5_4/data) +add_test(NAME TUV_5_4 COMMAND tuv-x ../examples/tuv_5_4.json + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/example_tuv_5_4) +add_custom_target(make-ts1-tsmlt-example-dir ALL COMMAND ${CMAKE_COMMAND} + -E make_directory ${CMAKE_BINARY_DIR}/example_ts1_tsmlt) +add_custom_target(link-ts1-tsmlt-example-data ALL COMMAND ${CMAKE_COMMAND} + -E create_symlink ${CMAKE_BINARY_DIR}/data ${CMAKE_BINARY_DIR}/example_ts1_tsmlt/data) +add_test(NAME TS1_TSMLT COMMAND tuv-x ../examples/ts1_tsmlt.json + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/example_ts1_tsmlt) ################################################################################ From 4fc60676b5d95e6aaf110ed47e596e909c6c67a4 Mon Sep 17 00:00:00 2001 From: Matt Dawson Date: Fri, 12 Jan 2024 14:15:06 -0800 Subject: [PATCH 2/2] copy data into example test folders --- test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0bf1c5d3..71bd2fc7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -37,13 +37,13 @@ endif() add_custom_target(make-tuv54-example-dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/example_tuv_5_4) add_custom_target(link-tuv54-example-data ALL COMMAND ${CMAKE_COMMAND} - -E create_symlink ${CMAKE_BINARY_DIR}/data ${CMAKE_BINARY_DIR}/example_tuv_5_4/data) + -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../data ${CMAKE_BINARY_DIR}/example_tuv_5_4/data) add_test(NAME TUV_5_4 COMMAND tuv-x ../examples/tuv_5_4.json WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/example_tuv_5_4) add_custom_target(make-ts1-tsmlt-example-dir ALL COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/example_ts1_tsmlt) add_custom_target(link-ts1-tsmlt-example-data ALL COMMAND ${CMAKE_COMMAND} - -E create_symlink ${CMAKE_BINARY_DIR}/data ${CMAKE_BINARY_DIR}/example_ts1_tsmlt/data) + -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/../data ${CMAKE_BINARY_DIR}/example_ts1_tsmlt/data) add_test(NAME TS1_TSMLT COMMAND tuv-x ../examples/ts1_tsmlt.json WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/example_ts1_tsmlt)