=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd/tests: Move command line tests to separate file.

Alexandre Julliard julliard at winehq.org
Thu Oct 11 15:25:16 CDT 2012


Module: wine
Branch: master
Commit: 0ab71a42b4a23e5aef74c476eb6c63bf099651a9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0ab71a42b4a23e5aef74c476eb6c63bf099651a9

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Thu Oct 11 03:08:01 2012 +0200

cmd/tests: Move command line tests to separate file.

---

 programs/cmd/tests/rsrc.rc               |    6 ++
 programs/cmd/tests/test_builtins.cmd     |   90 ------------------------------
 programs/cmd/tests/test_builtins.cmd.exp |   48 ----------------
 programs/cmd/tests/test_cmdline.cmd      |   90 ++++++++++++++++++++++++++++++
 programs/cmd/tests/test_cmdline.cmd.exp  |   47 +++++++++++++++
 5 files changed, 143 insertions(+), 138 deletions(-)

diff --git a/programs/cmd/tests/rsrc.rc b/programs/cmd/tests/rsrc.rc
index bcb738d..affe04c 100644
--- a/programs/cmd/tests/rsrc.rc
+++ b/programs/cmd/tests/rsrc.rc
@@ -21,3 +21,9 @@ test_builtins.cmd TESTCMD "test_builtins.cmd"
 
 /* @makedep: test_builtins.cmd.exp */
 test_builtins.cmd.exp TESTOUT "test_builtins.cmd.exp"
+
+/* @makedep: test_cmdline.cmd */
+test_cmdline.cmd TESTCMD "test_cmdline.cmd"
+
+/* @makedep: test_cmdline.cmd.exp */
+test_cmdline.cmd.exp TESTOUT "test_cmdline.cmd.exp"
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index bdd6cd0..8a47238 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1820,96 +1820,6 @@ set var=
 set var2=
 cd .. & rd /q/s foobar
 
-echo ------------ cmd.exe command lines ------------
-mkdir foobar
-cd foobar
-echo file1 > file1
-
-rem Basic test of command line. Note a section prefix per command
-rem to resync, as wine does not output anything in these cases yet.
-echo --- Test 1
-cmd.exe /c echo Line1
-cmd.exe /c echo "Line2"
-echo --- Test 2
-cmd.exe /c echo Test quotes "&" work
-echo --- Test 3
-cmd.exe /c echo "&"
-echo --- Test 4
-cmd.exe /c echo "<"
-echo --- Test 5
-cmd.exe /c echo ">"
-echo --- Test 6
-cmd.exe /c echo "\"
-echo --- Test 7
-cmd.exe /c echo "|"
-echo --- Test 8
-cmd.exe /c echo "`"
-echo --- Test 9
-cmd.exe /c echo """
-echo --- Test 10
-echo on > file3
- at type file3
- at echo off
-echo --- Test 11
-cmd.exe /c echo on >file3
- at type file3
- at echo off
-echo --- Test 12
-cmd.exe /c "echo passed1"
-echo --- Test 13
-cmd.exe /c " echo passed2 "
-echo --- Test 14
-cmd.exe /c "dir /ad ..\fooba* /b"
-echo --- Test 15
-cmd.exe /cecho No whitespace
-echo --- Test 16
-cmd.exe /c
-echo --- Test 17
-cmd.exe /c at space@
-echo --- Test 18
-rem Ensure no interactive prompting when cmd.exe /c or /k
-echo file2 > file2
-cmd.exe /c copy file1 file2 >nul
-echo No prompts or I would not get here1
-rem - Try cmd.exe /k as well
-cmd.exe /k "copy file1 file2 >nul && exit"
-echo No prompts or I would not get here2
-
-rem Non existing variable expansion is as per command line, ie left as-is
-cmd.exe /c echo %%hello1%%
-cmd.exe /c echo %%hello2
-cmd.exe /c echo %%hello3^:h=t%%
-cmd.exe /c echo %%hello4%%%%
-
-rem Cannot issue a call from cmd.exe /c
-cmd.exe /c call :hello5
-
-rem %1-9 has no meaning
-cmd.exe /c echo one = %%1
-
-rem for loop vars need expanding
-cmd.exe /c for /L %%i in (1,1,5) do @echo %%i
-
-rem goto's are ineffective
-cmd.exe /c goto :fred
-cmd.exe /c goto eof
-
-rem - %var% is expanded at read time, not execute time
-set var=11
-cmd.exe /c "set var=22 && setlocal && set var=33 && endlocal && echo var contents: %%var%%"
-
-rem - endlocal ineffective on cmd.exe /c lines
-cmd.exe /c "set var=22 && setlocal && set var=33 && endlocal && set var"
-set var=99
-
-rem - Environment is inherited ok
-cmd.exe /c ECHO %%VAR%%
-
-rem - Exit works
-cmd.exe /c exit
-
-cd ..
-rd foobar /s /q
 echo ------------ Testing Errorlevel ------------
 rem WARNING: Do *not* add tests using ErrorLevel after this section
 should_not_exist 2> nul > nul
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 1d004b7..4bab1ef 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -907,54 +907,6 @@ value1
 2
 1
 1
------------- cmd.exe command lines ------------
---- Test 1
-Line1
-"Line2"
---- Test 2
-Test quotes "&" work
---- Test 3
-"&"
---- Test 4
-"<"
---- Test 5
-">"
---- Test 6
-"\"
---- Test 7
-"|"
---- Test 8
-"`"
---- Test 9
-"""
---- Test 10
---- Test 11
---- Test 12
-passed1
---- Test 13
-passed2 at space@
---- Test 14
-foobar
---- Test 15
-No whitespace
---- Test 16
---- Test 17
---- Test 18
-No prompts or I would not get here1
-No prompts or I would not get here2
-%hello1%
-%hello2
-%hello3:h=t%
-%hello4%%
-one = %1
-1
-2
-3
-4
-5
- at todo_wine@var contents: 11
-var=33 at space@
-99
 ------------ Testing Errorlevel ------------
 9009
 1
