Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Olivier F. R. Dierick
wine
Commits
8f8aa7a3
Commit
8f8aa7a3
authored
13 years ago
by
Frédéric Delanoy
Committed by
Alexandre Julliard
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cmd/tests: Add CALL tests.
parent
c47c62a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
programs/cmd/tests/test_builtins.cmd
+40
-0
40 additions, 0 deletions
programs/cmd/tests/test_builtins.cmd
programs/cmd/tests/test_builtins.cmd.exp
+12
-0
12 additions, 0 deletions
programs/cmd/tests/test_builtins.cmd.exp
with
52 additions
and
0 deletions
programs/cmd/tests/test_builtins.cmd
+
40
−
0
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
...
...
This diff is collapsed.
Click to expand it.
programs/cmd/tests/test_builtins.cmd.exp
+
12
−
0
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment