svn commit: trunk/busybox/testsuite

vda at busybox.net vda at busybox.net
Sun Apr 27 03:33:29 UTC 2008


Author: vda
Date: 2008-04-26 20:33:29 -0700 (Sat, 26 Apr 2008)
New Revision: 21874

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



Modified:
   trunk/busybox/testsuite/runtest


Changeset:
Modified: trunk/busybox/testsuite/runtest
===================================================================
--- trunk/busybox/testsuite/runtest	2008-04-26 10:14:25 UTC (rev 21873)
+++ trunk/busybox/testsuite/runtest	2008-04-27 03:33:29 UTC (rev 21874)
@@ -13,10 +13,11 @@
 	local testcase="$2"
 
 	local status
-	local uc_applet=$(echo $applet | tr a-z A-Z)
-	local testname=$(basename "$testcase")
+	local uc_applet=$(echo "$applet" | tr a-z A-Z)
+	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"
 		return 0
 	fi
@@ -24,7 +25,7 @@
 	if grep -q "^# FEATURE: " "$testcase"; then
 		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"
 			return 0
 		fi
@@ -57,8 +58,10 @@
 {
 	local applet=$1
 	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
 				;;
@@ -78,8 +81,9 @@
 
 
 
-[ -n "$tsdir" ] || tsdir=$(pwd)
-[ -n "$bindir" ] || bindir=$(dirname $(pwd))
+lcwd=$(pwd)
+[ "$tsdir" ] || tsdir="$lcwd"
+[ "$bindir" ] || bindir="${lcwd%/*}" # one directory up from $lcwd
 PATH="$bindir:$PATH"
 
 if [ x"$VERBOSE" = x ]; then
@@ -92,7 +96,7 @@
 fi
 
 implemented=$(
-	$bindir/busybox 2>&1 |
+	"$bindir/busybox" 2>&1 |
 	while read line; do
 		if [ x"$line" = x"Currently defined functions:" ]; then
 			xargs | sed 's/,//g'
@@ -112,7 +116,7 @@
 rm -rf "$LINKSDIR" 2>/dev/null
 mkdir "$LINKSDIR"
 for i in $implemented; do
-	ln -s $bindir/busybox "$LINKSDIR"/$i
+	ln -s "$bindir/busybox" "$LINKSDIR"/$i
 done
 
 # Set up option flags so tests can be selective.




More information about the busybox-cvs mailing list