diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2012-08-01 15:37:40 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2012-08-01 15:37:40 (GMT) |
commit | 840ad091059877ed68fcc840f23ad633177c6f59 (patch) | |
tree | 8670e5095e09f5245a682cbea7bc4e5a9f0740f3 /tools/h5diff | |
parent | d4d9cbd52d86800f5874fe8d6a2e939f090c5c2d (diff) | |
download | hdf5-840ad091059877ed68fcc840f23ad633177c6f59.zip hdf5-840ad091059877ed68fcc840f23ad633177c6f59.tar.gz hdf5-840ad091059877ed68fcc840f23ad633177c6f59.tar.bz2 |
[svn-r22617] Purpose:
Fix for 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.
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/h5diff')
-rwxr-xr-x | tools/h5diff/testh5diff.sh | 21 |
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 |