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
e486a021
Commit
e486a021
authored
15 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
15 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cmd: Added @or_broken@ handling to test templates and use it to fix tests on win2k.
parent
e7615e00
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
programs/cmd/tests/batch.c
+32
-7
32 additions, 7 deletions
programs/cmd/tests/batch.c
programs/cmd/tests/test_builtins.cmd
+1
-0
1 addition, 0 deletions
programs/cmd/tests/test_builtins.cmd
programs/cmd/tests/test_builtins.cmd.exp
+1
-0
1 addition, 0 deletions
programs/cmd/tests/test_builtins.cmd.exp
with
34 additions
and
7 deletions
programs/cmd/tests/batch.c
+
32
−
7
View file @
e486a021
...
...
@@ -101,9 +101,11 @@ static const char *compare_line(const char *out_line, const char *out_end, const
const
char
*
exp_end
)
{
const
char
*
out_ptr
=
out_line
,
*
exp_ptr
=
exp_line
;
const
char
*
err
=
NULL
;
static
const
char
pwd_cmd
[]
=
{
'@'
,
'p'
,
'w'
,
'd'
,
'@'
};
static
const
char
todo_space_cmd
[]
=
{
'@'
,
't'
,
'o'
,
'd'
,
'o'
,
'_'
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
'@'
};
static
const
char
or_broken_cmd
[]
=
{
'@'
,
'o'
,
'r'
,
'_'
,
'b'
,
'r'
,
'o'
,
'k'
,
'e'
,
'n'
,
'@'
};
while
(
exp_ptr
<
exp_end
)
{
if
(
*
exp_ptr
==
'@'
)
{
...
...
@@ -111,11 +113,13 @@ static const char *compare_line(const char *out_line, const char *out_end, const
&&
!
memcmp
(
exp_ptr
,
pwd_cmd
,
sizeof
(
pwd_cmd
)))
{
exp_ptr
+=
sizeof
(
pwd_cmd
);
if
(
out_end
-
out_ptr
<
workdir_len
||
(
CompareStringA
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
out_ptr
,
workdir_len
,
workdir
,
workdir_len
)
!=
CSTR_EQUAL
))
return
out_ptr
;
out_ptr
+=
workdir_len
;
continue
;
||
(
CompareStringA
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
out_ptr
,
workdir_len
,
workdir
,
workdir_len
)
!=
CSTR_EQUAL
))
{
err
=
out_ptr
;
}
else
{
out_ptr
+=
workdir_len
;
continue
;
}
}
else
if
(
exp_ptr
+
sizeof
(
todo_space_cmd
)
<=
exp_end
&&
!
memcmp
(
exp_ptr
,
todo_space_cmd
,
sizeof
(
todo_space_cmd
)))
{
exp_ptr
+=
sizeof
(
todo_space_cmd
);
...
...
@@ -123,10 +127,31 @@ static const char *compare_line(const char *out_line, const char *out_end, const
if
(
out_ptr
<
out_end
&&
*
out_ptr
==
' '
)
out_ptr
++
;
continue
;
}
else
if
(
exp_ptr
+
sizeof
(
or_broken_cmd
)
<=
exp_end
&&
!
memcmp
(
exp_ptr
,
or_broken_cmd
,
sizeof
(
or_broken_cmd
)))
{
exp_ptr
=
exp_end
;
continue
;
}
}
else
if
(
out_ptr
==
out_end
||
*
out_ptr
!=
*
exp_ptr
)
{
err
=
out_ptr
;
}
if
(
out_ptr
==
out_end
||
*
out_ptr
!=
*
exp_ptr
++
)
return
out_ptr
;
if
(
err
)
{
if
(
!
broken
(
1
))
return
err
;
while
(
exp_ptr
+
sizeof
(
or_broken_cmd
)
<=
exp_end
&&
memcmp
(
exp_ptr
,
or_broken_cmd
,
sizeof
(
or_broken_cmd
)))
exp_ptr
++
;
if
(
!
exp_ptr
)
return
err
;
exp_ptr
+=
sizeof
(
or_broken_cmd
);
out_ptr
=
out_line
;
err
=
NULL
;
continue
;
}
exp_ptr
++
;
out_ptr
++
;
}
...
...
This diff is collapsed.
Click to expand it.
programs/cmd/tests/test_builtins.cmd
+
1
−
0
View file @
e486a021
...
...
@@ -23,6 +23,7 @@ cd dummydir
echo
%~dp0
cd ..
rmdir dummydir
echo CD value
%CD%
echo
%%
echo P
%
echo
%P
...
...
This diff is collapsed.
Click to expand it.
programs/cmd/tests/test_builtins.cmd.exp
+
1
−
0
View file @
e486a021
...
...
@@ -16,6 +16,7 @@ bar
~dp0 should be directory containing batch file
@pwd@\
@pwd@\
CD value @pwd@@or_broken@CD value
%
P
P
...
...
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