summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/testh5diff.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff/testh5diff.sh')
-rwxr-xr-xtools/h5diff/testh5diff.sh21
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh
index a208acf..86a0c9d 100755
--- a/tools/h5diff/testh5diff.sh
+++ b/tools/h5diff/testh5diff.sh
@@ -41,6 +41,9 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
nerrors=0
verbose=yes
@@ -318,12 +321,20 @@ COPY_TESTFILES_TO_TESTDIR()
echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
RET=$?
if [ $RET -eq 1 ]; then
- $CP -f $tstfile $TESTDIR
- if [ $? -ne 0 ]; then
- echo "Error: FAILED to copy $tstfile ."
+ # 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
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
fi
fi
done