svn commit: trunk/busybox/shell: hush_test msh_test msh_test/msh-bugs msh etc...

vda at busybox.net vda at busybox.net
Sun Mar 2 19:57:53 UTC 2008


Author: vda
Date: 2008-03-02 11:57:53 -0800 (Sun, 02 Mar 2008)
New Revision: 21157

Log:
msh: create testsuite (based on hush one)
hush: add TODO (doesn't know ":" command)



Added:
   trunk/busybox/shell/hush_test/zbad
   trunk/busybox/shell/msh_test/msh-bugs/
   trunk/busybox/shell/msh_test/msh-bugs/noeol3.right
   trunk/busybox/shell/msh_test/msh-bugs/noeol3.tests
   trunk/busybox/shell/msh_test/msh-bugs/process_subst.right
   trunk/busybox/shell/msh_test/msh-bugs/process_subst.tests
   trunk/busybox/shell/msh_test/msh-bugs/read.right
   trunk/busybox/shell/msh_test/msh-bugs/read.tests
   trunk/busybox/shell/msh_test/msh-bugs/shift.right
   trunk/busybox/shell/msh_test/msh-bugs/shift.tests
   trunk/busybox/shell/msh_test/msh-bugs/starquoted.right
   trunk/busybox/shell/msh_test/msh-bugs/starquoted.tests
   trunk/busybox/shell/msh_test/msh-bugs/syntax_err.right
   trunk/busybox/shell/msh_test/msh-bugs/syntax_err.tests
   trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.right
   trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.tests
   trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.right
   trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.tests
   trunk/busybox/shell/msh_test/msh-execution/
   trunk/busybox/shell/msh_test/msh-execution/nested_break.right
   trunk/busybox/shell/msh_test/msh-execution/nested_break.tests
   trunk/busybox/shell/msh_test/msh-misc/
   trunk/busybox/shell/msh_test/msh-misc/tick.right
   trunk/busybox/shell/msh_test/msh-misc/tick.tests
   trunk/busybox/shell/msh_test/msh-parsing/
   trunk/busybox/shell/msh_test/msh-parsing/argv0.right
   trunk/busybox/shell/msh_test/msh-parsing/argv0.tests
   trunk/busybox/shell/msh_test/msh-parsing/noeol.right
   trunk/busybox/shell/msh_test/msh-parsing/noeol.tests
   trunk/busybox/shell/msh_test/msh-parsing/noeol2.right
   trunk/busybox/shell/msh_test/msh-parsing/noeol2.tests
   trunk/busybox/shell/msh_test/msh-parsing/quote1.right
   trunk/busybox/shell/msh_test/msh-parsing/quote1.tests
   trunk/busybox/shell/msh_test/msh-parsing/quote2.right
   trunk/busybox/shell/msh_test/msh-parsing/quote2.tests
   trunk/busybox/shell/msh_test/msh-parsing/quote3.right
   trunk/busybox/shell/msh_test/msh-parsing/quote3.tests
   trunk/busybox/shell/msh_test/msh-parsing/quote4.right
   trunk/busybox/shell/msh_test/msh-parsing/quote4.tests
   trunk/busybox/shell/msh_test/msh-vars/
   trunk/busybox/shell/msh_test/msh-vars/star.right
   trunk/busybox/shell/msh_test/msh-vars/star.tests
   trunk/busybox/shell/msh_test/msh-vars/var.right
   trunk/busybox/shell/msh_test/msh-vars/var.tests
   trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.right
   trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests
   trunk/busybox/shell/msh_test/run-all

Removed:
   trunk/busybox/shell/msh_test/TODO_bug846


Changeset:
Added: trunk/busybox/shell/hush_test/zbad
===================================================================
--- trunk/busybox/shell/hush_test/zbad	                        (rev 0)
+++ trunk/busybox/shell/hush_test/zbad	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,3 @@
+# TODO: hush doesn't know ':' null command
+
+while :; do exit; done

Deleted: trunk/busybox/shell/msh_test/TODO_bug846
===================================================================
--- trunk/busybox/shell/msh_test/TODO_bug846	2008-03-02 18:56:23 UTC (rev 21156)
+++ trunk/busybox/shell/msh_test/TODO_bug846	2008-03-02 19:57:53 UTC (rev 21157)
@@ -1,29 +0,0 @@
-#!/bin/sh
-# For future msh testsuite:
-# Testcase for http://bugs.busybox.net/view.php?id=846
-
-n=0
-while :
-do
-        echo A
-        while :
-        do
-    		echo B
-                break
-        done
-        echo iteration
-        [ $n = 1 ] && break
-	echo C
-        n=`expr $n + 1`
-done
-echo D
-
-# output should be:
-# A
-# B
-# iteration
-# C
-# A
-# B
-# iteration
-# D

Added: trunk/busybox/shell/msh_test/msh-bugs/noeol3.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/noeol3.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/noeol3.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+hush: syntax error: unterminated "

Added: trunk/busybox/shell/msh_test/msh-bugs/noeol3.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/noeol3.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/noeol3.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+# last line has no EOL!
+echo "unterminated
\ No newline at end of file


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/noeol3.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/process_subst.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/process_subst.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/process_subst.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,3 @@
+TESTzzBEST
+TEST$(echo zz)BEST
+TEST'BEST

Added: trunk/busybox/shell/msh_test/msh-bugs/process_subst.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/process_subst.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/process_subst.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,3 @@
+echo "TEST`echo zz;echo;echo`BEST"
+echo "TEST`echo '$(echo zz)'`BEST"
+echo "TEST`echo "'"`BEST"


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/process_subst.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/read.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/read.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/read.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,4 @@
+read
+cat
+echo "REPLY=$REPLY"
+REPLY=exec <read.tests

Added: trunk/busybox/shell/msh_test/msh-bugs/read.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/read.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/read.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,4 @@
+exec <read.tests
+read
+cat
+echo "REPLY=$REPLY"


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/read.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/shift.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/shift.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/shift.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,6 @@
+./shift.tests abc d e
+./shift.tests d e 123
+./shift.tests d e 123
+./shift.tests
+./shift.tests
+./shift.tests

Added: trunk/busybox/shell/msh_test/msh-bugs/shift.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/shift.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/shift.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,14 @@
+if test $# = 0; then
+    exec "$THIS_SH" $0 abc "d e" 123
+fi
+echo $0 $1 $2
+shift
+echo $0 $1 $2
+shift 999
+echo $0 $1 $2
+shift 2
+echo $0 $1 $2
+shift 2
+echo $0 $1 $2
+shift
+echo $0 $1 $2


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/shift.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/starquoted.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/starquoted.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/starquoted.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,8 @@
+.1 abc d e f.
+.1.
+.abc.
+.d e f.
+.-1 abc d e f-.
+.-1.
+.abc.
+.d e f-.

Added: trunk/busybox/shell/msh_test/msh-bugs/starquoted.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/starquoted.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/starquoted.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,8 @@
+if test $# = 0; then
+    exec "$THIS_SH" "$0" 1 abc 'd e f'
+fi
+
+for a in "$*"; do echo ".$a."; done
+for a in "$@"; do echo ".$a."; done
+for a in "-$*-"; do echo ".$a."; done
+for a in "-$@-"; do echo ".$a."; done


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/starquoted.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/syntax_err.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/syntax_err.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/syntax_err.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+shown
+hush: syntax error: unterminated '

Added: trunk/busybox/shell/msh_test/msh-bugs/syntax_err.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/syntax_err.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/syntax_err.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,3 @@
+echo shown
+echo test `echo 'aa`
+echo not shown


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/syntax_err.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,5 @@
+. .
+.abc d e.
+.abc d e.
+.abc d e.
+.abc d e.

Added: trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,15 @@
+if test $# = 0; then
+    exec "$THIS_SH" "$0" abc "d e"
+fi
+
+space=' '
+echo .$space.
+
+a=$*
+echo .$a.
+a=$@
+echo .$a.
+a="$*"
+echo .$a.
+a="$@"
+echo .$a.


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_assign.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,3 @@
+TEST1
+TEST2
+TEST3

Added: trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,13 @@
+if test $# = 0; then
+    exec "$THIS_SH" "$0" abc "d e"
+fi
+
+echo TEST1 >"$1.out"
+echo TEST2 >"$2.out"
+# bash says: "$@.out": ambiguous redirect
+# ash handles it as if it is '$*' - we do the same
+echo TEST3 >"$@.out"
+
+cat abc.out "d e.out" "abc d e.out"
+
+rm abc.out "d e.out" "abc d e.out"


Property changes on: trunk/busybox/shell/msh_test/msh-bugs/var_expand_in_redir.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-execution/nested_break.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-execution/nested_break.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-execution/nested_break.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,8 @@
+A
+B
+iteration
+C
+A
+B
+iteration
+D

Added: trunk/busybox/shell/msh_test/msh-execution/nested_break.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-execution/nested_break.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-execution/nested_break.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,17 @@
+# Testcase for http://bugs.busybox.net/view.php?id=846
+
+n=0
+while :
+do
+        echo A
+        while :
+        do
+    		echo B
+                break
+        done
+        echo iteration
+        [ $n = 1 ] && break
+	echo C
+        n=`expr $n + 1`
+done
+echo D


Property changes on: trunk/busybox/shell/msh_test/msh-execution/nested_break.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-misc/tick.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-misc/tick.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-misc/tick.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+1
+1

Added: trunk/busybox/shell/msh_test/msh-misc/tick.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-misc/tick.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-misc/tick.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,4 @@
+true
+false; echo `echo $?`
+true
+{ false; echo `echo $?`; }


Property changes on: trunk/busybox/shell/msh_test/msh-misc/tick.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/argv0.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/argv0.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/argv0.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+OK

Added: trunk/busybox/shell/msh_test/msh-parsing/argv0.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/argv0.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/argv0.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,4 @@
+if test $# = 0; then
+    exec "$THIS_SH" "$0" arg
+fi
+echo OK


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/argv0.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/noeol.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/noeol.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/noeol.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+HELLO

Added: trunk/busybox/shell/msh_test/msh-parsing/noeol.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/noeol.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/noeol.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+# next line has no EOL!
+echo HELLO
\ No newline at end of file


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/noeol.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/noeol2.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/noeol2.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/noeol2.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+1

Added: trunk/busybox/shell/msh_test/msh-parsing/noeol2.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/noeol2.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/noeol2.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,7 @@
+# last line has no EOL!
+if true
+then
+  echo 1
+else
+  echo 2
+fi
\ No newline at end of file


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/noeol2.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/quote1.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote1.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote1.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+'1'

Added: trunk/busybox/shell/msh_test/msh-parsing/quote1.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote1.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote1.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+a=1
+echo "'$a'"


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/quote1.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/quote2.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote2.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote2.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+>1

Added: trunk/busybox/shell/msh_test/msh-parsing/quote2.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote2.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote2.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+a=1
+echo ">$a"


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/quote2.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/quote3.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote3.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote3.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,3 @@
+Testing: in $empty""
+..
+Finished

Added: trunk/busybox/shell/msh_test/msh-parsing/quote3.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote3.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote3.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,8 @@
+if test $# = 0; then
+    exec "$THIS_SH" quote3.tests abc "d e"
+fi
+
+echo 'Testing: in $empty""'
+empty=''
+for a in $empty""; do echo ".$a."; done
+echo Finished


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/quote3.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-parsing/quote4.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote4.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote4.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1 @@
+a b

Added: trunk/busybox/shell/msh_test/msh-parsing/quote4.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-parsing/quote4.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-parsing/quote4.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,2 @@
+a_b='a b'
+echo "$a_b"


Property changes on: trunk/busybox/shell/msh_test/msh-parsing/quote4.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-vars/star.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-vars/star.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-vars/star.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,6 @@
+.1.
+.abc.
+.d.
+.e.
+.f.
+.1 abc d e f.

Added: trunk/busybox/shell/msh_test/msh-vars/star.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-vars/star.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-vars/star.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,8 @@
+if test $# = 0; then
+    exec "$THIS_SH" star.tests 1 abc 'd e f'
+fi
+# 'd e f' should be split into 3 separate args:
+for a in $*; do echo ".$a."; done
+
+# must produce .1 abc d e f.
+for a in "$*"; do echo ".$a."; done


Property changes on: trunk/busybox/shell/msh_test/msh-vars/star.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-vars/var.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-vars/var.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-vars/var.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,4 @@
+http://busybox.net
+http://busybox.net_abc
+1
+1

Added: trunk/busybox/shell/msh_test/msh-vars/var.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-vars/var.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-vars/var.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,9 @@
+URL=http://busybox.net
+
+echo $URL
+echo ${URL}_abc
+
+true
+false; echo $?
+true
+{ false; echo $?; }


Property changes on: trunk/busybox/shell/msh_test/msh-vars/var.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.right
===================================================================
--- trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.right	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.right	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,40 @@
+Testing: in x y z
+.x.
+.y.
+.z.
+Testing: in u $empty v
+.u.
+.v.
+Testing: in u " $empty" v
+.u.
+. .
+.v.
+Testing: in u $empty $empty$a v
+.u.
+.a.
+.v.
+Testing: in $a_b
+.a.
+.b.
+Testing: in $*
+.abc.
+.d.
+.e.
+Testing: in $@
+.abc.
+.d.
+.e.
+Testing: in -$*-
+.-abc.
+.d.
+.e-.
+Testing: in -$@-
+.-abc.
+.d.
+.e-.
+Testing: in $a_b -$a_b-
+.a.
+.b.
+.-a.
+.b-.
+Finished

Added: trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests
===================================================================
--- trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests	                        (rev 0)
+++ trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,40 @@
+if test $# = 0; then
+    exec "$THIS_SH" var_subst_in_for.tests abc "d e"
+fi
+
+echo 'Testing: in x y z'
+for a in x y z; do echo ".$a."; done
+
+echo 'Testing: in u $empty v'
+empty=''
+for a in u $empty v; do echo ".$a."; done
+
+echo 'Testing: in u " $empty" v'
+empty=''
+for a in u " $empty" v; do echo ".$a."; done
+
+echo 'Testing: in u $empty $empty$a v'
+a='a'
+for a in u $empty $empty$a v; do echo ".$a."; done
+
+echo 'Testing: in $a_b'
+a_b='a b'
+for a in $a_b; do echo ".$a."; done
+
+echo 'Testing: in $*'
+for a in $*; do echo ".$a."; done
+
+echo 'Testing: in $@'
+for a in $@; do echo ".$a."; done
+
+echo 'Testing: in -$*-'
+for a in -$*-; do echo ".$a."; done
+
+echo 'Testing: in -$@-'
+for a in -$@-; do echo ".$a."; done
+
+echo 'Testing: in $a_b -$a_b-'
+a_b='a b'
+for a in $a_b -$a_b-; do echo ".$a."; done
+
+echo Finished


Property changes on: trunk/busybox/shell/msh_test/msh-vars/var_subst_in_for.tests
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/busybox/shell/msh_test/run-all
===================================================================
--- trunk/busybox/shell/msh_test/run-all	                        (rev 0)
+++ trunk/busybox/shell/msh_test/run-all	2008-03-02 19:57:53 UTC (rev 21157)
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+test -x msh || {
+    echo "No ./msh?! Perhaps you want to run 'ln -s ../../busybox msh'"
+    exit
+}
+
+PATH="$PWD:$PATH" # for msh
+export PATH
+
+THIS_SH="$PWD/msh"
+export THIS_SH
+
+do_test()
+{
+    test -d "$1" || return 0
+#   echo Running tests in directory "$1"
+    (
+    cd "$1" || { echo "cannot cd $1!"; exit 1; }
+    for x in run-*; do
+	test -f "$x" || continue
+	case "$x" in
+	    "$0"|run-minimal|run-gprof) ;;
+	    *.orig|*~) ;;
+	    #*) echo $x ; sh $x ;;
+	    *)
+	    sh "$x" >"../$1-$x.fail" 2>&1 && \
+	    { echo "$1/$x: ok"; rm "../$1-$x.fail"; } || echo "$1/$x: fail";
+	    ;;
+	esac
+    done
+    # Many bash run-XXX scripts just do this,
+    # no point in duplication it all over the place
+    for x in *.tests; do
+	test -x "$x" || continue
+	name="${x%%.tests}"
+	test -f "$name.right" || continue
+#	echo Running test: "$name.right"
+	{
+	    "$THIS_SH" "./$x" >"$name.xx" 2>&1
+	    diff -u "$name.xx" "$name.right" >"../$1-$x.fail" && rm -f "$name.xx" "../$1-$x.fail"
+	} && echo "$1/$x: ok" || echo "$1/$x: fail"
+    done
+    )
+}
+
+# Main part of this script
+# Usage: run-all [directories]
+
+if [ $# -lt 1 ]; then
+    # All sub directories
+    modules=`ls -d msh-*`
+
+    for module in $modules; do
+	do_test $module
+    done
+else
+    while [ $# -ge 1 ]; do
+	if [ -d $1 ]; then
+	    do_test $1
+	fi
+	shift
+    done
+fi


Property changes on: trunk/busybox/shell/msh_test/run-all
___________________________________________________________________
Name: svn:executable
   + *




More information about the busybox-cvs mailing list