diff options
Diffstat (limited to 'testsuite/testing.sh')
-rwxr-xr-x | testsuite/testing.sh | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/testsuite/testing.sh b/testsuite/testing.sh index e253e1aa6..7897c1622 100755 --- a/testsuite/testing.sh +++ b/testsuite/testing.sh | |||
@@ -37,7 +37,7 @@ export SKIP= | |||
37 | 37 | ||
38 | # Helper functions | 38 | # Helper functions |
39 | 39 | ||
40 | optional() | 40 | optional () |
41 | { | 41 | { |
42 | option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"` | 42 | option=`echo "$OPTIONFLAGS" | egrep "(^|:)$1(:|\$)"` |
43 | # Not set? | 43 | # Not set? |
@@ -55,6 +55,7 @@ testing () | |||
55 | { | 55 | { |
56 | NAME="$1" | 56 | NAME="$1" |
57 | [ -z "$1" ] && NAME=$2 | 57 | [ -z "$1" ] && NAME=$2 |
58 | ret=0 | ||
58 | 59 | ||
59 | if [ $# -ne 5 ] | 60 | if [ $# -ne 5 ] |
60 | then | 61 | then |
@@ -76,12 +77,15 @@ testing () | |||
76 | echo -ne "$5" | eval "$2" > actual | 77 | echo -ne "$5" | eval "$2" > actual |
77 | RETVAL=$? | 78 | RETVAL=$? |
78 | 79 | ||
79 | cmp expected actual > /dev/null | 80 | cmp expected actual > /dev/null || ret=$? |
80 | if [ $? -ne 0 ] | 81 | if [ $ret -ne 0 ] |
81 | then | 82 | then |
82 | FAILCOUNT=$[$FAILCOUNT+1] | 83 | FAILCOUNT=$[$FAILCOUNT+1] |
83 | echo "FAIL: $NAME" | 84 | echo "FAIL: $NAME" |
84 | [ -n "$VERBOSE" ] && diff -u expected actual | 85 | if [ -n "$VERBOSE" ] |
86 | then | ||
87 | diff -u expected actual || /bin/true | ||
88 | fi | ||
85 | else | 89 | else |
86 | echo "PASS: $NAME" | 90 | echo "PASS: $NAME" |
87 | fi | 91 | fi |
@@ -97,7 +101,7 @@ testing () | |||
97 | # the file is assumed to already be there and only its library dependencies | 101 | # the file is assumed to already be there and only its library dependencies |
98 | # are copied. | 102 | # are copied. |
99 | 103 | ||
100 | function mkchroot | 104 | mkchroot () |
101 | { | 105 | { |
102 | [ $# -lt 2 ] && return | 106 | [ $# -lt 2 ] && return |
103 | 107 | ||
@@ -126,7 +130,7 @@ function mkchroot | |||
126 | # Needed commands listed on command line | 130 | # Needed commands listed on command line |
127 | # Script fed to stdin. | 131 | # Script fed to stdin. |
128 | 132 | ||
129 | function dochroot | 133 | dochroot () |
130 | { | 134 | { |
131 | mkdir tmpdir4chroot | 135 | mkdir tmpdir4chroot |
132 | mount -t ramfs tmpdir4chroot tmpdir4chroot | 136 | mount -t ramfs tmpdir4chroot tmpdir4chroot |