summaryrefslogtreecommitdiffstats
path: root/tools/h5copy
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2012-01-11 22:46:31 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2012-01-11 22:46:31 (GMT)
commit805512456683cacf940eb7052ba14fd6ae6d3f9f (patch)
tree5a67e9028b49a663a4841bcf188d8d2f425fc6b1 /tools/h5copy
parent429a51a6c32eb1825029337c240f7dd1a1713c4e (diff)
downloadhdf5-805512456683cacf940eb7052ba14fd6ae6d3f9f.zip
hdf5-805512456683cacf940eb7052ba14fd6ae6d3f9f.tar.gz
hdf5-805512456683cacf940eb7052ba14fd6ae6d3f9f.tar.bz2
[svn-r21874] Purpose:
HDFFV-7602 - GMQS: HDF5 command tools: Provide framework for reusable test files among tools Stage2 working for h5copy tool. Description: Update cmake script to fetch test files from anywhere. Also keep the apperance similiar to shell script for better maintainance. some updated shell script. Tested: jam (linux32-LE), koala (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE), Cmake (jam)
Diffstat (limited to 'tools/h5copy')
-rw-r--r--tools/h5copy/CMakeLists.txt58
-rw-r--r--tools/h5copy/testfiles/h5copy_extlinks_src.out.ls3
-rw-r--r--tools/h5copy/testfiles/h5copy_ref.out.ls3
-rw-r--r--tools/h5copy/testfiles/h5copytst.out.ls3
-rw-r--r--tools/h5copy/testh5copy.sh33
5 files changed, 44 insertions, 56 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt
index 6a167b8..b0b9aa8 100644
--- a/tools/h5copy/CMakeLists.txt
+++ b/tools/h5copy/CMakeLists.txt
@@ -34,43 +34,49 @@ IF (BUILD_TESTING)
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
# --------------------------------------------------------------------
- # Copy all the HDF5 files from the test directory into the source directory
+ # Copy all the HDF5 files from the source directory into the test directory
# --------------------------------------------------------------------
- SET (HDF5_REFERENCE_FILES
- h5copy_extlinks_src.out.ls
- h5copy_ref.out.ls
- h5copytst.out.ls
+ SET (LIST_HDF5_TEST_FILES
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5
)
- SET (HDF5_REFERENCE_TEST_FILES
- h5copy_extlinks_src.h5
- h5copy_extlinks_trg.h5
- h5copy_ref.h5
- h5copytst.h5
- h5copy_misc1.out
+
+ SET (LIST_OTHER_TEST_FILES
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls
+ ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls
)
FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- FOREACH (ls_file ${HDF5_REFERENCE_FILES})
- SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${ls_file}")
- #MESSAGE (STATUS " Translating ${ls_file}")
- ADD_CUSTOM_COMMAND (
- TARGET h5copy
- POST_BUILD
- COMMAND ${XLATE_UTILITY}
- ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${ls_file} ${lsdest} -l3
- )
- ENDFOREACH (ls_file ${HDF5_REFERENCE_FILES})
- FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES})
- SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}")
- #MESSAGE (STATUS " Copying ${h5_file}")
+ FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
+ GET_FILENAME_COMPONENT(fname "${listfiles}" NAME)
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ #MESSAGE (STATUS " Copying ${listfiles}")
ADD_CUSTOM_COMMAND (
TARGET h5copy
POST_BUILD
COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${h5_file} ${dest}
+ ARGS -E copy_if_different ${listfiles} ${dest}
)
- ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES})
+ ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
+
+ #
+ # This section can be removed, but leave here for a reference later.
+ # Purpose: '-l3' ignores top 3 lines when copy text file.
+ #
+ #FOREACH (listfiles ${LIST_OTHER_TEST_FILES})
+ # SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${listfiles}")
+ # ADD_CUSTOM_COMMAND (
+ # TARGET h5copy
+ # POST_BUILD
+ # COMMAND ${XLATE_UTILITY}
+ # ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${listfiles} ${lsdest} -l3
+ # )
+ #ENDFOREACH (listfiles ${LIST_OTHER_TEST_FILES})
##############################################################################
##############################################################################
diff --git a/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls b/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls
index e0047a7..0134714 100644
--- a/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls
+++ b/tools/h5copy/testfiles/h5copy_extlinks_src.out.ls
@@ -1,6 +1,3 @@
-#############################
-Expected output for 'h5ls ./testfiles/h5copy_extlinks_src.out.h5'
-#############################
Opened "./testfiles/h5copy_extlinks_src.out.h5" with sec2 driver.
/ Group
Location: 1:96
diff --git a/tools/h5copy/testfiles/h5copy_ref.out.ls b/tools/h5copy/testfiles/h5copy_ref.out.ls
index 8549842..0769dc8 100644
--- a/tools/h5copy/testfiles/h5copy_ref.out.ls
+++ b/tools/h5copy/testfiles/h5copy_ref.out.ls
@@ -1,6 +1,3 @@
-#############################
-Expected output for 'h5ls ./testfiles/h5copy_ref.out.h5'
-#############################
Opened "./testfiles/h5copy_ref.out.h5" with sec2 driver.
/ Group
Location: 1:96
diff --git a/tools/h5copy/testfiles/h5copytst.out.ls b/tools/h5copy/testfiles/h5copytst.out.ls
index 6598c8f..62c860b 100644
--- a/tools/h5copy/testfiles/h5copytst.out.ls
+++ b/tools/h5copy/testfiles/h5copytst.out.ls
@@ -1,6 +1,3 @@
-#############################
-Expected output for 'h5ls ./testfiles/h5copytst.out.h5'
-#############################
Opened "./testfiles/h5copytst.out.h5" with sec2 driver.
/ Group
Location: 1:96
diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh
index 65cd353..0529d53 100644
--- a/tools/h5copy/testh5copy.sh
+++ b/tools/h5copy/testh5copy.sh
@@ -41,12 +41,6 @@ TESTNAME=h5copy
EXIT_SUCCESS=0
EXIT_FAILURE=1
-# Test files
-HDF_FILE1=h5copytst.h5
-HDF_FILE2=h5copy_ref.h5
-HDF_EXT_SRC_FILE=h5copy_extlinks_src.h5
-HDF_EXT_TRG_FILE=h5copy_extlinks_trg.h5
-
######################################################################
# test files
# --------------------------------------------------------------------
@@ -58,10 +52,10 @@ HDF_EXT_TRG_FILE=h5copy_extlinks_trg.h5
# --------------------------------------------------------------------
# List of files that will be copied over to local test dir
LIST_HDF5_TEST_FILES="
-$SRC_H5COPY_TESTFILES/$HDF_FILE1
-$SRC_H5COPY_TESTFILES/$HDF_FILE2
-$SRC_H5COPY_TESTFILES/$HDF_EXT_SRC_FILE
-$SRC_H5COPY_TESTFILES/$HDF_EXT_TRG_FILE
+$SRC_H5COPY_TESTFILES/h5copytst.h5
+$SRC_H5COPY_TESTFILES/h5copy_ref.h5
+$SRC_H5COPY_TESTFILES/h5copy_extlinks_src.h5
+$SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5
"
# List of expect files that will be copied over to local test dir
@@ -345,9 +339,6 @@ H5LSTEST()
# so that the output is more portable
VERIFY_H5LS $@
(
- echo "#############################"
- echo "Expected output for '$H5LS $@'"
- echo "#############################"
$RUNSERIAL $H5LS_BIN $H5LS_ARGS $@
) 2>&1 |sed 's/Modified:.*/Modified: XXXX-XX-XX XX:XX:XX XXX/' |sed 's/Storage:.*/Storage: <details removed for portability>/' >$actual
@@ -378,8 +369,8 @@ H5LSTEST()
# <none>
COPY_OBJECTS()
{
- TESTFILE="$TESTDIR/$HDF_FILE1"
- FILEOUT="$TESTDIR/`basename $HDF_FILE1 .h5`.out.h5"
+ TESTFILE="$TESTDIR/h5copytst.h5"
+ FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -438,8 +429,8 @@ COPY_OBJECTS()
# <none>
COPY_REFERENCES()
{
- TESTFILE="$TESTDIR/$HDF_FILE2"
- FILEOUT="$TESTDIR/`basename $HDF_FILE2 .h5`.out.h5"
+ TESTFILE="$TESTDIR/h5copy_ref.h5"
+ FILEOUT="$TESTDIR/`basename h5copy_ref.h5 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -464,8 +455,8 @@ COPY_REFERENCES()
# <none>
COPY_EXT_LINKS()
{
- TESTFILE="$TESTDIR/$HDF_EXT_SRC_FILE"
- FILEOUT="$TESTDIR/`basename $HDF_EXT_SRC_FILE .h5`.out.h5"
+ TESTFILE="$TESTDIR/h5copy_extlinks_src.h5"
+ FILEOUT="$TESTDIR/`basename h5copy_extlinks_src.h5 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -510,8 +501,8 @@ COPY_EXT_LINKS()
# <none>
TEST_MISC()
{
- TESTFILE="$TESTDIR/$HDF_FILE1"
- FILEOUT="$TESTDIR/`basename $HDF_FILE1 .h5`.out.h5"
+ TESTFILE="$TESTDIR/h5copytst.h5"
+ FILEOUT="$TESTDIR/`basename h5copytst.h5 .h5`.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT