diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-09-18 16:04:09 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-09-18 16:04:09 (GMT) |
commit | 624d5d9a8e27fdad93208821d1cd7f535d2ca61a (patch) | |
tree | cdcca9b4b405a5efde03670ff0809ffc9be7dba5 /test | |
parent | 671649f6f2a9b3903c815d225f0ea6d1e596a6d5 (diff) | |
download | hdf5-624d5d9a8e27fdad93208821d1cd7f535d2ca61a.zip hdf5-624d5d9a8e27fdad93208821d1cd7f535d2ca61a.tar.gz hdf5-624d5d9a8e27fdad93208821d1cd7f535d2ca61a.tar.bz2 |
HDFFV-10740 - skip copying dirs in for loops
Diffstat (limited to 'test')
-rw-r--r-- | test/test_usecases.sh.in | 31 | ||||
-rw-r--r-- | test/testflushrefresh.sh.in | 25 | ||||
-rw-r--r-- | test/testswmr.sh.in | 11 | ||||
-rw-r--r-- | test/testvdsswmr.sh.in | 13 |
4 files changed, 54 insertions, 26 deletions
diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 8bc2078..49868ca 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -40,7 +40,7 @@ fi # Define symbols EXIT_SUCCESS=0 EXIT_FAILURE=1 -EXIT_VALUE=$EXIT_SUCCESS # Default all tests succeed +EXIT_VALUE=$EXIT_SUCCESS # Default all tests succeed RESULT_PASSED=" PASSED" RESULT_FAILED="*FAILED*" RESULT_SKIP="-SKIP-" @@ -97,17 +97,17 @@ TOOLTEST() { cat $actual_err >> $actual if [ $exit_code -eq 0 ];then - echo "$RESULT_PASSED" - test yes = "$verbose" && sed 's/^/ /' < $actual + echo "$RESULT_PASSED" + test yes = "$verbose" && sed 's/^/ /' < $actual else - echo "$RESULT_FAILED" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && sed 's/^/ /' < $actual + echo "$RESULT_FAILED" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && sed 's/^/ /' < $actual fi # Clean up output file if test -z "$HDF5_NOCLEANUP"; then - rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext fi } @@ -122,7 +122,9 @@ for FILE in use_*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE usecases_test + if test -f "$FILE" ; then + cp $FILE usecases_test + fi done # With the --disable-shared option, swmr program files are built in the test @@ -131,7 +133,14 @@ done # always be copied, swmr files in .libs should be copied only if they exists. if [ -f .libs/use_append_chunk ]; then mkdir usecases_test/.libs - cp .libs/use_* usecases_test/.libs + for FILE in .libs/use_*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + if test -f "$FILE" ; then + cp $FILE usecases_test/.libs + fi + done cp .libs/twriteorder usecases_test/.libs fi @@ -176,10 +185,10 @@ for p in $USECASES_PROGRAMS; do TOOLTEST ./$p -l w TOOLTEST ./$p -l r # use case 1.9, testing with multi-planes chunks - TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks + TOOLTEST ./$p -z 256 -y 5 # 5 planes chunks # cleanup temp datafile if test -z "$HDF5_NOCLEANUP"; then - rm -f $p.h5 + rm -f $p.h5 fi done diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index ca46dcb..3cdf10f 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -20,7 +20,7 @@ # the verification of this feature needs to occur in separate processes # from the one in which the file is being manipulated in. (i.e., we have # a single writer process, and various reader processes spawning off -# and doing the verification that individual objects are being +# and doing the verification that individual objects are being # correctly flushed). # # Programmer: @@ -80,23 +80,30 @@ fi # HDF5 has several tests that create and delete signal files to communicate # between processes, and it seems that even though the names of the files are # different, occasionally the wrong file is deleted, interrupting the flow of -# the test. Running each of these tests in its own directory should eliminate +# the test. Running each of these tests in its own directory should eliminate # the problem. mkdir flushrefresh_test cp flushrefresh flushrefresh_test # With the --disable-shared option, flushrefresh is built in the test directory, -# otherwise it is in test/.libs with a wrapper script named flushrefresh in -# the test directory. test/flushrefresh should always be copied, +# otherwise it is in test/.libs with a wrapper script named flushrefresh in +# the test directory. test/flushrefresh should always be copied, # .libs/flushrefresh should be copied only if it exists. if [ -f .libs/flushrefresh ]; then mkdir flushrefresh_test/.libs - cp .libs/flushrefresh flushrefresh_test/.libs + for FILE in .libs/flushrefresh*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + if test -f "$FILE" ; then + cp $FILE flushrefresh_test/.libs + fi + done fi cd flushrefresh_test # ================================================= -# Set up/initialize some variables to be used later +# Set up/initialize some variables to be used later # ================================================= testfile=flushrefresh.h5 startsignal=flushrefresh_VERIFICATION_START @@ -119,13 +126,13 @@ pid_main=$! # ======================================= until [ $verification_done -eq 1 ]; do - + # Wait for signal from test program that verification routine can run. before=`TimeStamp` until [ -s $startsignal ]; do after=`TimeStamp` timediff=`expr $after - $before` - if [ $timediff -gt $timeout_length ]; then + if [ $timediff -gt $timeout_length ]; then nerrors=`expr $nerrors + 1` timedout=1 break @@ -165,7 +172,7 @@ if [ $timedout -eq 0 ]; then until [ -s $startsignal ]; do after=`TimeStamp` timediff=`expr $after - $before` - if [ $timediff -gt $timeout_length ]; then + if [ $timediff -gt $timeout_length ]; then nerrors=`expr $nerrors + 1` timedout=1 break diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index f81a7d7..a41947e 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -131,9 +131,10 @@ for FILE in swmr*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE swmr_test + if test -f "$FILE" ; then + cp $FILE swmr_test + fi done -cp swmr* swmr_test # With the --disable-shared option, swmr program files are built in the test # directory, otherwise they are in test/.libs with a corresponding wrapper @@ -145,7 +146,9 @@ if [ -f .libs/swmr ]; then case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE swmr_test/.libs + if test -f "$FILE" ; then + cp $FILE swmr_test/.libs + fi done fi @@ -153,7 +156,7 @@ cd swmr_test # Loop over index types -for index_type in "-i ea" "-i b2" +for index_type in "-i ea" "-i b2" do # Try with and without compression for compress in "" "-c 5" diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index 32af072..28abcf5 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -117,7 +117,9 @@ for FILE in vds_swmr*; do case "$FILE" in *.o) continue ;; ## don't copy the .o files esac - cp $FILE vds_swmr_test + if test -f "$FILE" ; then + cp $FILE vds_swmr_test + fi done # With the --disable-shared option, swmr program files are built in the test @@ -126,7 +128,14 @@ done # always be copied, swmr files in .libs should be copied only if they exists. if [ -f .libs/vds_swmr_writer ]; then mkdir vds_swmr_test/.libs - cp .libs/vds_swmr* vds_swmr_test/.libs + for FILE in .libs/vds_swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + if test -f "$FILE" ; then + cp $FILE vds_swmr_test/.libs + fi + done fi cd vds_swmr_test |