Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8f8aa7a3
Commit
8f8aa7a3
authored
Jul 21, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Jul 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/tests: Add CALL tests.
parent
c47c62a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+40
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+12
-0
No files found.
programs/cmd/tests/test_builtins.cmd
View file @
8f8aa7a3
...
...
@@ -361,6 +361,46 @@ if not exist foo (
rd foo
)
echo ------------ Testing CALL --------------
mkdir foobar & cd foobar
rem External script
echo echo foo %%1 > foo.cmd
call foo
call foo.cmd 8
del foo.cmd
rem Internal routines
call :testRoutine :testRoutine
goto :endTestRoutine
:testRoutine
echo bar %1
goto :eof
:endTestRoutine
rem Should work for builtins...
call mkdir foo
echo %ErrorLevel%
if exist foo (echo foo created) else echo foo should exist!
rmdir foo
set FOOBAZ_VAR=foobaz
call echo Should expand %FOOBAZ_VAR%
set FOOBAZ_VAR=
echo>batfile
call dir /b
echo>robinfile
if 1==1 call del batfile
dir /b
if exist batfile echo batfile shouldn't exist
rem ... but not for 'if' or 'for'
call if 1==1 echo bar 2> nul
echo %ErrorLevel%
call :setError 0
call for %%i in (foo bar baz) do echo %%i 2> nul
echo %ErrorLevel%
rem First look for programs in the path before trying a builtin
echo echo non-builtin dir > dir.cmd
call dir /b
cd ..
rd /s/q foobar
echo -----------Testing Errorlevel-----------
rem WARNING: Do *not* add tests using ErrorLevel after this section
should_not_exist 2> nul > nul
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
8f8aa7a3
...
...
@@ -174,6 +174,18 @@ non-empty dir not removed
non-empty dir not removed
recursive rmdir succeeded
recursive rmdir succeeded
------------ Testing CALL --------------
foo
foo 8
bar :testRoutine
@todo_wine@0
@todo_wine@foo created
@todo_wine@Should expand foobaz
@todo_wine@batfile
@todo_wine@robinfile
@todo_wine@1
@todo_wine@1
non-builtin dir
-----------Testing Errorlevel-----------
9009
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment