diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2023-03-23 00:37:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 00:37:04 (GMT) |
commit | 7b4387df4322c3a953f5747c3ffbf907875ca815 (patch) | |
tree | a2f3147456059ebb06b3fbe9675c5fc83b87863a /c++ | |
parent | 98728706dd800e365cee6f601873b515e5f8822c (diff) | |
download | hdf5-7b4387df4322c3a953f5747c3ffbf907875ca815.zip hdf5-7b4387df4322c3a953f5747c3ffbf907875ca815.tar.gz hdf5-7b4387df4322c3a953f5747c3ffbf907875ca815.tar.bz2 |
Merge CMake cleanup process from develop (#2622)
* Merge CMake cleanup process from develop
* Update test script files
Diffstat (limited to 'c++')
-rw-r--r-- | c++/examples/CMakeTests.cmake | 58 | ||||
-rw-r--r-- | c++/test/CMakeTests.cmake | 18 | ||||
-rw-r--r-- | c++/test/CMakeVFDTests.cmake | 13 |
3 files changed, 46 insertions, 43 deletions
diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index 5145254..f710204 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -16,17 +16,31 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run +set (CPP_EX_CLEANFILES + Group.h5 + SDS.h5 + SDScompound.h5 + SDSextendible.h5 + Select.h5 +) add_test ( NAME CPP_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - Group.h5 - SDS.h5 - SDScompound.h5 - SDSextendible.h5 - Select.h5 + -E remove ${CPP_EX_CLEANFILES} +) +set_tests_properties (CPP_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_cppex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME CPP_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${CPP_EX_CLEANFILES} +) +set_tests_properties (CPP_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_cppex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (CPP_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_cppex) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -53,18 +67,32 @@ endforeach () #the following dependencies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) # SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) +set (CPP_EX_TUTR_CLEANFILES + h5tutr_cmprss.h5 + h5tutr_dset.h5 + h5tutr_extend.h5 + h5tutr_group.h5 + h5tutr_groups.h5 + h5tutr_subset.h5 +) add_test ( NAME CPP_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - h5tutr_cmprss.h5 - h5tutr_dset.h5 - h5tutr_extend.h5 - h5tutr_group.h5 - h5tutr_groups.h5 - h5tutr_subset.h5 + -E remove ${CPP_EX_TUTR_CLEANFILES} +) +set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES + FIXTURES_SETUP clear_cppex_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME CPP_ex_tutr-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${CPP_EX_TUTR_CLEANFILES} +) +set_tests_properties (CPP_ex_tutr-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_cppex_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES FIXTURES_SETUP clear_cppex_tutr) foreach (example ${tutr_examples}) if (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index e34f629..fc94a68 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -17,20 +17,6 @@ add_custom_target(cpp_testhdf5_files ALL COMMENT "Copying files needed by cpp_te ### T E S T I N G ### ############################################################################## ############################################################################## -# Remove any output file left over from previous test run -add_test ( - NAME CPP_testhdf5-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tattr_basic.h5 - tattr_compound.h5 - tattr_dtype.h5 - tattr_multi.h5 - tattr_scalar.h5 - tfattrs.h5 - titerate.h5 -) - if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME CPP_testhdf5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cpp_testhdf5>) else () @@ -46,7 +32,9 @@ else () -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () -set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) +set_tests_properties (CPP_testhdf5 PROPERTIES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) ############################################################################## ############################################################################## diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake index 3d6ab74..5405df3 100644 --- a/c++/test/CMakeVFDTests.cmake +++ b/c++/test/CMakeVFDTests.cmake @@ -25,18 +25,6 @@ H5_CREATE_VFD_DIR() macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - tattr_basic.h5 - tattr_compound.h5 - tattr_dtype.h5 - tattr_multi.h5 - tattr_scalar.h5 - tfattrs.h5 - titerate.h5 - WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} - ) - add_test ( NAME CPP_VFD-${vfdname}-cpp_testhdf5 COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" @@ -48,7 +36,6 @@ macro (ADD_VFD_TEST vfdname resultcode) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) endif () endmacro () |