Add comment: cyeoh says that getpass is deprecated, because it may
[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. At the moment we assume we are invoked from the
18# source directory.
19
20# testdir is a scratch directory for holding temporary test files.
21
22# The pwd is undefined when this script starts.
23
24set -x
25
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
36echo "srcdir is originally \"$srcdir\""
37if [ "$srcdir" != "" ]
38then
39 srcdir=`cd "$srcdir" && pwd`
40fi
41
42echo "============================================================"
43echo "$0 running in `pwd`"
44echo " rsync_bin=$rsync_bin"
45echo " srcdir=$srcdir"
46echo " testdir=$testdir"
47
48test_names="rsync-hello hands"
49
50export rsync_bin
51export testdir
52
53skipped=0
54missing=0
55passed=0
56failed=0
57
58suitedir="$srcdir/testsuite"
59echo " suitedir=$suitedir"
60
61. "$suitedir/config.sh"
62
63for testbase in $test_names
64do
65 testscript="$suitedir/$testbase.test"
66 if test \! -f "$testscript"
67 then
68 echo "$testscript does not exist" >&2
69 missing=`expr $missing + 1`
70 continue
71 fi
72
73 echo "------------------------------------------------------------"
74 echo "----- $testbase running"
75
76 if sh "$testscript"
77 then
78 echo "----- $testbase completed succesfully"
79 passed=`expr $passed + 1`
80 else
81 echo "----- $testbase failed!"
82 failed=`expr $failed + 1`
83 fi
84done
85
86echo '------------------------------------------------------------'
87echo "----- overall results:"
88echo " $passed passed"
89echo " $failed failed"
90echo " $skipped skipped"
91echo " $missing missing"
92echo '------------------------------------------------------------'
93
94if test $failed -gt 0
95then
96 exit 1
97else
98 exit 0
99fi