Try to fix "make check" directory path.
[rsync/rsync.git] / testsuite / master.test
1 #! /bin/sh
2
3 # Copyright (C) 2001 by Martin Pool <mbp@samba.org>
4
5 # rsync top-level test script -- this invokes all the other more
6 # detailed tests in order.  This script can either be called by 'make
7 # check' or through 'runlist' from the build farm.
8
9 # We need a few environment variables to know what to test.
10
11 # rsync_bin gives the location of the rsync binary.  This is either
12 # builddir/rsync if we're testing an uninstalled copy, or
13 # install_prefix/bin/rsync if we're testing an installed copy.  On the
14 # build farm rsync will be installed, but into a scratch /usr.
15
16 # srcdir gives the location of the source tree, which lets us find the
17 # build scripts.  It might be relative, so we need to make it
18 # absolute.
19
20 # The pwd is undefined when this script starts.
21
22 srcdir=`cd $srcdir && pwd`
23
24 echo "============================================================"
25 echo "$0 running in `pwd`"
26 echo "    rsync_bin=$rsync_bin"
27 echo "    srcdir=$srcdir"
28
29 set -e
30
31 test_names="rsync-hello hands"
32
33 export rsync_bin
34 export testdir
35
36 skipped=0
37 missing=0
38 passed=0
39 failed=0
40
41 suitedir="$srcdir/testsuite"
42 cd "$suitedir"
43 echo "    suitedir=$suitedir"
44
45 for testbase in $test_names
46 do
47     testscript="./$testbase.test"
48     if test \! -f "$testscript" 
49     then
50         echo "$testscript does not exist" >&2
51         missing=`expr $missing + 1`
52         continue
53     fi
54
55     echo "------------------------------------------------------------"
56     echo "----- $testbase running"
57
58     if sh $testscript
59     then
60         echo "----- $testbase completed succesfully"
61         passed=`expr $passed + 1`
62     else
63         echo "----- $testbase failed!"
64         failed=`expr $failed + 1`
65     fi  
66 done
67
68 echo '------------------------------------------------------------'
69 echo "----- overall results:"
70 echo "      $passed passed"
71 echo "      $failed failed"
72 echo "      $skipped skipped"
73 echo "      $missing missing"
74 echo '------------------------------------------------------------'