To not exceed the maximum report size, each test unit must print less than 2.5KB of traces on average. So report tests that hog more than 10 times that.
Signed-off-by: Francois Gouget fgouget@codeweavers.com ---
After applying this patch make sure to update the effective winetest.conf file if a git update did not do so.
The patch can be tested on an existing report using a command like:
dissect --update data/354fa7eb7921c3317e7943c18871febe5570dd52/linux_fg-acer64-t32/report # you might have to specify --workdir ~/sites/winetest
and
winetest.cron ~/sites/winetest
Then look for 'too much data' in the full report.
winetest/dissect | 10 +++++++++- winetest/winetest.conf | 3 +++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/winetest/dissect b/winetest/dissect index 4cb31b0d2..9635f0a30 100755 --- a/winetest/dissect +++ b/winetest/dissect @@ -48,7 +48,7 @@ sub BEGIN } unshift @INC, $1 if ($0 =~ m=^(/.*)/[^/]+$=); } -use vars qw/$workdir $gitdir $gitweb $maxmult $maxuserskips $maxfailedtests $maxfilesize $acceptprediluvianwin/; +use vars qw/$workdir $gitdir $gitweb $maxmult $maxuserskips $maxfailedtests $maxunitsize $maxfilesize $acceptprediluvianwin/; require "winetest.conf";
my $name0=$0; @@ -435,6 +435,7 @@ while ($line = <IN> || "") #
my ($dll, $unit, $source, $rev, $result) = ("", "", ""); +my $unitsize = 0; my ($failures, $todo, $skipped) = (0, 0, 0); my ($s_failures, $s_todo, $s_skipped, $s_total) = (0, 0, 0, 0); my (%pids, $rc, $summary, $broken); @@ -523,6 +524,11 @@ sub close_test_unit($) $todo ||= $s_todo; $skipped ||= $s_skipped;
+ if ($unitsize > $maxunitsize) + { + add_test_line("end", "The test prints too much data ($unitsize bytes)"); + $extra_failures++; + } if (!$broken and defined $rc) { # Check the exit code, particularly against failures reported @@ -563,6 +569,7 @@ sub close_test_unit($) }
$dll = $unit = ""; + $unitsize = 0; $failures = $todo = $skipped = 0; $s_failures = $s_todo = $s_skipped = $s_total = 0; $extra_failures = $broken = 0; @@ -572,6 +579,7 @@ sub close_test_unit($)
$line =~ /^Test output:/ or mydie "no test header: $line"; while ($line = <IN>) { + $unitsize += length($line); next if ($line =~ /^\s*$/); chomp $line; $line =~ s/\r+$//; diff --git a/winetest/winetest.conf b/winetest/winetest.conf index ba1551410..84824a2b3 100644 --- a/winetest/winetest.conf +++ b/winetest/winetest.conf @@ -17,6 +17,9 @@ $maxfailedtests = 50; # Whether to accept test results from Win9x / NT4 versions $acceptprediluvianwin = 0;
+# Maximum amount of traces for a test unit +$maxunitsize = 32 * 1024; + # Maximum size of the report file # This should be in line with programs\winetest\send.c $maxfilesize = 1.5 * 1024 * 1024;