summaryrefslogtreecommitdiffstats
path: root/hl/fortran/test/CMakeTests.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-07-27 17:50:58 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-07-27 17:50:58 (GMT)
commit3333acc05a6b3be7ed93c1291b7d4c69ed262f72 (patch)
tree7e618cad0faa94057b00a9a6d5b54d2d8e0dfe25 /hl/fortran/test/CMakeTests.cmake
parent3a6b7da5f338388d83036ec7f9c3d64c01ff8ed1 (diff)
downloadhdf5-3333acc05a6b3be7ed93c1291b7d4c69ed262f72.zip
hdf5-3333acc05a6b3be7ed93c1291b7d4c69ed262f72.tar.gz
hdf5-3333acc05a6b3be7ed93c1291b7d4c69ed262f72.tar.bz2
Merge of HDFFV-10845, 10529 from develop
Diffstat (limited to 'hl/fortran/test/CMakeTests.cmake')
-rw-r--r--hl/fortran/test/CMakeTests.cmake78
1 files changed, 25 insertions, 53 deletions
diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake
index 2b66556..0760b92 100644
--- a/hl/fortran/test/CMakeTests.cmake
+++ b/hl/fortran/test/CMakeTests.cmake
@@ -16,11 +16,32 @@
##############################################################################
##############################################################################
+set (test_hl_fortran_CLEANFILES
+ 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
+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 $<TARGET_FILE:hl_f90_${file}>)
+ add_test (NAME HL_FORTRAN_f90_${file} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_f90_${file}>)
else ()
add_test (NAME HL_FORTRAN_f90_${file} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_${file}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -31,59 +52,10 @@ 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)
- if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND $<TARGET_FILE:hl_f90_${file}-shared>)
- else ()
- add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_${file}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=hl_f90_${file}-shared.txt"
- #-D "TEST_REFERENCE=hl_f90_${file}-shared.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (HL_FORTRAN_f90_${file}-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects)
- endif ()
-endmacro ()
-
-# Remove any output file left over from previous test run
-add_test (
- NAME HL_FORTRAN_test-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- dsetf1.h5
- dsetf2.h5
- dsetf3.h5
- dsetf4.h5
- dsetf5.h5
- f1img.h5
- f1tab.h5
- tstds.h5
-)
-
-if (BUILD_SHARED_LIBS AND NOT SKIP_HDF5_FORTRAN_SHARED)
- add_test (
- NAME HL_FORTRAN_test-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- dsetf1.h5
- dsetf2.h5
- dsetf3.h5
- dsetf4.h5
- dsetf5.h5
- f1img.h5
- f1tab.h5
- tstds.h5
+ set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES
+ FIXTURES_REQUIRED clear_HL_FORTRAN_test
)
- set_tests_properties (HL_FORTRAN_test-shared-clear-objects
- PROPERTIES DEPENDS "HL_FORTRAN_f90_tsttable;HL_FORTRAN_f90_tstimage;HL_FORTRAN_f90_tstlite;HL_FORTRAN_f90_tstds"
- )
-endif ()
+endmacro ()
foreach (h5_test ${H5_TESTS})
ADD_H5_FORTRAN_TEST(${h5_test})