Export autoconf settings to test scripts. Use this to cope with
[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
17# build scripts. It might be relative, so we need to make it
18# absolute.
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
4df7868d
MP
34srcdir=`cd $srcdir && pwd`
35
a4772a4d 36echo "============================================================"
4df7868d
MP
37echo "$0 running in `pwd`"
38echo " rsync_bin=$rsync_bin"
39echo " srcdir=$srcdir"
3459d319 40echo " testdir=$testdir"
a4772a4d 41
068a7221 42test_names="rsync-hello hands"
a4772a4d
MP
43
44export rsync_bin
45export testdir
46
5b7be6ee
MP
47skipped=0
48missing=0
49passed=0
50failed=0
51
4df7868d
MP
52suitedir="$srcdir/testsuite"
53cd "$suitedir"
54echo " suitedir=$suitedir"
a4772a4d 55
e340a820
MP
56. "$suitedir/config.sh"
57
a4772a4d
MP
58for testbase in $test_names
59do
4df7868d 60 testscript="./$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
a4772a4d
MP
71 if sh $testscript
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 '------------------------------------------------------------'