diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-07-23 21:24:56 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-07-23 21:24:56 (GMT) |
commit | 6a932198aa9c3da1d23fe4c4bdee05891bc2e38b (patch) | |
tree | 029e075420a7c148366ba038a5f76662c0cb63b4 /hl/test | |
parent | d3fdcd8a680ad0f8b21304b35e8564b774a88ef0 (diff) | |
download | hdf5-6a932198aa9c3da1d23fe4c4bdee05891bc2e38b.zip hdf5-6a932198aa9c3da1d23fe4c4bdee05891bc2e38b.tar.gz hdf5-6a932198aa9c3da1d23fe4c4bdee05891bc2e38b.tar.bz2 |
HDFFV-10529 Update CMake tests to use test fixtures
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/CMakeTests.cmake | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index be90206..716a3d7 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -43,6 +43,44 @@ foreach (h5_file ${HL_REFERENCE_TEST_FILES}) endforeach () add_custom_target(hl_test_files ALL COMMENT "Copying files needed by hl_test tests" DEPENDS ${hl_test_files_list}) +# Remove any output file left over from previous test run +set (test_hl_CLEANFILES + combine_tables1.h5 + combine_tables2.h5 + file_img1.h5 + file_img2.h5 + test_append.h5 + h5do_compat.h5 + test_detach.h5 + test_ds1.h5 + test_ds2.h5 + test_ds3.h5 + test_ds4.h5 + test_ds5.h5 + test_ds6.h5 + test_ds7.h5 + test_ds8.h5 + test_ds9.h5 + test_ds10.h5 + test_image1.h5 + test_image2.h5 + test_image3.h5 + test_lite1.h5 + test_lite2.h5 + test_lite3.h5 + test_lite4.h5 + test_packet_compress.h5 + test_packet_table.h5 + test_packet_table_vlen.h5 + testfl_packet_table_vlen.h5 + test_table.h5 +) +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) + # -------------------------------------------------------------------- # Macro used to add a unit test # -------------------------------------------------------------------- @@ -62,54 +100,13 @@ macro (HL_ADD_TEST hl_name) -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - if (last_test) - set_tests_properties (HL_${hl_name} PROPERTIES DEPENDS ${last_test} + set_tests_properties (HL_${hl_name} PROPERTIES + FIXTURES_REQUIRED clear_test_hl ENVIRONMENT "srcdir=${HDF5_HL_TEST_BINARY_DIR}" WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} - ) - endif () + ) endmacro () -# Remove any output file left over from previous test run -add_test ( - NAME HL_test-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - combine_tables1.h5 - combine_tables2.h5 - file_img1.h5 - file_img2.h5 - test_append.h5 - h5do_compat.h5 - test_detach.h5 - test_ds1.h5 - test_ds2.h5 - test_ds3.h5 - test_ds4.h5 - test_ds5.h5 - test_ds6.h5 - test_ds7.h5 - test_ds8.h5 - test_ds9.h5 - test_ds10.h5 - test_image1.h5 - test_image2.h5 - test_image3.h5 - test_lite1.h5 - test_lite2.h5 - test_lite3.h5 - test_lite4.h5 - test_packet_compress.h5 - test_packet_table.h5 - test_packet_table_vlen.h5 - testfl_packet_table_vlen.h5 - test_table.h5 -) -if (last_test) - set_tests_properties (HL_test-clear-objects PROPERTIES DEPENDS ${last_test}) -endif () -set (last_test "HL_test-clear-objects") - HL_add_test (test_lite ) HL_add_test (test_image) HL_add_test (test_file_image) |