X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/bc888e05da803d80f880339150deb609958693c0..64bd756832d93c0767e72a3432fda29b30d69405:/testsuite/master.test diff --git a/testsuite/master.test b/testsuite/master.test index 5356d22c..4df5f343 100755 --- a/testsuite/master.test +++ b/testsuite/master.test @@ -8,8 +8,42 @@ # We need a few environment variables to know what to test. +# rsync_bin gives the location of the rsync binary. This is either +# builddir/rsync if we're testing an uninstalled copy, or +# install_prefix/bin/rsync if we're testing an installed copy. On the +# build farm rsync will be installed, but into a scratch /usr. + +# srcdir gives the location of the source tree, which lets us find the +# build scripts. At the moment we assume we are invoked from the +# source directory. + +# testdir is a scratch directory for holding temporary test files. + +# The pwd is undefined when this script starts. + +set -x + +set -e + +if ! [ -d "$testdir" ] && ! mkdir "$testdir" +then + echo "warning: testdir $testdir is not a directory!" >&2 + exit 1 +fi + +testdir=`cd $testdir && pwd` + +echo "srcdir is originally \"$srcdir\"" +if [ "$srcdir" != "" ] +then + srcdir=`cd "$srcdir" && pwd` +fi + echo "============================================================" -echo "$0 running" +echo "$0 running in `pwd`" +echo " rsync_bin=$rsync_bin" +echo " srcdir=$srcdir" +echo " testdir=$testdir" test_names="rsync-hello hands" @@ -21,11 +55,14 @@ missing=0 passed=0 failed=0 -testsrcdir="`pwd`" +suitedir="$srcdir/testsuite" +echo " suitedir=$suitedir" + +. "$suitedir/config.sh" for testbase in $test_names do - testscript="$testsrcdir/$testbase.test" + testscript="$suitedir/$testbase.test" if test \! -f "$testscript" then echo "$testscript does not exist" >&2 @@ -36,7 +73,7 @@ do echo "------------------------------------------------------------" echo "----- $testbase running" - if sh $testscript + if sh "$testscript" then echo "----- $testbase completed succesfully" passed=`expr $passed + 1` @@ -53,3 +90,10 @@ echo " $failed failed" echo " $skipped skipped" echo " $missing missing" echo '------------------------------------------------------------' + +if test $failed -gt 0 +then + exit 1 +else + exit 0 +fi