summaryrefslogtreecommitdiffstats
path: root/hl/fortran
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-07-24 16:08:47 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-07-24 16:08:47 (GMT)
commit34adba4a0c131afe49a75e8e7d92f1e986c1b540 (patch)
tree8e196a9fab1502a45d0d05a190fb1f90ec94dbed /hl/fortran
parentab0b1a00aff3bee4a3cf0d31614368935c435b6f (diff)
downloadhdf5-34adba4a0c131afe49a75e8e7d92f1e986c1b540.zip
hdf5-34adba4a0c131afe49a75e8e7d92f1e986c1b540.tar.gz
hdf5-34adba4a0c131afe49a75e8e7d92f1e986c1b540.tar.bz2
HDFFV-10845, 10529 and CMake changes from develop
Diffstat (limited to 'hl/fortran')
-rw-r--r--hl/fortran/examples/CMakeTests.cmake13
-rw-r--r--hl/fortran/src/CMakeLists.txt4
-rw-r--r--hl/fortran/test/CMakeTests.cmake24
3 files changed, 24 insertions, 17 deletions
diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake
index 91cb56b..b8f40d0 100644
--- a/hl/fortran/examples/CMakeTests.cmake
+++ b/hl/fortran/examples/CMakeTests.cmake
@@ -21,16 +21,17 @@ 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)
- add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND $<TARGET_FILE:hl_f90_ex_${example}>)
+ add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_f90_ex_${example}>)
else ()
add_test (NAME HL_FORTRAN_f90_ex_${example} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_ex_${example}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -41,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/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index b63b5c6..e532fff 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -105,7 +105,7 @@ set (HDF5_HL_F90_F_BASE_SOURCES
if (NOT ONLY_SHARED_LIBS)
add_custom_command (
OUTPUT ${HDF5_HL_F90_BINARY_DIR}/static/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/static/H5TBff_gen.F90
- COMMAND $<TARGET_FILE:H5HL_buildiface>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/static
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 files"
@@ -122,7 +122,7 @@ endif ()
if (BUILD_SHARED_LIBS)
add_custom_command (
OUTPUT ${HDF5_HL_F90_BINARY_DIR}/shared/H5LTff_gen.F90 ${HDF5_HL_F90_BINARY_DIR}/shared/H5TBff_gen.F90
- COMMAND $<TARGET_FILE:H5HL_buildiface>
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:H5HL_buildiface>
WORKING_DIRECTORY ${HDF5_HL_F90_BINARY_DIR}/shared
DEPENDS ${HDF5_HL_F90_F_BASE_SOURCES}
COMMENT "Generating the H5LTff_gen.F90, H5TBff_gen.F90 shared files"
diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake
index 2137d1a..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,11 +28,20 @@ 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 $<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"
@@ -43,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 ()