##// END OF EJS Templates
run-tests: actually mark changed output as failure...
mpm@selenic.com -
r341:c0deea64 default
parent child Browse files
Show More
@@ -1,46 +1,47 b''
1 #!/bin/bash
1 #!/bin/bash
2
2
3 set -e
3 set -e
4
4
5 tests=0
5 tests=0
6 failed=0
6 failed=0
7 H=$PWD
7 H=$PWD
8
8
9 for f in `ls test-* | grep -Ev "\.|~"` ; do
9 for f in `ls test-* | grep -Ev "\.|~"` ; do
10 echo -n "."
10 echo -n "."
11 D=`mktemp -d`
11 D=`mktemp -d`
12 if [ "$D" == "" ] ; then
12 if [ "$D" == "" ] ; then
13 echo mktemp failed!
13 echo mktemp failed!
14 fi
14 fi
15
15
16 cd $D
16 cd $D
17 fail=0
17 fail=0
18 if ! $H/$f > .out 2>&1 ; then
18 if ! $H/$f > .out 2>&1 ; then
19 echo $f failed with error code $?
19 echo $f failed with error code $?
20 fail=1
20 fail=1
21 fi
21 fi
22 if [ -s .out -a ! -r $H/$f.out ] ; then
22 if [ -s .out -a ! -r $H/$f.out ] ; then
23 echo $f generated unexpected output:
23 echo $f generated unexpected output:
24 cat .out
24 cat .out
25 cp .out $H/$f.err
25 cp .out $H/$f.err
26 fail=1
26 fail=1
27 elif ! diff -u $H/$f.out .out > /dev/null ; then
27 elif ! diff -u $H/$f.out .out > /dev/null ; then
28 echo $f output changed:
28 echo $f output changed:
29 diff -u $H/$f.out .out && true
29 diff -u $H/$f.out .out && true
30 cp .out $H/$f.err
30 cp .out $H/$f.err
31 fail=1
31 fi
32 fi
32
33
33 cd $H
34 cd $H
34 rm -r $D
35 rm -r $D
35
36
36 failed=$[$failed + $fail]
37 failed=$[$failed + $fail]
37 tests=$[$tests + 1]
38 tests=$[$tests + 1]
38 done
39 done
39
40
40 echo
41 echo
41 echo Ran $tests tests, $failed failed
42 echo Ran $tests tests, $failed failed
42
43
43 if [ $failed -gt 0 ] ; then
44 if [ $failed -gt 0 ] ; then
44 exit 1
45 exit 1
45 fi
46 fi
46
47
General Comments 0
You need to be logged in to leave comments. Login now