summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2012-08-02 19:32:38 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2012-08-02 19:32:38 (GMT)
commite8197d194144e14c6c33ffd986428817d31fec0a (patch)
tree614b180d1b69c77c00a8516c8bc2f54d151f8f9f /tools/h5dump
parent62455bb02564a3f0af60aa68ce3ac99bcd150959 (diff)
downloadhdf5-e8197d194144e14c6c33ffd986428817d31fec0a.zip
hdf5-e8197d194144e14c6c33ffd986428817d31fec0a.tar.gz
hdf5-e8197d194144e14c6c33ffd986428817d31fec0a.tar.bz2
[svn-r22621] Purpose:
HDFFV-8107 testh5diff will fail if build/test in HDF5 source tree Description: This is sub-task for "HDFFV-8105 testh5diff.sh uses the wrong operator (-a) in an if statement." From the HDFFV-8105's update, h5diff test failed if build&test is performed in HDF5 source tree because 'cp' try to copy test files to self dir. It's addressed by skipping if cp's src dir and dest dir is same. Also this applied for all other tools under src/tools dir. No change to the CMakeLists.txt files because CMake cautions/demands that in-source builds be avoided. Merged from HDF5 trunk r22617. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), some manual tests as well
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/testh5dump.sh.in24
-rw-r--r--tools/h5dump/testh5dumppbits.sh.in24
-rw-r--r--tools/h5dump/testh5dumpxml.sh.in23
3 files changed, 51 insertions, 20 deletions
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index cffaade..c08379d 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -40,6 +40,9 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
nerrors=0
verbose=yes
@@ -349,18 +352,25 @@ COPY_TESTFILES_TO_TESTDIR()
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
RET=$?
if [ $RET -eq 1 ]; then
- if [ -a $tstfile ]; then
- $CP -f $tstfile $TESTDIR
- else
- echo "Error: FAILED to copy $tstfile"
- echo " $tstfile doesn't exist!"
- exit $EXIT_FAILURE
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $TESTDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
fi
fi
done
}
-
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in
index 991fe7a..3d9685c 100644
--- a/tools/h5dump/testh5dumppbits.sh.in
+++ b/tools/h5dump/testh5dumppbits.sh.in
@@ -40,6 +40,9 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
nerrors=0
verbose=yes
@@ -165,18 +168,25 @@ COPY_TESTFILES_TO_TESTDIR()
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
RET=$?
if [ $RET -eq 1 ]; then
- if [ -a $tstfile ]; then
- $CP -f $tstfile $TESTDIR
- else
- echo "Error: FAILED to copy $tstfile"
- echo " $tstfile doesn't exist!"
- exit $EXIT_FAILURE
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $TESTDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
fi
fi
done
}
-
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index 4e6081b..1a6b2b1 100644
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -27,6 +27,9 @@ DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
nerrors=0
verbose=yes
@@ -195,12 +198,20 @@ COPY_TESTFILES_TO_TESTDIR()
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
RET=$?
if [ $RET -eq 1 ]; then
- if [ -a $tstfile ]; then
- $CP -f $tstfile $TESTDIR
- else
- echo "Error: FAILED to copy $tstfile"
- echo " $tstfile doesn't exist!"
- exit $EXIT_FAILURE
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $TESTDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
fi
fi
done