summaryrefslogtreecommitdiffstats
path: root/tools/test/h5jam/CMakeTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5jam/CMakeTests.cmake')
-rw-r--r--tools/test/h5jam/CMakeTests.cmake36
1 files changed, 21 insertions, 15 deletions
diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake
index 2d00b86..84af48b 100644
--- a/tools/test/h5jam/CMakeTests.cmake
+++ b/tools/test/h5jam/CMakeTests.cmake
@@ -47,6 +47,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# ============================================================
# TEST_H5JAM_OUTPUT
# For the purpose to verify only output & exitcode from h5jam
@@ -54,8 +60,8 @@
macro (TEST_H5JAM_OUTPUT expectfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN})
- if (NOT "${resultcode}" STREQUAL "0")
+ add_test (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
@@ -69,7 +75,7 @@
add_test (
NAME H5JAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -90,8 +96,8 @@
macro (TEST_H5UNJAM_OUTPUT expectfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN})
- if (NOT "${resultcode}" STREQUAL "0")
+ add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
@@ -105,7 +111,7 @@
add_test (
NAME H5JAM-UNJAM-${expectfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -133,7 +139,7 @@
add_test (
NAME H5JAM-${testname}-CHECKFILE-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=testfiles/${expected}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.new"
@@ -146,7 +152,7 @@
add_test (
NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${actual}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.out"
@@ -181,7 +187,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${ufile}
)
set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects)
set (compare_test ${ufile})
else ()
@@ -189,7 +195,7 @@
add_test (
NAME H5JAM-${testname}-UNJAM
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
-D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${outfile}.ufile.txt"
@@ -200,12 +206,12 @@
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "${outfile}.ufile.txt")
else ()
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "")
endif ()
endif ()
- if (NOT "${compare_test}" STREQUAL "")
+ if (${compare_test})
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects
COMMAND ${CMAKE_COMMAND}
@@ -244,7 +250,7 @@
-D "TEST_OFILE=NULL"
-P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
- if (NOT "${compare_test}" STREQUAL "")
+ if (${compare_test})
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1)
else ()
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM)
@@ -261,7 +267,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5
)
endif ()
- add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
+ add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects)
set (compare_test ${outfile})
@@ -316,7 +322,7 @@
)
set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP)
- add_test (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
+ add_test (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY)
set (compare_test ${chkfile})