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