Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: mozilla-tests/post-process-logs.pl

Issue 2865028: Update the mozilla tests to new version (as of 2010-06-29). (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « mozilla-tests/performance-1.9.2.tests ('k') | mozilla-tests/process-logs.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 # -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*- 2 # -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*-
3 # ***** BEGIN LICENSE BLOCK ***** 3 # ***** BEGIN LICENSE BLOCK *****
4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1 4 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 # 5 #
6 # The contents of this file are subject to the Mozilla Public License Version 6 # The contents of this file are subject to the Mozilla Public License Version
7 # 1.1 (the "License"); you may not use this file except in compliance with 7 # 1.1 (the "License"); you may not use this file except in compliance with
8 # the License. You may obtain a copy of the License at 8 # the License. You may obtain a copy of the License at
9 # http://www.mozilla.org/MPL/ 9 # http://www.mozilla.org/MPL/
10 # 10 #
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 local ($test_id, 63 local ($test_id,
64 $tmp_test_id, 64 $tmp_test_id,
65 $tmp_test_exit_status, 65 $tmp_test_exit_status,
66 %test_id, 66 %test_id,
67 %test_reported, 67 %test_reported,
68 $test_result, 68 $test_result,
69 $test_type, 69 $test_type,
70 $tmp_test_type, 70 $tmp_test_type,
71 $test_description, 71 $test_description,
72 $test_jsoptions,
72 @messages, 73 @messages,
73 $test_processortype, 74 $test_processortype,
74 $test_kernel, 75 $test_kernel,
75 $test_suite, 76 $test_suite,
76 $test_exit_status, 77 $test_exit_status,
77 @expected_exit_code_list, 78 @expected_exit_code_list,
78 $expected_exit_code, 79 $expected_exit_code,
79 $exit_code, 80 $exit_code,
80 $state); 81 $state);
81 82
82 local $test_memory = 0; 83 local $test_memory = 0;
83 local $test_cpuspeed = 0;
84 local %test_reported = (); 84 local %test_reported = ();
85 local $test_repo = 'CVS'; 85 local $test_repo = 'CVS';
86 86
87 $test_jsoptions = 'none';
88
87 while ($file = shift @ARGV) 89 while ($file = shift @ARGV)
88 { 90 {
89 @messages = (); 91 @messages = ();
90 92
91 dbg "file: $file"; 93 dbg "file: $file";
92 94
93 my $filename = basename $file; 95 my $filename = basename $file;
94 96
95 dbg "filename: $file"; 97 dbg "filename: $file";
96 98
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 $_ =~ s/[\r]$//; 135 $_ =~ s/[\r]$//;
134 $_ =~ s/[\r]/CR/g; 136 $_ =~ s/[\r]/CR/g;
135 $_ =~ s/[\x01-\x08]//g; 137 $_ =~ s/[\x01-\x08]//g;
136 $_ =~ s/\s+$//; 138 $_ =~ s/\s+$//;
137 139
138 if ($debug) 140 if ($debug)
139 { 141 {
140 dbg "\nINPUT: $_"; 142 dbg "\nINPUT: $_";
141 } 143 }
142 144
143 last if ( $_ =~ /^arguments:/); 145 last if ( $_ =~ /^include:/);
144 146
145 if (($envval) = $_ =~ /^environment: TEST_MOZILLA_HG=http:\/\/hg.mozilla .org\/(.*)/ ) 147 if (($envval) = $_ =~ /^environment: TEST_MOZILLA_HG=http:\/\/hg.mozilla .org.*\/([^\/]+)/ )
146 { 148 {
147 $test_repo = $envval; 149 $test_repo = $envval;
148 } 150 }
149 elsif (($envvar, $envval) = $_ =~ /^environment: (TEST_[A-Z0-9_]*)=(.*)/ ) 151 elsif (($envvar, $envval) = $_ =~ /^environment: (TEST_[A-Z0-9_]*)=(.*)/ )
150 { 152 {
151 dbg "envvar=$envvar, envval=$envval"; 153 dbg "envvar=$envvar, envval=$envval";
152 if ($envvar =~ /TEST_KERNEL/) 154 if ($envvar =~ /TEST_KERNEL/)
153 { 155 {
154 $envval =~ s/([0-9]+)\.([0-9]+)\.([0-9]+).*/$1.$2.$3/; 156 $envval =~ s/([0-9]+)\.([0-9]+)\.([0-9]+).*/$1.$2.$3/;
155 dbg "found TEST_KERNEL"; 157 dbg "found TEST_KERNEL";
156 } 158 }
157 $envvar =~ tr/A-Z/a-z/; 159 $envvar =~ tr/A-Z/a-z/;
158 $$envvar = $envval; 160 $$envvar = $envval;
159 dbg $envvar . "=" . $$envvar; 161 dbg $envvar . "=" . $$envvar;
160 } 162 }
161 elsif (($envval) = $_ =~ /^environment: OSID=(.*)/ ) 163 elsif (($envval) = $_ =~ /^environment: OSID=(.*)/ )
162 { 164 {
163 $test_os = $envval; 165 $test_os = $envval;
164 } 166 }
165 }
166 167
167 if ($test_cpuspeed < 4) 168 if ($_ =~ /^arguments: javascriptoptions/)
168 { 169 {
169 $test_cpuspeed = 'slow'; 170 my ($o, @s, $j);
170 } 171
171 elsif ($test_cpuspeed < 9) 172 ($o) = $_ =~ /^arguments: javascriptoptions=(.*)/;
172 { 173 $o =~ s/(-\w) (\w)/$1$2/g;
173 $test_cpuspeed = 'medium'; 174 @s = sort split / /, $o;
174 } 175 $j = join(" ", @s);
175 else 176 $j =~ s/(-\w)(\w)/$1 $2/g;
176 { 177
177 $test_cpuspeed = 'fast'; 178 $test_jsoptions = $j || "none";
179 dbg "javascriptoptions: $test_jsoptions";
180 }
178 } 181 }
179 182
180 if ($test_product eq "js") 183 if ($test_product eq "js")
181 { 184 {
182 $test_type = "shell"; 185 $test_type = "shell";
183 } 186 }
184 elsif ($test_product eq "firefox" || $test_product eq "thunderbird") 187 elsif ($test_product eq "firefox" || $test_product eq "thunderbird" ||
188 $test_product eq "fennec")
185 { 189 {
186 $test_buildtype = "nightly" unless $test_buildtype; 190 $test_buildtype = "nightly" unless $test_buildtype;
187 $test_type = "browser"; 191 $test_type = "browser";
188 } 192 }
189 193
190 # Expected sequence if all output written to the log. 194 # Expected sequence if all output written to the log.
191 # 195 #
192 # Input 196 # Input
193 # ----------------------------- 197 # -----------------------------
194 # JavaScriptTest: Begin Run 198 # JavaScriptTest: Begin Run
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 elsif ($_ && 473 elsif ($_ &&
470 !/^\s+$/ && 474 !/^\s+$/ &&
471 !/^(STATUS:| *PASSED!| *FAILED!)/ && 475 !/^(STATUS:| *PASSED!| *FAILED!)/ &&
472 !/^JavaScriptTest:/ && 476 !/^JavaScriptTest:/ &&
473 !/^[*][*][*]/ && 477 !/^[*][*][*]/ &&
474 !/^[-+]{2,2}(WEBSHELL|DOMWINDOW)/ && 478 !/^[-+]{2,2}(WEBSHELL|DOMWINDOW)/ &&
475 !/^Spider:/ && 479 !/^Spider:/ &&
476 !/real.*user.*sys.*$/ && 480 !/real.*user.*sys.*$/ &&
477 !/user.*system.*elapsed/) 481 !/user.*system.*elapsed/)
478 { 482 {
479 if ('runningtest, reportingtest' =~ /$state/) 483 if ('runningtest, reportingtest' =~ /$state/ && $#messages < 1000)
480 { 484 {
481 485 # limit the number of processed and collected messages since fir efox can
486 # go berserk and dump a couple of million output lines for a sin gle test
487 # if things go horribly wrong.
482 if (/error: can.t allocate region/ || /set a breakpoint in mallo c_error_break/ || 488 if (/error: can.t allocate region/ || /set a breakpoint in mallo c_error_break/ ||
483 /set a breakpoint in szone_error to debug/ || /malloc:.*mmap / || /vm_allocate/ || 489 /set a breakpoint in szone_error to debug/ || /malloc:.*mmap / || /vm_allocate/ ||
484 /terminate called after throwing an instance of .*bad_alloc/ ) 490 /terminate called after throwing an instance of .*bad_alloc/ )
485 { 491 {
486 dbg "Adding message: $_ converted to /$test_id{$state}:0: ou t of memory"; 492 dbg "Adding message: $_ converted to /$test_id{$state}:0: ou t of memory";
487 push @messages, ('/' . $test_id{$state} . ':0: out of memory '); 493 push @messages, ('/' . $test_id{$state} . ':0: out of memory ');
488 } 494 }
489 elsif (/\.js, line [0-9]+: out of memory/ ) 495 elsif (/\.js, line [0-9]+: out of memory/ )
490 { 496 {
491 s/\.js, line ([0-9]+): out of memory/\.js:$1:/; 497 s/\.js, line ([0-9]+): out of memory/\.js:$1:/;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 if ($debug) 547 if ($debug)
542 { 548 {
543 my $msg = shift; 549 my $msg = shift;
544 print STDERR "DEBUG: $msg\n"; 550 print STDERR "DEBUG: $msg\n";
545 } 551 }
546 } 552 }
547 553
548 sub outresults 554 sub outresults
549 { 555 {
550 dbg "sorting temp file $temp"; 556 dbg "sorting temp file $temp";
551 system("sort < $temp | uniq"); 557 system("sort -u < $temp");
552 dbg "finished sorting"; 558 dbg "finished sorting";
553 } 559 }
554 560
555 sub outputrecord 561 sub outputrecord
556 { 562 {
557 my ($test_id, $test_description, $test_result) = @_; 563 my ($test_id, $test_description, $test_result) = @_;
558 564
559 # cut off the extra jstest: summaries as they duplicate the other 565 # cut off the extra jstest: summaries as they duplicate the other
560 # output and follow it. 566 # output and follow it.
561 $test_description =~ s/jstest:.*//; 567 $test_description =~ s/jstest:.*//;
562 568
563 # if (length($test_description) > 6000) 569 # if (length($test_description) > 6000)
564 # { 570 # {
565 # $test_description = substr($test_description, 0, 6000); 571 # $test_description = substr($test_description, 0, 6000);
566 # } 572 # }
567 # 573 #
568 574
569 my $output = 575 my $output =
570 "TEST_ID=$test_id, " . 576 "TEST_ID=$test_id, " .
571 "TEST_BRANCH=$test_branchid, " . 577 "TEST_BRANCH=$test_branchid, " .
572 "TEST_REPO=$test_repo, " . 578 "TEST_REPO=$test_repo, " .
573 "TEST_BUILDTYPE=$test_buildtype, " . 579 "TEST_BUILDTYPE=$test_buildtype, " .
574 "TEST_TYPE=$test_type, " . 580 "TEST_TYPE=$test_type, " .
575 "TEST_OS=$test_os, " . 581 "TEST_OS=$test_os, " .
576 "TEST_KERNEL=$test_kernel, " . 582 "TEST_KERNEL=$test_kernel, " .
577 "TEST_PROCESSORTYPE=$test_processortype, " . 583 "TEST_PROCESSORTYPE=$test_processortype, " .
578 "TEST_MEMORY=$test_memory, " . 584 "TEST_MEMORY=$test_memory, " .
579 "TEST_CPUSPEED=$test_cpuspeed, " .
580 "TEST_TIMEZONE=$test_timezone, " . 585 "TEST_TIMEZONE=$test_timezone, " .
586 "TEST_OPTIONS=$test_jsoptions, " .
581 "TEST_RESULT=$test_result, " . 587 "TEST_RESULT=$test_result, " .
582 "TEST_EXITSTATUS=$test_exit_status, " . 588 "TEST_EXITSTATUS=$test_exit_status, " .
583 "TEST_DESCRIPTION=$test_description, " . 589 "TEST_DESCRIPTION=$test_description, " .
584 "TEST_MACHINE=$test_machine, " . 590 "TEST_MACHINE=$test_machine, " .
585 "TEST_DATE=$test_date" . 591 "TEST_DATE=$test_date" .
586 "\n"; 592 "\n";
587 593
588 if ($debug) 594 if ($debug)
589 { 595 {
590 dbg "RECORD: $output"; 596 dbg "RECORD: $output";
591 } 597 }
592 print TEMP $output; 598 print TEMP $output;
593 599
594 $test_reported{$test_id} = 1; 600 $test_reported{$test_id} = 1;
595 @messages = (); 601 @messages = ();
596 } 602 }
OLDNEW
« no previous file with comments | « mozilla-tests/performance-1.9.2.tests ('k') | mozilla-tests/process-logs.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698