Add comment: cyeoh says that getpass is deprecated, because it may
[rsync/rsync.git] / testsuite / master.test
index ffacc1e..4df5f34 100755 (executable)
 # 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.  It might be relative, so we need to make it
-# absolute.
+# 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"
@@ -31,8 +33,11 @@ fi
 
 testdir=`cd $testdir && pwd`
 
-echo "srcdir is originally $srcdir"
-srcdir=`cd $srcdir && pwd`
+echo "srcdir is originally \"$srcdir\""
+if [ "$srcdir" != "" ]
+then
+    srcdir=`cd "$srcdir" && pwd`
+fi
 
 echo "============================================================"
 echo "$0 running in `pwd`"
@@ -51,14 +56,13 @@ passed=0
 failed=0
 
 suitedir="$srcdir/testsuite"
-cd "$suitedir"
 echo "    suitedir=$suitedir"
 
 . "$suitedir/config.sh"
 
 for testbase in $test_names
 do
-    testscript="./$testbase.test"
+    testscript="$suitedir/$testbase.test"
     if test \! -f "$testscript" 
     then
        echo "$testscript does not exist" >&2
@@ -69,7 +73,7 @@ do
     echo "------------------------------------------------------------"
     echo "----- $testbase running"
 
-    if sh $testscript
+    if sh "$testscript"
     then
        echo "----- $testbase completed succesfully"
        passed=`expr $passed + 1`
@@ -86,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