diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-27 03:33:29 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-27 03:33:29 +0000 |
commit | 92a6f878e9a67b76f33a7245895a5f037ee0c3d8 (patch) | |
tree | ead648cea0875ed97ebb34a8859ee4a49633b8b0 | |
parent | 64d5bfda1af0b8d6fe2c1996b3df15a0fa513679 (diff) | |
download | busybox-w32-92a6f878e9a67b76f33a7245895a5f037ee0c3d8.tar.gz busybox-w32-92a6f878e9a67b76f33a7245895a5f037ee0c3d8.tar.bz2 busybox-w32-92a6f878e9a67b76f33a7245895a5f037ee0c3d8.zip |
runtest: further fixes from Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn AT axis.com>
-rwxr-xr-x | testsuite/runtest | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/testsuite/runtest b/testsuite/runtest index b8b2da8e0..5496395fa 100755 --- a/testsuite/runtest +++ b/testsuite/runtest | |||
@@ -13,10 +13,11 @@ run_applet_testcase() | |||
13 | local testcase="$2" | 13 | local testcase="$2" |
14 | 14 | ||
15 | local status | 15 | local status |
16 | local uc_applet=$(echo $applet | tr a-z A-Z) | 16 | local uc_applet=$(echo "$applet" | tr a-z A-Z) |
17 | local testname=$(basename "$testcase") | 17 | local testname="$testcase" |
18 | 18 | ||
19 | if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then | 19 | testname=${testname##*/} # take basename |
20 | if grep -q "^# CONFIG_$uc_applet is not set$" "$bindir/.config"; then | ||
20 | echo "UNTESTED: $testname" | 21 | echo "UNTESTED: $testname" |
21 | return 0 | 22 | return 0 |
22 | fi | 23 | fi |
@@ -24,7 +25,7 @@ run_applet_testcase() | |||
24 | if grep -q "^# FEATURE: " "$testcase"; then | 25 | if grep -q "^# FEATURE: " "$testcase"; then |
25 | local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase") | 26 | local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase") |
26 | 27 | ||
27 | if grep -q "^# ${feature} is not set$" $bindir/.config; then | 28 | if grep -q "^# $feature is not set$" "$bindir/.config"; then |
28 | echo "UNTESTED: $testname" | 29 | echo "UNTESTED: $testname" |
29 | return 0 | 30 | return 0 |
30 | fi | 31 | fi |
@@ -57,8 +58,10 @@ run_applet_tests() | |||
57 | { | 58 | { |
58 | local applet=$1 | 59 | local applet=$1 |
59 | local status=0 | 60 | local status=0 |
60 | for testcase in $tsdir/$applet/*; do | 61 | |
61 | case $(basename "$testcase") in | 62 | for testcase in "$tsdir/$applet"/*; do |
63 | # switch on basename of $testcase | ||
64 | case "${testcase##*/}" in | ||
62 | \#*) | 65 | \#*) |
63 | continue | 66 | continue |
64 | ;; | 67 | ;; |
@@ -78,8 +81,9 @@ run_applet_tests() | |||
78 | 81 | ||
79 | 82 | ||
80 | 83 | ||
81 | [ -n "$tsdir" ] || tsdir=$(pwd) | 84 | lcwd=$(pwd) |
82 | [ -n "$bindir" ] || bindir=$(dirname $(pwd)) | 85 | [ "$tsdir" ] || tsdir="$lcwd" |
86 | [ "$bindir" ] || bindir="${lcwd%/*}" # one directory up from $lcwd | ||
83 | PATH="$bindir:$PATH" | 87 | PATH="$bindir:$PATH" |
84 | 88 | ||
85 | if [ x"$VERBOSE" = x ]; then | 89 | if [ x"$VERBOSE" = x ]; then |
@@ -92,7 +96,7 @@ if [ x"$1" = x"-v" ]; then | |||
92 | fi | 96 | fi |
93 | 97 | ||
94 | implemented=$( | 98 | implemented=$( |
95 | $bindir/busybox 2>&1 | | 99 | "$bindir/busybox" 2>&1 | |
96 | while read line; do | 100 | while read line; do |
97 | if [ x"$line" = x"Currently defined functions:" ]; then | 101 | if [ x"$line" = x"Currently defined functions:" ]; then |
98 | xargs | sed 's/,//g' | 102 | xargs | sed 's/,//g' |
@@ -112,7 +116,7 @@ LINKSDIR="$bindir/runtest-tempdir-links" | |||
112 | rm -rf "$LINKSDIR" 2>/dev/null | 116 | rm -rf "$LINKSDIR" 2>/dev/null |
113 | mkdir "$LINKSDIR" | 117 | mkdir "$LINKSDIR" |
114 | for i in $implemented; do | 118 | for i in $implemented; do |
115 | ln -s $bindir/busybox "$LINKSDIR"/$i | 119 | ln -s "$bindir/busybox" "$LINKSDIR"/$i |
116 | done | 120 | done |
117 | 121 | ||
118 | # Set up option flags so tests can be selective. | 122 | # Set up option flags so tests can be selective. |