Mercurial > hg
annotate tests/run-tests @ 473:5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[PATCH] Get run-tests working on 64-bit machines.
From: Bryan O'Sullivan <bos@serpentine.com>
manifest hash: 3704997be1744478414cddcd79c7bea5ccd6a1b1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCvfdvywK+sNU5EO8RAm5iAJ9mWxI4o2j7IM7Mko7IjfKfNtWJqwCcDekn
6GDlcDo/Q3nv8ybFzykwQjY=
=tS2i
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Sat, 25 Jun 2005 16:31:43 -0800 |
parents | 688d03d6997a |
children | 77c66c4eec0e e94cebc60d96 |
rev | line source |
---|---|
331 | 1 #!/bin/bash |
2 | |
3 set -e | |
4 | |
5 tests=0 | |
6 failed=0 | |
7 H=$PWD | |
8 | |
473
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
9 if [ -d /usr/lib64 ]; then |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
10 lib=lib64 |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
11 else |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
12 lib=lib |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
13 fi |
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
14 |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
15 TESTPATH=$PWD/install/bin |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
16 export PATH=$TESTPATH:$PATH |
473
5914e27dc717
[PATCH] Get run-tests working on 64-bit machines.
mpm@selenic.com
parents:
429
diff
changeset
|
17 export PYTHONPATH=$PWD/install/$lib/python |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
18 |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
19 rm -rf install |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
20 cd .. |
398 | 21 ${PYTHON:-python} setup.py install --home=tests/install > tests/install.err |
22 if [ $? != 0 ] ; then | |
23 cat tests/install.err | |
24 fi | |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
25 cd $H |
398 | 26 rm install.err |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
27 |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
28 function run_one |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
29 { |
399 | 30 rm -f $1.err |
382
37249c522770
test suite: fix timezone problems and port collision problem
mpm@selenic.com
parents:
362
diff
changeset
|
31 export TZ=GMT |
331 | 32 D=`mktemp -d` |
33 if [ "$D" == "" ] ; then | |
34 echo mktemp failed! | |
35 fi | |
36 | |
37 cd $D | |
38 fail=0 | |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
39 |
399 | 40 if ! $H/$1 > .out 2>&1 ; then |
41 echo $1 failed with error code $? | |
331 | 42 fail=1 |
43 fi | |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
44 |
399 | 45 if [ -s .out -a ! -r $H/$1.out ] ; then |
46 echo $1 generated unexpected output: | |
331 | 47 cat .out |
399 | 48 cp .out $H/$1.err |
331 | 49 fail=1 |
399 | 50 elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then |
51 echo $1 output changed: | |
52 diff -u $H/$1.out .out && true | |
53 cp .out $H/$1.err | |
341
c0deea64ce64
run-tests: actually mark changed output as failure
mpm@selenic.com
parents:
331
diff
changeset
|
54 fail=1 |
331 | 55 fi |
56 | |
57 cd $H | |
58 rm -r $D | |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
59 return $fail |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
60 } |
331 | 61 |
362
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
62 TESTS=$@ |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
63 if [ "$TESTS" == "" ] ; then |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
64 TESTS=`ls test-* | grep -Ev "\.|~"` |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
65 fi |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
66 |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
67 for f in $TESTS ; do |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
68 echo -n "." |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
69 if ! run_one $f ; then |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
70 failed=$[$failed + 1] |
410373162036
run-tests: run tests given on the command line
mpm@selenic.com
parents:
350
diff
changeset
|
71 fi |
331 | 72 tests=$[$tests + 1] |
73 done | |
74 | |
397
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
75 rm -rf install |
e5683db23ec4
From: Andrew Thompson <andrewkt@aktzero.com>
mpm@selenic.com
parents:
382
diff
changeset
|
76 |
331 | 77 echo |
78 echo Ran $tests tests, $failed failed | |
79 | |
80 if [ $failed -gt 0 ] ; then | |
81 exit 1 | |
82 fi | |
83 |