diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-08-07 04:59:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-07 04:59:31 (GMT) |
commit | 956282fa6f5f5b7df92be6f14c12681f7ecabbc9 (patch) | |
tree | 262418febb0a037f752e577ab632accd358edd93 /hl | |
parent | 7127d8912c8fa601d59b4e8ce522eaf149c02344 (diff) | |
download | hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.zip hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.tar.gz hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.tar.bz2 |
Develop cmake clean (#1971)
Diffstat (limited to 'hl')
-rw-r--r-- | hl/c++/examples/CMakeTests.cmake | 19 | ||||
-rw-r--r-- | hl/c++/test/CMakeTests.cmake | 20 | ||||
-rw-r--r-- | hl/examples/CMakeTests.cmake | 56 | ||||
-rw-r--r-- | hl/fortran/examples/CMakeTests.cmake | 23 | ||||
-rw-r--r-- | hl/fortran/test/CMakeTests.cmake | 33 | ||||
-rw-r--r-- | hl/test/CMakeTests.cmake | 13 | ||||
-rw-r--r-- | hl/tools/gif2h5/CMakeTests.cmake | 18 | ||||
-rw-r--r-- | hl/tools/h5watch/CMakeTests.cmake | 19 |
8 files changed, 145 insertions, 56 deletions
diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index 82b32cf..f72b2a0 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -16,12 +16,16 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run +set (HL_CPP_EX_PT_CLEANFILES + PTcppexampleFL.h5 +) add_test ( NAME HL_CPP_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - PTcppexampleFL.h5 - ptExampleFL.txt + -E remove ${HL_CPP_EX_PT_CLEANFILES} +) +set_tests_properties (HL_CPP_ex_ptExampleFL-clear-objects PROPERTIES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -40,3 +44,12 @@ else () ) endif () set_tests_properties (HL_CPP_ex_ptExampleFL PROPERTIES DEPENDS HL_CPP_ex_ptExampleFL-clear-objects) +add_test ( + NAME HL_CPP_ex_ptExampleFL-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_CPP_EX_PT_CLEANFILES} +) +set_tests_properties (HL_CPP_ex_ptExampleFL-clean-objects PROPERTIES + DEPENDS HL_CPP_ex_ptExampleFL + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index 28ee5df..fa2a3f2 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -15,12 +15,19 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - +# Remove any output file left over from previous test run +set (HL_CPP_PT_CLEANFILES + packettest.h5 +) add_test ( NAME HL_CPP_ptableTest-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${example}.txt + -E remove ${HL_CPP_PT_CLEANFILES} ) +set_tests_properties (HL_CPP_ptableTest-clear-objects PROPERTIES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) + if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_CPP_ptableTest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_ptableTest>) else () @@ -37,3 +44,12 @@ else () ) endif () set_tests_properties (HL_CPP_ptableTest PROPERTIES DEPENDS HL_CPP_ptableTest-clear-objects) +add_test ( + NAME HL_CPP_ptableTest-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_CPP_PT_CLEANFILES} +) +set_tests_properties (HL_CPP_ptableTest-clean-objects PROPERTIES + DEPENDS HL_CPP_ptableTest + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index b997096..1fdbc14 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -27,31 +27,45 @@ endforeach () add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list}) # Remove any output file left over from previous test run +set (HL_EX_CLEANFILES + ex_lite1.h5 + ex_lite2.h5 + ex_lite3.h5 + packet_table_FLexample.h5 + ex_image1.h5 + ex_image2.h5 + ex_table_01.h5 + ex_table_02.h5 + ex_table_03.h5 + ex_table_04.h5 + ex_table_05.h5 + ex_table_06.h5 + ex_table_07.h5 + ex_table_08.h5 + ex_table_09.h5 + ex_table_10.h5 + ex_table_11.h5 + ex_table_12.h5 + ex_ds1.h5 +) add_test ( NAME HL_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - ex_lite1.h5 - ex_lite2.h5 - ex_lite3.h5 - packet_table_FLexample.h5 - ex_image1.h5 - ex_image2.h5 - ex_table_01.h5 - ex_table_02.h5 - ex_table_03.h5 - ex_table_04.h5 - ex_table_05.h5 - ex_table_06.h5 - ex_table_07.h5 - ex_table_08.h5 - ex_table_09.h5 - ex_table_10.h5 - ex_table_11.h5 - ex_table_12.h5 - ex_ds1.h5 + -E remove ${HL_EX_CLEANFILES} +) +set_tests_properties (HL_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_HL_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME HL_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_EX_CLEANFILES} +) +set_tests_properties (HL_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_HL_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (HL_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_ex) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 2e73ad9..b51e657 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -17,14 +17,28 @@ ############################################################################## # Remove any output file left over from previous test run +set (HL_FORTRAN_F90_EX_CLEANFILES + ex_ds1.h5 + exlite.h5 +) add_test ( NAME HL_FORTRAN_f90_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - ex_ds1.h5 - exlite.h5 + -E remove ${HL_FORTRAN_F90_EX_CLEANFILES} +) +set_tests_properties (HL_FORTRAN_f90_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_HL_FORTRAN_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME HL_FORTRAN_f90_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_FORTRAN_F90_EX_CLEANFILES} +) +set_tests_properties (HL_FORTRAN_f90_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_HL_FORTRAN_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (HL_FORTRAN_f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_f90_ex) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -44,5 +58,6 @@ foreach (example ${examples}) endif () set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_HL_FORTRAN_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) endforeach () diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index bceb6ee..c33fb5f 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -17,15 +17,15 @@ ############################################################################## set (test_hl_fortran_CLEANFILES - dsetf1.h5 - dsetf2.h5 - dsetf3.h5 - dsetf4.h5 - dsetf5.h5 - f1img.h5 - f1tab.h5 - f2tab.h5 - tstds.h5 + dsetf1.h5 + dsetf2.h5 + dsetf3.h5 + dsetf4.h5 + dsetf5.h5 + f1img.h5 + f1tab.h5 + f2tab.h5 + tstds.h5 ) # Remove any output file left over from previous test run @@ -34,7 +34,19 @@ add_test ( COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_fortran_CLEANFILES} ) -set_tests_properties (HL_FORTRAN_test-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_test) +set_tests_properties (HL_FORTRAN_test-clear-objects PROPERTIES + FIXTURES_SETUP clear_HL_FORTRAN_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME HL_FORTRAN_test-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${test_hl_fortran_CLEANFILES} +) +set_tests_properties (HL_FORTRAN_test-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_HL_FORTRAN_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) macro (ADD_H5_FORTRAN_TEST file) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -54,6 +66,7 @@ macro (ADD_H5_FORTRAN_TEST file) endif () set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES FIXTURES_REQUIRED clear_HL_FORTRAN_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) endmacro () diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index e532253..9cbc30b 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -81,7 +81,18 @@ add_test ( NAME HL_test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_CLEANFILES} ) -set_tests_properties (HL_test-clear-objects PROPERTIES FIXTURES_SETUP clear_test_hl) +set_tests_properties (HL_test-clear-objects PROPERTIES + FIXTURES_SETUP clear_test_hl + WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} +) +add_test ( + NAME HL_test-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_CLEANFILES} +) +set_tests_properties (HL_test-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_test_hl + WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} +) # -------------------------------------------------------------------- # Macro used to add a unit test diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake index 36ea5f9..b2a8e27 100644 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ b/hl/tools/gif2h5/CMakeTests.cmake @@ -28,16 +28,24 @@ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/ex_image2.h5" "$ add_custom_target(gif2h5_files ALL COMMENT "Copying files needed by gif2h5 tests" DEPENDS ${gif2h5_files_list}) # Remove any output file left over from previous test run +set (HL_TOOLS_CLEANFILES + image1.gif + image1.h5 + image.gif + image24.gif +) add_test ( NAME HL_TOOLS-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - image1.gif - image1.h5 - image.gif - image24.gif + -E remove ${HL_TOOLS_CLEANFILES} ) set_tests_properties (HL_TOOLS-clear-objects PROPERTIES FIXTURES_SETUP clear_tools_hl) +add_test ( + NAME HL_TOOLS-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_TOOLS_CLEANFILES} +) +set_tests_properties (HL_TOOLS-clean-objects PROPERTIES FIXTURES_CLEANUP clear_tools_hl) add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_file_ext}> testfiles/image1.gif image1.h5) set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index b2f689b..84d491a 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -86,7 +86,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes DEPENDS ${last_test} FIXTURES_REQUIRED gen_test_watch ) - set (last_test "H5WATCH_ARGS-h5watch-${resultfile}") + set (last_test "H5WATCH_ARGS-h5watch-${resultfile}s") endif () endmacro () @@ -116,12 +116,6 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes macro (ADD_H5_WATCH resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5WATCH-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.h5 - ) - set_tests_properties (H5WATCH-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - add_test ( NAME H5WATCH-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" @@ -134,7 +128,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5WATCH-${resultfile} PROPERTIES - DEPENDS H5WATCH-${resultfile}-clear-objects + DEPENDS ${last_test} FIXTURES_REQUIRED gen_test_watch ) set (last_test "H5WATCH-${resultfile}") @@ -164,7 +158,12 @@ set_tests_properties (H5WATCH-clearall-objects PROPERTIES FIXTURES_REQUIRED swmr if (last_test) set_tests_properties (H5WATCH-clearall-objects PROPERTIES DEPENDS ${last_test}) endif () -set (last_test "H5WATCH-clearall-objects") +set (last_test "H5WATCH-cleanall-objects") +add_test ( + NAME H5WATCH-cleanall-objects + COMMAND ${CMAKE_COMMAND} -E remove WATCH.h5 +) +set_tests_properties (H5WATCH-cleanall-objects PROPERTIES FIXTURES_CLEANUP swmr_vfd_check_compat) ################################################################################################# # # @@ -189,7 +188,7 @@ set (last_test "H5WATCH-clearall-objects") add_test (NAME H5WATCH-h5watchgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5watchgentest>) set_tests_properties (H5WATCH-h5watchgentest PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS "H5WATCH-clearall-objects" + DEPENDS H5WATCH-clearall-objects ) set_tests_properties (H5WATCH-h5watchgentest PROPERTIES FIXTURES_SETUP gen_test_watch) set_tests_properties (H5WATCH-h5watchgentest PROPERTIES FIXTURES_REQUIRED swmr_vfd_check_compat) |