mirror of
https://github.com/sheumann/hush.git
synced 2025-01-03 00:31:16 +00:00
stop using bash'isms ('function')
runtest: do not depend on busybox.links
This commit is contained in:
parent
629563b5d7
commit
018e085d44
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
debug=false
|
debug=false
|
||||||
|
|
||||||
function try {
|
try() {
|
||||||
added="$1"
|
added="$1"
|
||||||
shift
|
shift
|
||||||
$debug && echo "Trying: $* $added"
|
$debug && echo "Trying: $* $added"
|
||||||
|
@ -6,7 +6,7 @@ PATH=$bindir:$PATH
|
|||||||
|
|
||||||
# Run old-style test.
|
# Run old-style test.
|
||||||
|
|
||||||
function run_applet_testcase
|
run_applet_testcase()
|
||||||
{
|
{
|
||||||
local applet=$1
|
local applet=$1
|
||||||
local testcase=$2
|
local testcase=$2
|
||||||
@ -55,7 +55,7 @@ function run_applet_testcase
|
|||||||
return $status
|
return $status
|
||||||
}
|
}
|
||||||
|
|
||||||
run_applet_tests ()
|
run_applet_tests()
|
||||||
{
|
{
|
||||||
local applet=$1
|
local applet=$1
|
||||||
|
|
||||||
@ -94,10 +94,20 @@ fi
|
|||||||
|
|
||||||
# Populate a directory with links to all busybox applets
|
# Populate a directory with links to all busybox applets
|
||||||
|
|
||||||
LINKSDIR="${bindir}/runtest-tempdir-links"
|
LINKSDIR="$bindir/runtest-tempdir-links"
|
||||||
|
implemented=$($bindir/busybox 2>&1 |
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
if test x"$line" = x"Currently defined functions:"
|
||||||
|
then
|
||||||
|
xargs | sed 's/,//g'
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
)
|
||||||
rm -rf "$LINKSDIR" 2>/dev/null
|
rm -rf "$LINKSDIR" 2>/dev/null
|
||||||
mkdir "$LINKSDIR"
|
mkdir "$LINKSDIR"
|
||||||
for i in $(sed 's@/[a-z0-9/\[]*/@@' $bindir/busybox.links 2>/dev/null)
|
for i in $implemented
|
||||||
do
|
do
|
||||||
ln -s $bindir/busybox "$LINKSDIR"/$i
|
ln -s $bindir/busybox "$LINKSDIR"/$i
|
||||||
done
|
done
|
||||||
@ -127,11 +137,11 @@ for applet in $applets; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if PATH="$LINKSDIR":$srcdir:$bindir:$PATH \
|
if PATH="$LINKSDIR":$srcdir:$bindir:$PATH \
|
||||||
"${srcdir:-.}/$applet".tests
|
"${srcdir:-.}/$applet".tests
|
||||||
then
|
then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
status=1
|
status=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user