aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2010-08-29 04:47:03 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-08-29 04:47:03 +0200
commit140ac91fe154c9a1bb33cba38380c3cc81e1cf15 (patch)
tree99cd795e3a239c626d832f7137d25cf776164a86
parent91234b9be04a90f08ee4506955983338f9d3a29e (diff)
downloadbusybox-w32-140ac91fe154c9a1bb33cba38380c3cc81e1cf15.tar.gz
busybox-w32-140ac91fe154c9a1bb33cba38380c3cc81e1cf15.tar.bz2
busybox-w32-140ac91fe154c9a1bb33cba38380c3cc81e1cf15.zip
testsuite: show the number of failures after a test run
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xtestsuite/bunzip2.tests6
-rwxr-xr-xtestsuite/bzcat.tests5
-rwxr-xr-xtestsuite/readlink.tests2
-rwxr-xr-xtestsuite/runtest10
4 files changed, 21 insertions, 2 deletions
diff --git a/testsuite/bunzip2.tests b/testsuite/bunzip2.tests
index 734acbb75..827aee867 100755
--- a/testsuite/bunzip2.tests
+++ b/testsuite/bunzip2.tests
@@ -1,6 +1,8 @@
1#!/bin/sh 1#!/bin/sh
2# Used by both gunzip and bunzip2 tests 2# Used by both gunzip and bunzip2 tests
3 3
4FAILCOUNT=0
5
4if test "${0##*/}" = "gunzip.tests"; then 6if test "${0##*/}" = "gunzip.tests"; then
5 unpack=gunzip 7 unpack=gunzip
6 ext=gz 8 ext=gz
@@ -473,6 +475,7 @@ check() {
473 echo "PASS: $1" 475 echo "PASS: $1"
474 else 476 else
475 echo "FAIL: $1" 477 echo "FAIL: $1"
478 FAILCOUNT=$((FAILCOUNT + 1))
476 fi 479 fi
477} 480}
478 481
@@ -520,5 +523,8 @@ if test "${0##*/}" = "bunzip2.tests"; then
520 echo "PASS: $unpack: test bz2 file" 523 echo "PASS: $unpack: test bz2 file"
521 else 524 else
522 echo "FAIL: $unpack: test bz2 file" 525 echo "FAIL: $unpack: test bz2 file"
526 FAILCOUNT=$((FAILCOUNT + 1))
523 fi 527 fi
524fi 528fi
529
530exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))
diff --git a/testsuite/bzcat.tests b/testsuite/bzcat.tests
index 78d74f229..5b4f3f4b3 100755
--- a/testsuite/bzcat.tests
+++ b/testsuite/bzcat.tests
@@ -1,5 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2 2
3FAILCOUNT=0
4
3ext=bz2 5ext=bz2
4 6
5bb="busybox " 7bb="busybox "
@@ -35,6 +37,7 @@ check() {
35 echo "PASS: $1" 37 echo "PASS: $1"
36 else 38 else
37 echo "FAIL: $1" 39 echo "FAIL: $1"
40 FAILCOUNT=$((FAILCOUNT + 1))
38 fi 41 fi
39} 42}
40 43
@@ -47,3 +50,5 @@ prep; check "bzcat: dont delete src" "${bb}bzcat t2.bz2; test -f t2.bz2 && echo
47 50
48) 51)
49rm -rf testdir 52rm -rf testdir
53
54exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))
diff --git a/testsuite/readlink.tests b/testsuite/readlink.tests
index 73163b077..c7fc8adf0 100755
--- a/testsuite/readlink.tests
+++ b/testsuite/readlink.tests
@@ -29,3 +29,5 @@ testing "readlink -f on a wierd dir" "readlink -f $TESTDIR/../$TESTFILE" "$PWD/$
29 29
30# clean up 30# clean up
31rm -r "$TESTLINK" "$TESTDIR" 31rm -r "$TESTLINK" "$TESTDIR"
32
33exit $((FAILCOUNT <= 255 ? FAILCOUNT : 255))
diff --git a/testsuite/runtest b/testsuite/runtest
index c300233cd..9a4fccbbf 100755
--- a/testsuite/runtest
+++ b/testsuite/runtest
@@ -4,6 +4,8 @@
4 4
5. ./testing.sh 5. ./testing.sh
6 6
7total_failed=0
8
7# Run one old-style test. 9# Run one old-style test.
8# Tests are stored in applet/testcase shell scripts. 10# Tests are stored in applet/testcase shell scripts.
9# They are run using "sh -x -e applet/testcase". 11# They are run using "sh -x -e applet/testcase".
@@ -73,6 +75,7 @@ run_oldstyle_applet_tests()
73 *.r[0-9]*) continue ;; # svn-produced junk 75 *.r[0-9]*) continue ;; # svn-produced junk
74 esac 76 esac
75 run_applet_testcase "$applet" "$testcase" || status=1 77 run_applet_testcase "$applet" "$testcase" || status=1
78 total_failed=$((total_failed + status))
76 done 79 done
77 return $status 80 return $status
78} 81}
@@ -150,7 +153,10 @@ for applet in $applets; do
150 fi 153 fi
151# echo "Running test $tsdir/$applet.tests" 154# echo "Running test $tsdir/$applet.tests"
152 PATH="$LINKSDIR:$tsdir:$bindir:$PATH" \ 155 PATH="$LINKSDIR:$tsdir:$bindir:$PATH" \
153 "$tsdir/$applet.tests" || status=1 156 "$tsdir/$applet.tests"
157 rc=$?
158 total_failed=$((total_failed + rc))
159 test $rc -ne 0 && status=1
154 fi 160 fi
155done 161done
156 162
@@ -158,6 +164,6 @@ done
158#rm -rf "$LINKSDIR" 164#rm -rf "$LINKSDIR"
159 165
160if [ $status -ne 0 ] && [ x"$VERBOSE" = x ]; then 166if [ $status -ne 0 ] && [ x"$VERBOSE" = x ]; then
161 echo "Failures detected, running with -v (verbose) will give more info" 167 echo "$total_failed failure(s) detected; running with -v (verbose) will give more info"
162fi 168fi
163exit $status 169exit $status