aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-02-25 00:40:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-02-25 00:40:37 +0000
commit018e085d44206305f1d20e0111236f96f8d78c80 (patch)
tree148484a341996d5f6fb12e336505624aafc5bcf6
parent629563b5d7baee9a2008cd102924be6d55321bb7 (diff)
downloadbusybox-w32-018e085d44206305f1d20e0111236f96f8d78c80.tar.gz
busybox-w32-018e085d44206305f1d20e0111236f96f8d78c80.tar.bz2
busybox-w32-018e085d44206305f1d20e0111236f96f8d78c80.zip
stop using bash'isms ('function')
runtest: do not depend on busybox.links
-rwxr-xr-xscripts/trylink2
-rwxr-xr-xtestsuite/runtest24
2 files changed, 18 insertions, 8 deletions
diff --git a/scripts/trylink b/scripts/trylink
index dfe282db5..3ac249c73 100755
--- a/scripts/trylink
+++ b/scripts/trylink
@@ -2,7 +2,7 @@
2 2
3debug=false 3debug=false
4 4
5function try { 5try() {
6 added="$1" 6 added="$1"
7 shift 7 shift
8 $debug && echo "Trying: $* $added" 8 $debug && echo "Trying: $* $added"
diff --git a/testsuite/runtest b/testsuite/runtest
index 84cd6a7f3..279f51fbd 100755
--- a/testsuite/runtest
+++ b/testsuite/runtest
@@ -6,7 +6,7 @@ PATH=$bindir:$PATH
6 6
7# Run old-style test. 7# Run old-style test.
8 8
9function run_applet_testcase 9run_applet_testcase()
10{ 10{
11 local applet=$1 11 local applet=$1
12 local testcase=$2 12 local testcase=$2
@@ -55,7 +55,7 @@ function run_applet_testcase
55 return $status 55 return $status
56} 56}
57 57
58run_applet_tests () 58run_applet_tests()
59{ 59{
60 local applet=$1 60 local applet=$1
61 61
@@ -94,10 +94,20 @@ fi
94 94
95# Populate a directory with links to all busybox applets 95# Populate a directory with links to all busybox applets
96 96
97LINKSDIR="${bindir}/runtest-tempdir-links" 97LINKSDIR="$bindir/runtest-tempdir-links"
98implemented=$($bindir/busybox 2>&1 |
99 while read line
100 do
101 if test x"$line" = x"Currently defined functions:"
102 then
103 xargs | sed 's/,//g'
104 break
105 fi
106 done
107 )
98rm -rf "$LINKSDIR" 2>/dev/null 108rm -rf "$LINKSDIR" 2>/dev/null
99mkdir "$LINKSDIR" 109mkdir "$LINKSDIR"
100for i in $(sed 's@/[a-z0-9/\[]*/@@' $bindir/busybox.links 2>/dev/null) 110for i in $implemented
101do 111do
102 ln -s $bindir/busybox "$LINKSDIR"/$i 112 ln -s $bindir/busybox "$LINKSDIR"/$i
103done 113done
@@ -127,11 +137,11 @@ for applet in $applets; do
127 continue 137 continue
128 fi 138 fi
129 if PATH="$LINKSDIR":$srcdir:$bindir:$PATH \ 139 if PATH="$LINKSDIR":$srcdir:$bindir:$PATH \
130 "${srcdir:-.}/$applet".tests 140 "${srcdir:-.}/$applet".tests
131 then 141 then
132 : 142 :
133 else 143 else
134 status=1 144 status=1
135 fi 145 fi
136 fi 146 fi
137 147