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 /tools/test/h5ls | |
parent | 7127d8912c8fa601d59b4e8ce522eaf149c02344 (diff) | |
download | hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.zip hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.tar.gz hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.tar.bz2 |
Develop cmake clean (#1971)
Diffstat (limited to 'tools/test/h5ls')
-rw-r--r-- | tools/test/h5ls/CMakeTests.cmake | 75 |
1 files changed, 73 insertions, 2 deletions
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index cd2f764..0c493dd 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -135,10 +135,21 @@ ############################################################################## macro (ADD_H5_TEST resultfile resultcode) + add_test ( + NAME H5LS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) - set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (H5LS-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -157,9 +168,32 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5LS-${resultfile} PROPERTIES + DEPENDS "H5LS-${resultfile}-clear-objects" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clean-objects PROPERTIES + DEPENDS "H5LS-${resultfile}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endmacro () macro (ADD_H5_ERR_TEST resultfile resultcode) + add_test ( + NAME H5LS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) @@ -182,12 +216,35 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5LS-${resultfile} PROPERTIES + DEPENDS "H5LS-${resultfile}-clear-objects" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clean-objects PROPERTIES + DEPENDS "H5LS-${resultfile}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5LS_UD-${testname} + NAME H5LS_UD-${testname}-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_UD-${testname}-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS_UD-${testname}-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" @@ -201,6 +258,20 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5LS_UD-${testname}-${resultfile} PROPERTIES + DEPENDS "H5LS_UD-${testname}-${resultfile}-clear-objects" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS_UD-${testname}-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_UD-${testname}-${resultfile}-clean-objects PROPERTIES + DEPENDS "H5LS_UD-${testname}-${resultfile}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endif () endmacro () |