summaryrefslogtreecommitdiffstats
path: root/tools/test/h5dump/CMakeTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5dump/CMakeTests.cmake')
-rw-r--r--tools/test/h5dump/CMakeTests.cmake103
1 files changed, 58 insertions, 45 deletions
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 070e98e..7a3fdd6 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -362,12 +362,7 @@
endforeach ()
foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES})
- if (WIN32)
- file (READ ${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file} TEST_STREAM)
- file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}")
- else ()
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files")
- endif ()
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files")
endforeach ()
foreach (tst_other_file ${HDF5_REFERENCE_FILES})
@@ -388,9 +383,10 @@
# --------------------------------------------------------------------
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files")
- if (WIN32)
- file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
- file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF)
+ #file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
+ #file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
else ()
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files")
endif ()
@@ -411,7 +407,7 @@
macro (ADD_HELP_TEST testname resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (last_test)
set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
@@ -432,6 +428,7 @@
add_test (
NAME H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -461,7 +458,7 @@
macro (ADD_H5_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -482,6 +479,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -497,7 +495,7 @@
macro (ADD_H5_TEST_N resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
+ add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -518,6 +516,7 @@
add_test (
NAME H5DUMP-N-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -533,7 +532,7 @@
macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -554,6 +553,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -563,20 +563,22 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
- add_test (
- NAME H5DUMP-${resultfile}-output-cmp
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${resultfile}.txt ${resultfile}.exp
- )
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp
+ )
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ endif ()
endif ()
endmacro ()
macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
@@ -598,6 +600,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -607,20 +610,22 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
- add_test (
- NAME H5DUMP-${resultfile}-output-cmp
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${resultfile}.txt ${resultfile}.exp
- )
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
- add_test (
- NAME H5DUMP-${resultfile}-output-cmp-ddl
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${ddlfile}.txt ${ddlfile}.exp
- )
- set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp)
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp
+ )
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp-ddl
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files --ignore-eol ${ddlfile}.txt ${ddlfile}.exp
+ )
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp)
+ endif ()
endif ()
endmacro ()
@@ -634,17 +639,19 @@
set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-output-${resultfile}
- COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}
)
set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects)
- add_test (
- NAME H5DUMP-output-cmp-${resultfile}
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${resultfile}.txt ${resultfile}.exp
- )
- set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile})
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-output-cmp-${resultfile}
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp
+ )
+ set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile})
+ endif ()
endif ()
endmacro ()
@@ -662,6 +669,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -689,6 +697,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -715,6 +724,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -742,6 +752,7 @@
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -772,6 +783,7 @@
add_test (
NAME H5DUMP-IMPORT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
@@ -781,10 +793,10 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects")
- add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
+ add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile})
- add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer)
+ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer)
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile})
endif ()
@@ -804,6 +816,7 @@
add_test (
NAME H5DUMP_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"