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