aboutsummaryrefslogtreecommitdiff
path: root/testsuite/testing.sh
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2005-09-23 15:44:46 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2005-09-23 15:44:46 +0000
commitb47a74f4e773dee93c60116dd34c002c7c118d0b (patch)
tree7adcb31fbbb5e204ab577cbe31c2f72cb3b5387f /testsuite/testing.sh
parent0a44c1777134281be6b00c69b8d6b8668ea1dbf9 (diff)
downloadbusybox-w32-b47a74f4e773dee93c60116dd34c002c7c118d0b.tar.gz
busybox-w32-b47a74f4e773dee93c60116dd34c002c7c118d0b.tar.bz2
busybox-w32-b47a74f4e773dee93c60116dd34c002c7c118d0b.zip
- introduce variable _BB_CONFIG_DEP to the new test harness.
This is used to see if given tests should be run (are available) or not. Print "UNTESTED: descr" if the applet or feature is not available. - add _BB_CONFIG_DEP to existing new.tests - move old grep test to new test infrastructure and add a few more test for grep.
Diffstat (limited to 'testsuite/testing.sh')
-rwxr-xr-xtestsuite/testing.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/testsuite/testing.sh b/testsuite/testing.sh
index 0925d090d..420cfa1ef 100755
--- a/testsuite/testing.sh
+++ b/testsuite/testing.sh
@@ -28,9 +28,19 @@ fi
28 28
29export FAILCOUNT=0 29export FAILCOUNT=0
30 30
31# Helper functions
32
33config_is_set ()
34{
35 local uc_what=$(echo ${1?} | tr a-z A-Z)
36 grep -q "^[ ]*CONFIG_${uc_what}" ${bindir:-..}/.config || \
37 grep -q "^[ ]*BB_CONFIG_${uc_what}" ${bindir:-..}/.config
38 return $?
39}
40
31# The testing function 41# The testing function
32 42
33function testing() 43testing()
34{ 44{
35 if [ $# -ne 5 ] 45 if [ $# -ne 5 ]
36 then 46 then
@@ -38,6 +48,15 @@ function testing()
38 exit 48 exit
39 fi 49 fi
40 50
51 if [ ${force_tests:-0} -ne 1 -a -n "$_BB_CONFIG_DEP" ]
52 then
53 if ! config_is_set "$_BB_CONFIG_DEP"
54 then
55 echo "UNTESTED: $1"
56 return 0
57 fi
58 fi
59
41 f=$FAILCOUNT 60 f=$FAILCOUNT
42 echo -ne "$3" > expected 61 echo -ne "$3" > expected
43 echo -ne "$4" > input 62 echo -ne "$4" > input