author | Thomas Arendsen Hein <thomas@intevation.de> |
Fri, 29 Jul 2005 06:43:21 +0100 | |
changeset 793 | 445970ccf57a |
parent 749 | 7e4843b7efd2 |
parent 787 | f199e1887889 |
child 798 | c28f9feb7c2e |
permissions | -rwxr-xr-x |
544
3d4d5f2aba9a
Remove bashisms and use /bin/sh instead of /bin/bash.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
495
diff
changeset
|
1 |
#!/bin/sh -e |
331 | 2 |
|
488
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
3 |
export LANG=C |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
4 |
export LC_CTYPE="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
5 |
export LC_NUMERIC="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
6 |
export LC_TIME="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
7 |
export LC_COLLATE="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
8 |
export LC_MONETARY="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
9 |
export LC_MESSAGES="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
10 |
export LC_PAPER="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
11 |
export LC_NAME="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
12 |
export LC_ADDRESS="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
13 |
export LC_TELEPHONE="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
14 |
export LC_MEASUREMENT="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
15 |
export LC_IDENTIFICATION="C" |
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
16 |
export LC_ALL="" |
749
7e4843b7efd2
Update tests to use commit -m and default -u
mpm@selenic.com
parents:
608
diff
changeset
|
17 |
export HGEDITOR=true |
7e4843b7efd2
Update tests to use commit -m and default -u
mpm@selenic.com
parents:
608
diff
changeset
|
18 |
export HGMERGE=true |
7e4843b7efd2
Update tests to use commit -m and default -u
mpm@selenic.com
parents:
608
diff
changeset
|
19 |
export HGUSER=test |
488
77c66c4eec0e
[PATCH] Set locale before run-tests does anything
mpm@selenic.com
parents:
473
diff
changeset
|
20 |
|
489 | 21 |
umask 022 |
22 |
||
331 | 23 |
tests=0 |
24 |
failed=0 |
|
25 |
H=$PWD |
|
26 |
||
473
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
27 |
if [ -d /usr/lib64 ]; then |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
28 |
lib=lib64 |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
29 |
else |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
30 |
lib=lib |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
31 |
fi |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
32 |
|
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
33 |
TESTPATH=$PWD/install/bin |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
34 |
export PATH=$TESTPATH:$PATH |
473
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
35 |
export PYTHONPATH=$PWD/install/$lib/python |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
36 |
|
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
37 |
rm -rf install |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
38 |
cd .. |
398 | 39 |
${PYTHON:-python} setup.py install --home=tests/install > tests/install.err |
40 |
if [ $? != 0 ] ; then |
|
41 |
cat tests/install.err |
|
42 |
fi |
|
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
43 |
cd $H |
398 | 44 |
rm install.err |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
45 |
|
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
46 |
function run_one |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
47 |
{ |
399 | 48 |
rm -f $1.err |
382
37249c522770
test suite: fix timezone problems and port collision problem
mpm@selenic.com
parents:
362
diff
changeset
|
49 |
export TZ=GMT |
787 | 50 |
D=`mktemp -d ${TMP-/tmp}/tmp.XXXXXX` |
544
3d4d5f2aba9a
Remove bashisms and use /bin/sh instead of /bin/bash.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
495
diff
changeset
|
51 |
if [ "$D" = "" ] ; then |
331 | 52 |
echo mktemp failed! |
53 |
fi |
|
54 |
||
55 |
cd $D |
|
56 |
fail=0 |
|
608
d2994b5298fb
Add username/merge/editor to .hgrc
Matt Mackall <mpm@selenic.com>
parents:
547
diff
changeset
|
57 |
export HOME=$D |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
58 |
|
399 | 59 |
if ! $H/$1 > .out 2>&1 ; then |
60 |
echo $1 failed with error code $? |
|
331 | 61 |
fail=1 |
62 |
fi |
|
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
63 |
|
399 | 64 |
if [ -s .out -a ! -r $H/$1.out ] ; then |
65 |
echo $1 generated unexpected output: |
|
331 | 66 |
cat .out |
399 | 67 |
cp .out $H/$1.err |
331 | 68 |
fail=1 |
399 | 69 |
elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then |
70 |
echo $1 output changed: |
|
71 |
diff -u $H/$1.out .out && true |
|
72 |
cp .out $H/$1.err |
|
341
c0deea64ce64
run-tests: actually mark changed output as failure
mpm@selenic.com
parents:
331
diff
changeset
|
73 |
fail=1 |
331 | 74 |
fi |
75 |
||
76 |
cd $H |
|
77 |
rm -r $D |
|
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
78 |
return $fail |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
79 |
} |
331 | 80 |
|
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
81 |
TESTS=$@ |
544
3d4d5f2aba9a
Remove bashisms and use /bin/sh instead of /bin/bash.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
495
diff
changeset
|
82 |
if [ "$TESTS" = "" ] ; then |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
83 |
TESTS=`ls test-* | grep -Ev "\.|~"` |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
84 |
fi |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
85 |
|
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
86 |
for f in $TESTS ; do |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
87 |
echo -n "." |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
88 |
if ! run_one $f ; then |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
89 |
failed=$[$failed + 1] |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
90 |
fi |
331 | 91 |
tests=$[$tests + 1] |
92 |
done |
|
93 |
||
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
94 |
rm -rf install |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
95 |
|
331 | 96 |
echo |
97 |
echo Ran $tests tests, $failed failed |
|
98 |
||
99 |
if [ $failed -gt 0 ] ; then |
|
100 |
exit 1 |
|
101 |
fi |
|
102 |