summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-08-10 16:07:54 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-08-10 16:07:54 (GMT)
commitecdf033499ec55443445b731d8d5c58524f120fd (patch)
tree074bf6b5215885371459ad8987dcb4fa5ee7ca57 /tools
parenta558736861b97d6158c76c385e519aa4b194b4a7 (diff)
downloadhdf5-ecdf033499ec55443445b731d8d5c58524f120fd.zip
hdf5-ecdf033499ec55443445b731d8d5c58524f120fd.tar.gz
hdf5-ecdf033499ec55443445b731d8d5c58524f120fd.tar.bz2
[svn-r19213] Test for compare of output text to expected needed to account for windows line endings.
Moved ADD_TEST commands to macro. Tested: local linux, windows
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/CMakeLists.txt26
1 files changed, 17 insertions, 9 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index 1e836c7..2162d53 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -341,6 +341,22 @@ IF (BUILD_TESTING)
)
ENDMACRO (ADD_H5_TEST file)
+ MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode)
+ ADD_TEST (
+ NAME H5DUMP-output-${resultfile}
+ COMMAND $<TARGET_FILE:h5dump> -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile}
+ )
+ IF (WIN32 AND NOT MINGW)
+ FILE (READ ${PROJECT_BINARY_DIR}/${resultfile}.exp TEST_STREAM)
+ FILE (WRITE ${PROJECT_BINARY_DIR}/${resultfile}.exp "${TEST_STREAM}")
+ ENDIF (WIN32 AND NOT MINGW)
+ ADD_TEST (
+ NAME H5DUMP-output-cmp-${resultfile}
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${resultfile}.exp
+ )
+ ENDMACRO (ADD_H5_EXPORT_TEST file)
+
# Determine which filters are available
SET (USE_FILTER_SZIP H5_HAVE_FILTER_SZIP)
SET (USE_FILTER_DEFLATE H5_HAVE_FILTER_DEFLATE)
@@ -635,15 +651,7 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tdataregR 0 -R tdatareg.h5)
ADD_H5_TEST (tattrreg 0 tattrreg.h5)
ADD_H5_TEST (tattrregR 0 -R tattrreg.h5)
-
- ADD_TEST (
- NAME H5DUMP-output-tdatreg
- COMMAND $<TARGET_FILE:h5dump> -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/tbinregR.txt ${PROJECT_BINARY_DIR}/tdatareg.h5)
-
- ADD_TEST (
- NAME H5DUMP-output-cmp-tdatreg
- COMMAND ${CMAKE_COMMAND}
- -E compare_files ${PROJECT_BINARY_DIR}/tbinregR.txt ${PROJECT_BINARY_DIR}/tbinregR.exp)
+ ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 -d /Dataset1 -s 0 -R -y -o)
# tests for group creation order
# "1" tracked, "2" name, root tracked