runtest: further fixes from Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn AT axis.com>

This commit is contained in:
Denis Vlasenko 2008-04-27 03:33:29 +00:00
parent 64d5bfda1a
commit 92a6f878e9

View File

@ -13,10 +13,11 @@ run_applet_testcase()
local testcase="$2" local testcase="$2"
local status local status
local uc_applet=$(echo $applet | tr a-z A-Z) local uc_applet=$(echo "$applet" | tr a-z A-Z)
local testname=$(basename "$testcase") local testname="$testcase"
if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then testname=${testname##*/} # take basename
if grep -q "^# CONFIG_$uc_applet is not set$" "$bindir/.config"; then
echo "UNTESTED: $testname" echo "UNTESTED: $testname"
return 0 return 0
fi fi
@ -24,7 +25,7 @@ run_applet_testcase()
if grep -q "^# FEATURE: " "$testcase"; then if grep -q "^# FEATURE: " "$testcase"; then
local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase") local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase")
if grep -q "^# ${feature} is not set$" $bindir/.config; then if grep -q "^# $feature is not set$" "$bindir/.config"; then
echo "UNTESTED: $testname" echo "UNTESTED: $testname"
return 0 return 0
fi fi
@ -57,8 +58,10 @@ run_applet_tests()
{ {
local applet=$1 local applet=$1
local status=0 local status=0
for testcase in $tsdir/$applet/*; do
case $(basename "$testcase") in for testcase in "$tsdir/$applet"/*; do
# switch on basename of $testcase
case "${testcase##*/}" in
\#*) \#*)
continue continue
;; ;;
@ -78,8 +81,9 @@ run_applet_tests()
[ -n "$tsdir" ] || tsdir=$(pwd) lcwd=$(pwd)
[ -n "$bindir" ] || bindir=$(dirname $(pwd)) [ "$tsdir" ] || tsdir="$lcwd"
[ "$bindir" ] || bindir="${lcwd%/*}" # one directory up from $lcwd
PATH="$bindir:$PATH" PATH="$bindir:$PATH"
if [ x"$VERBOSE" = x ]; then if [ x"$VERBOSE" = x ]; then
@ -92,7 +96,7 @@ if [ x"$1" = x"-v" ]; then
fi fi
implemented=$( implemented=$(
$bindir/busybox 2>&1 | "$bindir/busybox" 2>&1 |
while read line; do while read line; do
if [ x"$line" = x"Currently defined functions:" ]; then if [ x"$line" = x"Currently defined functions:" ]; then
xargs | sed 's/,//g' xargs | sed 's/,//g'
@ -112,7 +116,7 @@ LINKSDIR="$bindir/runtest-tempdir-links"
rm -rf "$LINKSDIR" 2>/dev/null rm -rf "$LINKSDIR" 2>/dev/null
mkdir "$LINKSDIR" mkdir "$LINKSDIR"
for i in $implemented; do for i in $implemented; do
ln -s $bindir/busybox "$LINKSDIR"/$i ln -s "$bindir/busybox" "$LINKSDIR"/$i
done done
# Set up option flags so tests can be selective. # Set up option flags so tests can be selective.