Show trace while testing.
[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
b53713d3
MP
24set -x
25
3459d319
MP
26set -e
27
28if ! [ -d "$testdir" ] && ! mkdir "$testdir"
29then
30 echo "warning: testdir $testdir is not a directory!" >&2
31 exit 1
32fi
33
34testdir=`cd $testdir && pwd`
35
2f22174f
MP
36echo "srcdir is originally \"$srcdir\""
37srcdir=`cd "$srcdir" && pwd`
4df7868d 38
a4772a4d 39echo "============================================================"
4df7868d
MP
40echo "$0 running in `pwd`"
41echo " rsync_bin=$rsync_bin"
42echo " srcdir=$srcdir"
3459d319 43echo " testdir=$testdir"
a4772a4d 44
068a7221 45test_names="rsync-hello hands"
a4772a4d
MP
46
47export rsync_bin
48export testdir
49
5b7be6ee
MP
50skipped=0
51missing=0
52passed=0
53failed=0
54
2f22174f 55suitedir=`cd ./testsuite && pwd`
4df7868d 56echo " suitedir=$suitedir"
a4772a4d 57
e340a820
MP
58. "$suitedir/config.sh"
59
a4772a4d
MP
60for testbase in $test_names
61do
2f22174f 62 testscript="$suitedir/$testbase.test"
a4772a4d
MP
63 if test \! -f "$testscript"
64 then
65 echo "$testscript does not exist" >&2
5b7be6ee 66 missing=`expr $missing + 1`
a4772a4d
MP
67 continue
68 fi
69
951351a5
MP
70 echo "------------------------------------------------------------"
71 echo "----- $testbase running"
72
2f22174f 73 if sh "$testscript"
a4772a4d
MP
74 then
75 echo "----- $testbase completed succesfully"
5b7be6ee 76 passed=`expr $passed + 1`
a4772a4d
MP
77 else
78 echo "----- $testbase failed!"
5b7be6ee 79 failed=`expr $failed + 1`
a4772a4d
MP
80 fi
81done
82
83echo '------------------------------------------------------------'
5b7be6ee
MP
84echo "----- overall results:"
85echo " $passed passed"
86echo " $failed failed"
87echo " $skipped skipped"
88echo " $missing missing"
89echo '------------------------------------------------------------'