More test suite stuff
[rsync/rsync.git] / testsuite / master.test
... / ...
CommitLineData
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# testdir is a scratch directory for holding temporary test files.
21
22# The pwd is undefined when this script starts.
23
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
34echo "srcdir is originally $srcdir"
35srcdir=`cd $srcdir && pwd`
36
37echo "============================================================"
38echo "$0 running in `pwd`"
39echo " rsync_bin=$rsync_bin"
40echo " srcdir=$srcdir"
41echo " testdir=$testdir"
42
43test_names="rsync-hello hands"
44
45export rsync_bin
46export testdir
47
48skipped=0
49missing=0
50passed=0
51failed=0
52
53suitedir="$srcdir/testsuite"
54cd "$suitedir"
55echo " suitedir=$suitedir"
56
57. "$suitedir/config.sh"
58
59for testbase in $test_names
60do
61 testscript="./$testbase.test"
62 if test \! -f "$testscript"
63 then
64 echo "$testscript does not exist" >&2
65 missing=`expr $missing + 1`
66 continue
67 fi
68
69 echo "------------------------------------------------------------"
70 echo "----- $testbase running"
71
72 if sh $testscript
73 then
74 echo "----- $testbase completed succesfully"
75 passed=`expr $passed + 1`
76 else
77 echo "----- $testbase failed!"
78 failed=`expr $failed + 1`
79 fi
80done
81
82echo '------------------------------------------------------------'
83echo "----- overall results:"
84echo " $passed passed"
85echo " $failed failed"
86echo " $skipped skipped"
87echo " $missing missing"
88echo '------------------------------------------------------------'