Print source directory.
[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
ea4a0376 34echo "srcdir is originally $srcdir"
4df7868d
MP
35srcdir=`cd $srcdir && pwd`
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
4df7868d
MP
53suitedir="$srcdir/testsuite"
54cd "$suitedir"
55echo " suitedir=$suitedir"
a4772a4d 56
e340a820
MP
57. "$suitedir/config.sh"
58
a4772a4d
MP
59for testbase in $test_names
60do
4df7868d 61 testscript="./$testbase.test"
a4772a4d
MP
62 if test \! -f "$testscript"
63 then
64 echo "$testscript does not exist" >&2
5b7be6ee 65 missing=`expr $missing + 1`
a4772a4d
MP
66 continue
67 fi
68
951351a5
MP
69 echo "------------------------------------------------------------"
70 echo "----- $testbase running"
71
a4772a4d
MP
72 if sh $testscript
73 then
74 echo "----- $testbase completed succesfully"
5b7be6ee 75 passed=`expr $passed + 1`
a4772a4d
MP
76 else
77 echo "----- $testbase failed!"
5b7be6ee 78 failed=`expr $failed + 1`
a4772a4d
MP
79 fi
80done
81
82echo '------------------------------------------------------------'
5b7be6ee
MP
83echo "----- overall results:"
84echo " $passed passed"
85echo " $failed failed"
86echo " $skipped skipped"
87echo " $missing missing"
88echo '------------------------------------------------------------'