Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
657cdc18
Commit
657cdc18
authored
Sep 14, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winetest: Report failure for tests that print too much output.
parent
93250eb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
main.c
programs/winetest/main.c
+19
-10
No files found.
programs/winetest/main.c
View file @
657cdc18
...
...
@@ -42,6 +42,9 @@
/* Don't submit the results if more than FAILURES_LIMIT tests have failed */
#define FAILURES_LIMIT 50
/* Maximum output size for individual test */
#define MAX_OUTPUT_SIZE (32 * 1024)
struct
wine_test
{
char
*
name
;
...
...
@@ -871,19 +874,25 @@ run_test (struct wine_test* test, const char* subtest, HANDLE out_file, const ch
char
*
data
,
tmpname
[
MAX_PATH
];
HANDLE
tmpfile
=
create_temp_file
(
tmpname
);
status
=
run_ex
(
cmd
,
tmpfile
,
tempdir
,
120000
,
FALSE
,
&
pid
);
if
(
status
)
{
data
=
flush_temp_file
(
tmpname
,
tmpfile
,
&
size
);
WriteFile
(
out_file
,
data
,
size
,
&
size
,
NULL
);
free
(
data
);
}
else
close_temp_file
(
tmpname
,
tmpfile
);
data
=
flush_temp_file
(
tmpname
,
tmpfile
,
&
size
);
if
(
status
||
size
>
MAX_OUTPUT_SIZE
)
WriteFile
(
out_file
,
data
,
size
,
&
size
,
NULL
);
free
(
data
);
}
else
{
DWORD
start_size
=
GetFileSize
(
out_file
,
NULL
);
status
=
run_ex
(
cmd
,
out_file
,
tempdir
,
120000
,
FALSE
,
&
pid
);
size
=
GetFileSize
(
out_file
,
NULL
)
-
start_size
;
}
else
status
=
run_ex
(
cmd
,
out_file
,
tempdir
,
120000
,
FALSE
,
&
pid
);
if
(
status
==
-
2
)
status
=
-
GetLastError
();
free
(
cmd
);
xprintf
(
"%s:%s:%04x done (%d) in %ds
\n
"
,
test
->
name
,
subtest
,
pid
,
status
,
(
GetTickCount
()
-
start
)
/
1000
);
if
(
status
)
failures
++
;
xprintf
(
"%s:%s:%04x done (%d) in %ds %uB
\n
"
,
test
->
name
,
subtest
,
pid
,
status
,
(
GetTickCount
()
-
start
)
/
1000
,
size
);
if
(
size
>
MAX_OUTPUT_SIZE
)
{
xprintf
(
"%s:%s:%04x The test prints too much data (%u bytes)
\n
"
,
test
->
name
,
subtest
,
pid
,
size
);
failures
++
;
}
else
if
(
status
)
failures
++
;
}
if
(
failures
)
report
(
R_STATUS
,
"Running tests - %u failures"
,
failures
);
}
...
...
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