aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2002-01-02 20:37:59 +0000
committerMatt Kraai <kraai@debian.org>2002-01-02 20:37:59 +0000
commit01d2ea908b88a80b2f5d36c23229032dd76d621c (patch)
tree8e4b2e322f2351080898525cf9cf124e9baa8a75
parent39fcb5a7502ffb35a90b9539478c5b0d314c3b8e (diff)
downloadbusybox-w32-01d2ea908b88a80b2f5d36c23229032dd76d621c.tar.gz
busybox-w32-01d2ea908b88a80b2f5d36c23229032dd76d621c.tar.bz2
busybox-w32-01d2ea908b88a80b2f5d36c23229032dd76d621c.zip
* testsuite/README: Document -v option.
* testsuite/runtest: Handle -v option. (show_result): New. (run_applet_testcase): Call it.
-rw-r--r--testsuite/README6
-rwxr-xr-xtestsuite/runtest38
2 files changed, 32 insertions, 12 deletions
diff --git a/testsuite/README b/testsuite/README
index a886b4217..b02dfa49c 100644
--- a/testsuite/README
+++ b/testsuite/README
@@ -1,6 +1,8 @@
1To run the test suite, change to this directory and run 1To run the test suite, change to this directory and run
2"./runtest". To only run the test cases for particular applets, 2"./runtest". It will run all of the test cases, and list those
3specify them as parameters to runtest. 3with unexpected outcomes. Adding the -v option will cause it to
4show expected outcomes as well. To only run the test cases for
5particular applets, specify them as parameters to runtest.
4 6
5The test cases for an applet reside in the subdirectory of the 7The test cases for an applet reside in the subdirectory of the
6applet name. The name of the test case should be the assertion 8applet name. The name of the test case should be the assertion
diff --git a/testsuite/runtest b/testsuite/runtest
index b19be3dd8..2e8d391e0 100755
--- a/testsuite/runtest
+++ b/testsuite/runtest
@@ -2,6 +2,23 @@
2 2
3PATH=$(dirname $(pwd)):$PATH 3PATH=$(dirname $(pwd)):$PATH
4 4
5show_result ()
6{
7 local resolution=$1
8 local testcase=$2
9 local status=0
10
11 if [ $resolution = UPASS -o $resolution = FAIL ]; then
12 status=1
13 fi
14
15 if [ "$verbose" -o $status -eq 1 ]; then
16 echo "$resolution: $testcase"
17 fi
18
19 return $status
20}
21
5run_applet_testcase () 22run_applet_testcase ()
6{ 23{
7 local applet=$1 24 local applet=$1
@@ -15,7 +32,7 @@ run_applet_testcase ()
15 local testname=$(basename $testcase) 32 local testname=$(basename $testcase)
16 33
17 if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then 34 if grep -q "^# CONFIG_${uc_applet} is not set$" ../.config; then
18 echo "UNSUPPORTED: $testname" 35 show_result UNSUPPORTED $testname
19 return 0 36 return 0
20 fi 37 fi
21 38
@@ -23,7 +40,7 @@ run_applet_testcase ()
23 local feature=`sed -ne 's/.*UNSUPPORTED: //p' $testcase` 40 local feature=`sed -ne 's/.*UNSUPPORTED: //p' $testcase`
24 41
25 if grep -q "^# ${feature} is not set$" ../.config; then 42 if grep -q "^# ${feature} is not set$" ../.config; then
26 echo "UNSUPPORTED: $testname" 43 show_result UNSUPPORTED $testname
27 return 0 44 return 0
28 fi 45 fi
29 fi 46 fi
@@ -37,15 +54,11 @@ run_applet_testcase ()
37 pushd tmp >/dev/null 54 pushd tmp >/dev/null
38 55
39 if . ../$testcase >/dev/null 2>&1; then 56 if . ../$testcase >/dev/null 2>&1; then
40 echo "${U}PASS: $testname" 57 show_result ${U}PASS $testname
41 if [ "$U" ]; then 58 status=$!
42 status=1
43 fi
44 else 59 else
45 echo "${X}FAIL: $testname" 60 show_result ${X}FAIL $testname
46 if [ ! "$X" ]; then 61 status=$!
47 status=1
48 fi
49 fi 62 fi
50 63
51 popd >/dev/null 64 popd >/dev/null
@@ -78,6 +91,11 @@ run_applet_tests ()
78 91
79status=0 92status=0
80 93
94if [ x"$1" = x"-v" ]; then
95 verbose=1
96 shift
97fi
98
81if [ $# -ne 0 ]; then 99if [ $# -ne 0 ]; then
82 applets="$@" 100 applets="$@"
83else 101else