Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Plan
Wiki
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
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
Lois Gomez
wine
Commits
977c44c9
Commit
977c44c9
authored
3 months ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
winetest: Filter out color escapes for junit output.
parent
0b4d2cd2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
programs/winetest/main.c
+22
-3
22 additions, 3 deletions
programs/winetest/main.c
with
22 additions
and
3 deletions
programs/winetest/main.c
+
22
−
3
View file @
977c44c9
...
...
@@ -902,6 +902,24 @@ static void report_test_start( struct wine_test *test, const char *subtest, cons
xprintf
(
"%s:%s start %s
\n
"
,
test
->
name
,
subtest
,
file
);
}
/* filter out color escapes and null characters from test output data */
static
void
*
filter_data
(
const
char
*
data
,
DWORD
size
)
{
DWORD
i
,
j
;
char
*
ret
=
malloc
(
size
+
1
);
for
(
i
=
j
=
0
;
i
<
size
;
i
++
)
{
if
(
data
[
i
]
==
'\x1b'
&&
data
[
i
+
1
]
==
'['
)
{
while
(
data
[
i
]
&&
data
[
i
]
!=
'm'
)
i
++
;
}
else
if
(
data
[
i
])
ret
[
j
++
]
=
data
[
i
];
}
ret
[
j
]
=
0
;
return
ret
;
}
static
void
report_test_done
(
struct
wine_test
*
test
,
const
char
*
subtest
,
const
char
*
file
,
DWORD
pid
,
DWORD
ticks
,
HANDLE
out_file
,
UINT
status
,
const
char
*
data
,
DWORD
size
)
{
...
...
@@ -914,8 +932,9 @@ static void report_test_done( struct wine_test *test, const char *subtest, const
int
total
=
0
,
fail_total
=
0
,
skip_total
=
0
,
failures
=
0
;
const
char
*
next
,
*
line
,
*
ptr
,
*
dir
=
strrchr
(
file
,
'/'
);
float
time
,
last_time
=
0
;
char
*
filtered_data
=
filter_data
(
data
,
size
);
for
(
line
=
next
=
data
;
*
line
;
line
=
next
)
for
(
line
=
next
=
filtered_
data
;
*
line
;
line
=
next
)
{
int
count
,
todo_count
,
flaky_count
,
fail_count
,
skip_count
;
...
...
@@ -935,7 +954,7 @@ static void report_test_done( struct wine_test *test, const char *subtest, const
output
(
junit
,
" <testsuite name=
\"
%s:%s
\"
file=
\"
%s
\"
time=
\"
%f
\"
tests=
\"
%d
\"
failures=
\"
%d
\"
skipped=
\"
%d
\"
>
\n
"
,
test
->
name
,
subtest
,
file
,
ticks
/
1000
.
0
,
total
,
fail_total
,
skip_total
);
for
(
line
=
next
=
data
;
*
line
;
line
=
next
)
for
(
line
=
next
=
filtered_
data
;
*
line
;
line
=
next
)
{
struct
{
const
char
*
pattern
;
int
length
;
int
error
;
}
patterns
[]
=
{
...
...
@@ -1009,6 +1028,7 @@ static void report_test_done( struct wine_test *test, const char *subtest, const
}
output
(
junit
,
" </testsuite>
\n
"
);
free
(
filtered_data
);
}
}
...
...
@@ -1673,7 +1693,6 @@ int __cdecl main( int argc, char *argv[] )
}
if
(
junit
)
{
SetEnvironmentVariableA
(
"WINETEST_COLOR"
,
"0"
);
SetEnvironmentVariableA
(
"WINETEST_TIME"
,
"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