Try again to find the right directory on both local and farm builds.
[rsync/rsync.git] / testsuite / master.test
CommitLineData
a4772a4d
MP
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
4df7868d
MP
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
2f22174f
MP
17# build scripts. At the moment we assume we are invoked from the
18# source directory.
4df7868d 19
3459d319
MP
20# testdir is a scratch directory for holding temporary test files.
21
4df7868d
MP
22# The pwd is undefined when this script starts.
23
3459d319
MP
24set -e
25
26if ! [ -d "$testdir" ] && ! mkdir "$testdir"
27then
28 echo "warning: testdir $testdir is not a directory!" >&2
29 exit 1
30fi
31
32testdir=`cd $testdir && pwd`
33
2f22174f
MP
34echo "srcdir is originally \"$srcdir\""
35srcdir=`cd "$srcdir" && pwd`
4df7868d 36
a4772a4d 37echo "============================================================"
4df7868d
MP
38echo "$0 running in `pwd`"
39echo " rsync_bin=$rsync_bin"
40echo " srcdir=$srcdir"
3459d319 41echo " testdir=$testdir"
a4772a4d 42
068a7221 43test_names="rsync-hello hands"
a4772a4d
MP
44
45export rsync_bin
46export testdir
47
5b7be6ee
MP
48skipped=0
49missing=0
50passed=0
51failed=0
52
2f22174f 53suitedir=`cd ./testsuite && pwd`
4df7868d 54echo " suitedir=$suitedir"
a4772a4d 55
e340a820
MP
56. "$suitedir/config.sh"
57
a4772a4d
MP
58for testbase in $test_names
59do
2f22174f 60 testscript="$suitedir/$testbase.test"
a4772a4d
MP
61 if test \! -f "$testscript"
62 then
63 echo "$testscript does not exist" >&2
5b7be6ee 64 missing=`expr $missing + 1`
a4772a4d
MP
65 continue
66 fi
67
951351a5
MP
68 echo "------------------------------------------------------------"
69 echo "----- $testbase running"
70
2f22174f 71 if sh "$testscript"
a4772a4d
MP
72 then
73 echo "----- $testbase completed succesfully"
5b7be6ee 74 passed=`expr $passed + 1`
a4772a4d
MP
75 else
76 echo "----- $testbase failed!"
5b7be6ee 77 failed=`expr $failed + 1`
a4772a4d
MP
78 fi
79done
80
81echo '------------------------------------------------------------'
5b7be6ee
MP
82echo "----- overall results:"
83echo " $passed passed"
84echo " $failed failed"
85echo " $skipped skipped"
86echo " $missing missing"
87echo '------------------------------------------------------------'