Show More
@@ -1,46 +1,47 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 | 9 | for f in `ls test-* | grep -Ev "\.|~"` ; do |
|
10 | 10 | echo -n "." |
|
11 | 11 | D=`mktemp -d` |
|
12 | 12 | if [ "$D" == "" ] ; then |
|
13 | 13 | echo mktemp failed! |
|
14 | 14 | fi |
|
15 | 15 | |
|
16 | 16 | cd $D |
|
17 | 17 | fail=0 |
|
18 | 18 | if ! $H/$f > .out 2>&1 ; then |
|
19 | 19 | echo $f failed with error code $? |
|
20 | 20 | fail=1 |
|
21 | 21 | fi |
|
22 | 22 | if [ -s .out -a ! -r $H/$f.out ] ; then |
|
23 | 23 | echo $f generated unexpected output: |
|
24 | 24 | cat .out |
|
25 | 25 | cp .out $H/$f.err |
|
26 | 26 | fail=1 |
|
27 | 27 | elif ! diff -u $H/$f.out .out > /dev/null ; then |
|
28 | 28 | echo $f output changed: |
|
29 | 29 | diff -u $H/$f.out .out && true |
|
30 | 30 | cp .out $H/$f.err |
|
31 | fail=1 | |
|
31 | 32 | fi |
|
32 | 33 | |
|
33 | 34 | cd $H |
|
34 | 35 | rm -r $D |
|
35 | 36 | |
|
36 | 37 | failed=$[$failed + $fail] |
|
37 | 38 | tests=$[$tests + 1] |
|
38 | 39 | done |
|
39 | 40 | |
|
40 | 41 | echo |
|
41 | 42 | echo Ran $tests tests, $failed failed |
|
42 | 43 | |
|
43 | 44 | if [ $failed -gt 0 ] ; then |
|
44 | 45 | exit 1 |
|
45 | 46 | fi |
|
46 | 47 |
General Comments 0
You need to be logged in to leave comments.
Login now