testing a single applet; "command" command [was: Re: svn commit: trunk/busybox/testsuite]

Bernhard Fischer rep.dot.nop at gmail.com
Tue Apr 29 16:18:05 UTC 2008


On Tue, Apr 29, 2008 at 07:11:57AM -0700, vda at busybox.net wrote:
>Author: vda
>Date: 2008-04-29 07:11:57 -0700 (Tue, 29 Apr 2008)
>New Revision: 21894
>
>Log:
>runtest: more cleanups
>
>
>
>Modified:
>   trunk/busybox/testsuite/runtest
>
>
>Changeset:
>Modified: trunk/busybox/testsuite/runtest
>===================================================================
>--- trunk/busybox/testsuite/runtest	2008-04-29 12:31:53 UTC (rev 21893)
>+++ trunk/busybox/testsuite/runtest	2008-04-29 14:11:57 UTC (rev 21894)
>@@ -54,7 +54,7 @@
> }
> 
> # Run all old-style tests for given applet
>-run_applet_tests()
>+run_oldstyle_applet_tests()
> {
> 	local applet="$1"
> 	local status=0
>@@ -68,11 +68,13 @@
> 			*\~)
> 				continue
> 				;;
>+			"CVS")
>+				continue
>+				;;
>+			.*)
>+				continue
>+				;;
> 		esac

perhaps it's simpler (and maybe even a tad faster) to say

case "${testcase##*/}" in
\#*|*\~|"CVS"|.*) continue ;;
esac

>@@ -124,13 +126,21 @@
> 
> status=0
> for applet in $applets; do
>-	if [ "$applet" = "links" ]; then
>-		continue
>-	fi
>+	case "$applet" in
>+		"links")
>+			continue
>+			;;
>+		"CVS")
>+			continue
>+			;;
>+		.*)
>+			continue
>+			;;
>+	esac

ditto

>@@ -143,8 +153,8 @@
> 				continue
> 			fi
> 		fi
>-#		echo "Running test ${tsdir:-.}/$applet.tests"
>-		PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/$applet.tests"
>+#		echo "Running test $tsdir/$applet.tests"
>+		PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "$tsdir/$applet.tests"
> 		test $? -eq 0 || status=1

I think that it was possible to invoke one test-series for exactly one
applet by doing:
$ ./runtest test.tests

But this doesn't seem to work anymore?

PS: reading test.tests, perhaps it would make sense to allow for
"command" to prevent using builtins? Just curious..



More information about the busybox mailing list