summaryrefslogtreecommitdiffstats
path: root/tools/h5ls
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-08-06 19:42:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-08-06 19:42:49 (GMT)
commitcd3f42096b9a957e37c9df48aa0d31d9ed4bc537 (patch)
tree86a1672d114762d3aea872e44104e65d1bc09254 /tools/h5ls
parent434643dd4d14a841abdcc73ad7b3a0a8e06e4438 (diff)
downloadhdf5-cd3f42096b9a957e37c9df48aa0d31d9ed4bc537.zip
hdf5-cd3f42096b9a957e37c9df48aa0d31d9ed4bc537.tar.gz
hdf5-cd3f42096b9a957e37c9df48aa0d31d9ed4bc537.tar.bz2
[svn-r22636] Description:
Bring r22599:22634 from trunk to revise_chunks branch Tested on: Mac OSX/64 10.7.4 (amazon) w/gcc 4.7.x, C++ & FORTRAN (No need for h5committest yet on this branch)
Diffstat (limited to 'tools/h5ls')
-rw-r--r--tools/h5ls/testh5ls.sh.in23
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index 8f793ba3d..c0667f5 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -26,6 +26,9 @@ CMP='cmp -s'
DIFF='diff -c'
CP='cp'
NLINES=20 # Max. lines of output to display if test fails
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
@@ -169,12 +172,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