From 1be6fb841730862e59678c57e4fcc75661b3d16f Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 1 Aug 2006 09:31:45 -0500 Subject: [svn-r12522] h5copy was not able to find the source file because it was not using the $srcdir properly. It is not right to chdir into testfiles and write files there because in real srcdir mode, one should not changes things in the srcdir area which could be shared by multiple builds simultanteously. Solution: added the proper $srcdir components to the source file name. Also clean up the indentation by cb. Tested: only by hand in heping. --- tools/h5copy/testh5copy.sh | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index 13b7e81..0d7fb7c 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -33,8 +33,8 @@ test -d ../testfiles || mkdir ../testfiles # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". TESTING() { - SPACES=" " - echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' + SPACES=" " + echo "Testing $* $SPACES" |cut -c1-70 |tr -d '\012' } # Run a test and print PASS or *FAIL*. If h5copy can complete @@ -42,32 +42,31 @@ TESTING() { # the `nerrors' global variable. TOOLTEST() { - - TESTING $H5COPY $@ - ( - echo "#############################" - echo " output for '$H5COPY $@'" - echo "#############################" - cd $srcdir/../testfiles -# echo " pwd = `pwd`" - $RUNSERIAL $H5COPY_BIN $@ - ) > output.out - RET=$? - if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" - else - echo " PASSED" - fi + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN $@ + ) > output.out + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + echo "failed result is:" + cat output.out + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi } ############################################################################## ### T H E T E S T S ### ############################################################################## -#TOOLTEST -v test1.h5/array test1.out.h5/array -#TOOLTEST -v test1.h5/integer test1.out.h5/integer_copy -#TOOLTEST -v test1.h5/g1 test1.out.h5/g1 +TOOLTEST -v $srcdir/../testfiles/test1.h5/array test1.out.h5/array +TOOLTEST -v $srcdir/../testfiles/test1.h5/integer test1.out.h5/integer_copy +TOOLTEST -v $srcdir/../testfiles/test1.h5/g1 test1.out.h5/g1 if test $nerrors -eq 0 ; then echo "All h5copy tests passed." -- cgit v0.12