Changeset 90461 in webkit
- Timestamp:
- Jul 6, 2011 8:44:02 AM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90459 r90461 1 2011-07-06 Adam Roben <aroben@apple.com> 2 3 Make run-api-tests output intelligible on the bots 4 5 run-api-tests's output on the bots was very hard to read for two reasons: 6 1) It was mixing its own output with gtest's 7 2) It was using ANSI escape sequences to print colored text, but the bots don't support 8 that 9 10 Now, the --verbose flag turns off almost all of run-api-tests's own output so that gtest's 11 output will not be obscured. We still print "Timeout" messages even in verbose mode, since 12 gtest doesn't have any native support for timeouts. Also, when our output is being 13 redirected to a file, we don't print ANSI escape sequences. 14 15 Fixes <http://webkit.org/b/63996> It's very hard to read run-api-tests output on the bots 16 17 Reviewed by Sam Weinig. 18 19 * Scripts/run-api-tests: Don't use the :constants interface of Term::ANSIColor. We want to 20 use the colored function instead. 21 (runAllTestsInSuite): Don't print out suite names in verbose mode; gtest will give us enough 22 context that they aren't needed. 23 (runTest): Don't print out test names or pass/fail messages in verbose mode; gtest will do 24 that for us. Also, use the new possiblyColored function instead of always coloring output. 25 (possiblyColored): Added. When printing to a tty, returns the string with the appropriate 26 ANSI color escape sequences added. Otherwise just returns the string unmodified. 27 1 28 2011-07-06 Xan Lopez <xlopez@igalia.com> 2 29 -
trunk/Tools/Scripts/run-api-tests
r90408 r90461 37 37 use lib $FindBin::Bin; 38 38 use webkitdirs; 39 use Term::ANSIColor qw( :constants);39 use Term::ANSIColor qw(colored); 40 40 41 41 sub buildTestTool(); … … 45 45 sub runAllTestsInSuite($); 46 46 sub runTest($$); 47 sub possiblyColored($$); 47 48 sub prepareEnvironmentForRunningTestTool(); 48 49 sub testToolPath(); … … 118 119 { 119 120 my ($suite) = @_; 120 print "Suite: $suite\n" ;121 print "Suite: $suite\n" unless $verbose; 121 122 122 123 my $anyFailures = 0; … … 138 139 my $gtestArg = "--gtest_filter=" . $test; 139 140 140 print " Test: $testName -> " ;141 print " Test: $testName -> " unless $verbose; 141 142 142 143 my $result = 0; … … 183 184 184 185 if ($timedOut) { 185 print BOLD YELLOW, "Timeout", RESET, "\n"; 186 } elsif (!$result) { 187 print BOLD GREEN, "Passed", RESET, "\n"; 188 } else { 189 print BOLD RED, "Failed", RESET, "\n"; 190 } 186 print possiblyColored("bold yellow", "Timeout"), "\n"; 187 } elsif (!$verbose) { 188 if ($result) { 189 print possiblyColored("bold red", "Failed"), "\n"; 190 } else { 191 print possiblyColored("bold green", "Passed"), "\n"; 192 } 193 } 194 191 195 return $timedOut || $result; 192 196 } … … 288 292 } 289 293 294 sub possiblyColored($$) 295 { 296 my ($colors, $string) = @_; 297 298 if (-t STDOUT) { 299 return colored([$colors], $string); 300 } else { 301 return $string; 302 } 303 } 304 290 305 sub prepareEnvironmentForRunningTestTool() 291 306 {
Note: See TracChangeset
for help on using the changeset viewer.