diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2005-09-23 19:44:46 +0400 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2005-09-23 19:44:46 +0400 |
commit | b47a74f4e773dee93c60116dd34c002c7c118d0b (patch) | |
tree | 7adcb31fbbb5e204ab577cbe31c2f72cb3b5387f /testsuite/testing.sh | |
parent | 0a44c1777134281be6b00c69b8d6b8668ea1dbf9 (diff) |
- 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-x | testsuite/testing.sh | 21 |
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 export FAILCOUNT=0 +# Helper functions + +config_is_set () +{ + local uc_what=$(echo ${1?} | tr a-z A-Z) + grep -q "^[ ]*CONFIG_${uc_what}" ${bindir:-..}/.config || \ + grep -q "^[ ]*BB_CONFIG_${uc_what}" ${bindir:-..}/.config + return $? +} + # The testing function -function testing() +testing() { if [ $# -ne 5 ] then @@ -38,6 +48,15 @@ function testing() exit fi + if [ ${force_tests:-0} -ne 1 -a -n "$_BB_CONFIG_DEP" ] + then + if ! config_is_set "$_BB_CONFIG_DEP" + then + echo "UNTESTED: $1" + return 0 + fi + fi + f=$FAILCOUNT echo -ne "$3" > expected echo -ne "$4" > input |