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