summaryrefslogtreecommitdiffstats
path: root/hl/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-07-23 21:24:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-07-23 21:24:56 (GMT)
commit6a932198aa9c3da1d23fe4c4bdee05891bc2e38b (patch)
tree029e075420a7c148366ba038a5f76662c0cb63b4 /hl/fortran
parentd3fdcd8a680ad0f8b21304b35e8564b774a88ef0 (diff)
downloadhdf5-6a932198aa9c3da1d23fe4c4bdee05891bc2e38b.zip
hdf5-6a932198aa9c3da1d23fe4c4bdee05891bc2e38b.tar.gz
hdf5-6a932198aa9c3da1d23fe4c4bdee05891bc2e38b.tar.bz2
HDFFV-10529 Update CMake tests to use test fixtures
Diffstat (limited to 'hl/fortran')
-rw-r--r--hl/fortran/examples/CMakeTests.cmake10
-rw-r--r--hl/fortran/test/CMakeTests.cmake21
2 files changed, 18 insertions, 13 deletions
diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake
index d3a9d0c..b8f40d0 100644
--- a/hl/fortran/examples/CMakeTests.cmake
+++ b/hl/fortran/examples/CMakeTests.cmake
@@ -21,10 +21,10 @@ add_test (
NAME HL_FORTRAN_f90_ex-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove
- ex_ds1.h5
- exlite.h5
+ ex_ds1.h5
+ exlite.h5
)
-
+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)
@@ -42,5 +42,7 @@ foreach (example ${examples})
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES DEPENDS HL_FORTRAN_f90_ex-clear-objects)
+ set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES
+ FIXTURES_REQUIRED clear_HL_FORTRAN_f90_ex
+ )
endforeach ()
diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake
index 0b81573..0760b92 100644
--- a/hl/fortran/test/CMakeTests.cmake
+++ b/hl/fortran/test/CMakeTests.cmake
@@ -16,7 +16,7 @@
##############################################################################
##############################################################################
-set (test_CLEANFILES
+set (test_hl_fortran_CLEANFILES
dsetf1.h5
dsetf2.h5
dsetf3.h5
@@ -28,6 +28,14 @@ set (test_CLEANFILES
tstds.h5
)
+# Remove any output file left over from previous test run
+add_test (
+ NAME HL_FORTRAN_test-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${test_hl_fortran_CLEANFILES}
+)
+set_tests_properties (HL_FORTRAN_test-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_test)
+
macro (ADD_H5_FORTRAN_TEST file)
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME HL_FORTRAN_f90_${file} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_f90_${file}>)
@@ -44,16 +52,11 @@ macro (ADD_H5_FORTRAN_TEST file)
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects)
+ set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES
+ FIXTURES_REQUIRED clear_HL_FORTRAN_test
+ )
endmacro ()
-# Remove any output file left over from previous test run
-add_test (
- NAME HL_FORTRAN_test-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove ${test_CLEANFILES}
-)
-
foreach (h5_test ${H5_TESTS})
ADD_H5_FORTRAN_TEST(${h5_test})
endforeach ()