diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-27 13:34:43 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-27 13:34:43 +0000 |
commit | 5d0f4aaa99f09aa7d4efe12cdcb5b76a69ed29aa (patch) | |
tree | 9e8fb9fb945d8107a6514d39abb48972933e77fc /testsuite | |
parent | 92a6f878e9a67b76f33a7245895a5f037ee0c3d8 (diff) | |
download | busybox-w32-5d0f4aaa99f09aa7d4efe12cdcb5b76a69ed29aa.tar.gz busybox-w32-5d0f4aaa99f09aa7d4efe12cdcb5b76a69ed29aa.tar.bz2 busybox-w32-5d0f4aaa99f09aa7d4efe12cdcb5b76a69ed29aa.zip |
runtest: even more fixes from Cristian
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/runtest | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/testsuite/runtest b/testsuite/runtest index 5496395fa..34f0de2b3 100755 --- a/testsuite/runtest +++ b/testsuite/runtest | |||
@@ -16,16 +16,16 @@ run_applet_testcase() | |||
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="$testcase" | 17 | local testname="$testcase" |
18 | 18 | ||
19 | testname=${testname##*/} # take basename | 19 | testname="${testname##*/}" # take basename |
20 | if grep -q "^# CONFIG_$uc_applet is not set$" "$bindir/.config"; then | 20 | if grep "^# CONFIG_$uc_applet is not set$" "$bindir/.config" >/dev/null; then |
21 | echo "UNTESTED: $testname" | 21 | echo "UNTESTED: $testname" |
22 | return 0 | 22 | return 0 |
23 | fi | 23 | fi |
24 | 24 | ||
25 | if grep -q "^# FEATURE: " "$testcase"; then | 25 | if grep "^# FEATURE: " "$testcase" >/dev/null; then |
26 | local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase") | 26 | local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase") |
27 | 27 | ||
28 | if grep -q "^# $feature is not set$" "$bindir/.config"; then | 28 | if grep "^# $feature is not set$" "$bindir/.config" >/dev/null; then |
29 | echo "UNTESTED: $testname" | 29 | echo "UNTESTED: $testname" |
30 | return 0 | 30 | return 0 |
31 | fi | 31 | fi |
@@ -56,7 +56,7 @@ run_applet_testcase() | |||
56 | # Run all old-style tests for given applet | 56 | # Run all old-style tests for given applet |
57 | run_applet_tests() | 57 | run_applet_tests() |
58 | { | 58 | { |
59 | local applet=$1 | 59 | local applet="$1" |
60 | local status=0 | 60 | local status=0 |
61 | 61 | ||
62 | for testcase in "$tsdir/$applet"/*; do | 62 | for testcase in "$tsdir/$applet"/*; do |
@@ -82,8 +82,8 @@ run_applet_tests() | |||
82 | 82 | ||
83 | 83 | ||
84 | lcwd=$(pwd) | 84 | lcwd=$(pwd) |
85 | [ "$tsdir" ] || tsdir="$lcwd" | 85 | [ x"$tsdir" = x ] || tsdir="$lcwd" |
86 | [ "$bindir" ] || bindir="${lcwd%/*}" # one directory up from $lcwd | 86 | [ x"$bindir" = x ] || bindir="${lcwd%/*}" # one directory up from $lcwd |
87 | PATH="$bindir:$PATH" | 87 | PATH="$bindir:$PATH" |
88 | 88 | ||
89 | if [ x"$VERBOSE" = x ]; then | 89 | if [ x"$VERBOSE" = x ]; then |
@@ -116,15 +116,17 @@ LINKSDIR="$bindir/runtest-tempdir-links" | |||
116 | rm -rf "$LINKSDIR" 2>/dev/null | 116 | rm -rf "$LINKSDIR" 2>/dev/null |
117 | mkdir "$LINKSDIR" | 117 | mkdir "$LINKSDIR" |
118 | for i in $implemented; do | 118 | for i in $implemented; do |
119 | ln -s "$bindir/busybox" "$LINKSDIR"/$i | 119 | ln -s "$bindir/busybox" "$LINKSDIR/$i" |
120 | done | 120 | done |
121 | 121 | ||
122 | # Set up option flags so tests can be selective. | 122 | # Set up option flags so tests can be selective. |
123 | export OPTIONFLAGS=:$(sed -nr 's/^CONFIG_//p' $bindir/.config | sed 's/=.*//' | xargs | sed 's/ /:/g') | 123 | export OPTIONFLAGS=:$(sed -nr 's/^CONFIG_//p' "$bindir/.config" | sed 's/=.*//' | xargs | sed 's/ /:/g') |
124 | 124 | ||
125 | status=0 | 125 | status=0 |
126 | for applet in $applets; do | 126 | for applet in $applets; do |
127 | if [ "$applet" = "links" ]; then continue; fi | 127 | if [ "$applet" = "links" ]; then |
128 | continue | ||
129 | fi | ||
128 | 130 | ||
129 | # Any old-style tests for this applet? | 131 | # Any old-style tests for this applet? |
130 | if [ "$applet" != "CVS" -a -d "$tsdir/$applet" ]; then | 132 | if [ "$applet" != "CVS" -a -d "$tsdir/$applet" ]; then |
@@ -133,7 +135,7 @@ for applet in $applets; do | |||
133 | fi | 135 | fi |
134 | 136 | ||
135 | # Is this a new-style test? | 137 | # Is this a new-style test? |
136 | if [ -f "${applet}.tests" ]; then | 138 | if [ -f "$applet.tests" ]; then |
137 | if [ ! -h "$LINKSDIR/$applet" ]; then | 139 | if [ ! -h "$LINKSDIR/$applet" ]; then |
138 | # (avoiding bash'ism "${applet:0:4}") | 140 | # (avoiding bash'ism "${applet:0:4}") |
139 | if ! echo "$applet" | grep "^all_" >/dev/null; then | 141 | if ! echo "$applet" | grep "^all_" >/dev/null; then |
@@ -141,8 +143,8 @@ for applet in $applets; do | |||
141 | continue | 143 | continue |
142 | fi | 144 | fi |
143 | fi | 145 | fi |
144 | # echo "Running test ${tsdir:-.}/${applet}.tests" | 146 | # echo "Running test ${tsdir:-.}/$applet.tests" |
145 | PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/${applet}.tests" | 147 | PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/$applet.tests" |
146 | test $? -eq 0 || status=1 | 148 | test $? -eq 0 || status=1 |
147 | fi | 149 | fi |
148 | done | 150 | done |