Show More
@@ -1,77 +1,83 b'' | |||
|
1 | 1 | #!/bin/bash |
|
2 | 2 | |
|
3 | 3 | set -e |
|
4 | 4 | |
|
5 | 5 | tests=0 |
|
6 | 6 | failed=0 |
|
7 | 7 | H=$PWD |
|
8 | 8 | |
|
9 | if [ -d /usr/lib64 ]; then | |
|
10 | lib=lib64 | |
|
11 | else | |
|
12 | lib=lib | |
|
13 | fi | |
|
14 | ||
|
9 | 15 | TESTPATH=$PWD/install/bin |
|
10 | 16 | export PATH=$TESTPATH:$PATH |
|
11 | export PYTHONPATH=$PWD/install/lib/python | |
|
17 | export PYTHONPATH=$PWD/install/$lib/python | |
|
12 | 18 | |
|
13 | 19 | rm -rf install |
|
14 | 20 | cd .. |
|
15 | 21 | ${PYTHON:-python} setup.py install --home=tests/install > tests/install.err |
|
16 | 22 | if [ $? != 0 ] ; then |
|
17 | 23 | cat tests/install.err |
|
18 | 24 | fi |
|
19 | 25 | cd $H |
|
20 | 26 | rm install.err |
|
21 | 27 | |
|
22 | 28 | function run_one |
|
23 | 29 | { |
|
24 | 30 | rm -f $1.err |
|
25 | 31 | export TZ=GMT |
|
26 | 32 | D=`mktemp -d` |
|
27 | 33 | if [ "$D" == "" ] ; then |
|
28 | 34 | echo mktemp failed! |
|
29 | 35 | fi |
|
30 | 36 | |
|
31 | 37 | cd $D |
|
32 | 38 | fail=0 |
|
33 | 39 | |
|
34 | 40 | if ! $H/$1 > .out 2>&1 ; then |
|
35 | 41 | echo $1 failed with error code $? |
|
36 | 42 | fail=1 |
|
37 | 43 | fi |
|
38 | 44 | |
|
39 | 45 | if [ -s .out -a ! -r $H/$1.out ] ; then |
|
40 | 46 | echo $1 generated unexpected output: |
|
41 | 47 | cat .out |
|
42 | 48 | cp .out $H/$1.err |
|
43 | 49 | fail=1 |
|
44 | 50 | elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then |
|
45 | 51 | echo $1 output changed: |
|
46 | 52 | diff -u $H/$1.out .out && true |
|
47 | 53 | cp .out $H/$1.err |
|
48 | 54 | fail=1 |
|
49 | 55 | fi |
|
50 | 56 | |
|
51 | 57 | cd $H |
|
52 | 58 | rm -r $D |
|
53 | 59 | return $fail |
|
54 | 60 | } |
|
55 | 61 | |
|
56 | 62 | TESTS=$@ |
|
57 | 63 | if [ "$TESTS" == "" ] ; then |
|
58 | 64 | TESTS=`ls test-* | grep -Ev "\.|~"` |
|
59 | 65 | fi |
|
60 | 66 | |
|
61 | 67 | for f in $TESTS ; do |
|
62 | 68 | echo -n "." |
|
63 | 69 | if ! run_one $f ; then |
|
64 | 70 | failed=$[$failed + 1] |
|
65 | 71 | fi |
|
66 | 72 | tests=$[$tests + 1] |
|
67 | 73 | done |
|
68 | 74 | |
|
69 | 75 | rm -rf install |
|
70 | 76 | |
|
71 | 77 | echo |
|
72 | 78 | echo Ran $tests tests, $failed failed |
|
73 | 79 | |
|
74 | 80 | if [ $failed -gt 0 ] ; then |
|
75 | 81 | exit 1 |
|
76 | 82 | fi |
|
77 | 83 |
General Comments 0
You need to be logged in to leave comments.
Login now