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