diff --git a/programs/cmd/tests/test_cmdline.cmd b/programs/cmd/tests/test_cmdline.cmd
new file mode 100644
index 0000000..ad035ab
--- /dev/null
+++ b/programs/cmd/tests/test_cmdline.cmd
@@ -0,0 +1,90 @@
+ at echo off
+mkdir foobar
+cd foobar
+echo file1 > file1
+
+rem Basic test of command line. Note a section prefix per command
+rem to resync, as wine does not output anything in these cases yet.
+echo --- Test 1
+cmd.exe /c echo Line1
+cmd.exe /c echo "Line2"
+echo --- Test 2
+cmd.exe /c echo Test quotes "&" work
+echo --- Test 3
+cmd.exe /c echo "&"
+echo --- Test 4
+cmd.exe /c echo "<"
+echo --- Test 5
+cmd.exe /c echo ">"
+echo --- Test 6
+cmd.exe /c echo "\"
+echo --- Test 7
+cmd.exe /c echo "|"
+echo --- Test 8
+cmd.exe /c echo "`"
+echo --- Test 9
+cmd.exe /c echo """
+echo --- Test 10
+echo on > file3
+ at type file3
+ at echo off
+echo --- Test 11
+cmd.exe /c echo on >file3
+ at type file3
+ at echo off
+echo --- Test 12
+cmd.exe /c "echo passed1"
+echo --- Test 13
+cmd.exe /c " echo passed2 "
+echo --- Test 14
+cmd.exe /c "dir /ad ..\fooba* /b"
+echo --- Test 15
+cmd.exe /cecho No whitespace
+echo --- Test 16
+cmd.exe /c
+echo --- Test 17
+cmd.exe /c at space@
+echo --- Test 18
+rem Ensure no interactive prompting when cmd.exe /c or /k
+echo file2 > file2
+cmd.exe /c copy file1 file2 >nul
+echo No prompts or I would not get here1
+rem - Try cmd.exe /k as well
+cmd.exe /k "copy file1 file2 >nul && exit"
+echo No prompts or I would not get here2
+
+rem Non existing variable expansion is as per command line, i.e. left as-is
+cmd.exe /c echo %%hello1%%
+cmd.exe /c echo %%hello2
+cmd.exe /c echo %%hello3^:h=t%%
+cmd.exe /c echo %%hello4%%%%
+
+rem Cannot issue a call from cmd.exe /c
+cmd.exe /c call :hello5
+
+rem %1-9 has no meaning
+cmd.exe /c echo one = %%1
+
+rem for loop vars need expanding
+cmd.exe /c for /L %%i in (1,1,5) do @echo %%i
+
+rem goto's are ineffective
+cmd.exe /c goto :fred
+cmd.exe /c goto eof
+
+rem - %var% is expanded at read time, not execute time
+set var=11
+cmd.exe /c "set var=22 && setlocal && set var=33 && endlocal && echo var contents: %%var%%"
+
+rem - endlocal ineffective on cmd.exe /c lines
+cmd.exe /c "set var=22 && setlocal && set var=33 && endlocal && set var"
+set var=99
+
+rem - Environment is inherited ok
+cmd.exe /c ECHO %%VAR%%
+
+rem - Exit works
+cmd.exe /c exit
+
+cd ..
+rd foobar /s /q
diff --git a/programs/cmd/tests/test_cmdline.cmd.exp b/programs/cmd/tests/test_cmdline.cmd.exp
new file mode 100644
index 0000000..36645da
--- /dev/null
+++ b/programs/cmd/tests/test_cmdline.cmd.exp
@@ -0,0 +1,47 @@
+--- Test 1
+Line1
+"Line2"
+--- Test 2
+Test quotes "&" work
+--- Test 3
+"&"
+--- Test 4
+"<"
+--- Test 5
+">"
+--- Test 6
+"\"
+--- Test 7
+"|"
+--- Test 8
+"`"
+--- Test 9
+"""
+--- Test 10
+--- Test 11
+--- Test 12
+passed1
+--- Test 13
+passed2 at space@
+--- Test 14
+foobar
+--- Test 15
+No whitespace
+--- Test 16
+--- Test 17
+--- Test 18
+No prompts or I would not get here1
+No prompts or I would not get here2
+%hello1%
+%hello2
+%hello3:h=t%
+%hello4%%
+one = %1
+1
+2
+3
+4
+5
+ at todo_wine@var contents: 11
+var=33 at space@
+99




More information about the wine-cvs mailing list