Changeset 214372 in webkit
- Timestamp:
- Mar 24, 2017 1:51:22 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r214367 r214372 1 2017-03-24 Srinivasan Vijayaraghavan <svijayaraghavan@apple.com> 2 3 Add JSON results for API tests 4 https://bugs.webkit.org/show_bug.cgi?id=170021 5 6 Reviewed by Alexey Proskuryakov. 7 8 * Scripts/run-api-tests: 9 (runTestsBySuite): Appends failures and timeouts to JSON data. 10 (writeJsonDataIfApplicable): Writes JSON data to a file. 11 1 12 2017-03-24 Lucas Forschler <lforschler@apple.com> 2 13 -
trunk/Tools/Scripts/run-api-tests
r213654 r214372 28 28 29 29 use File::Basename; 30 use File::Spec; 30 31 use FindBin; 31 32 use Getopt::Long qw(:config pass_through); 32 33 use IPC::Open3; 34 use JSON::PP; 33 35 use lib $FindBin::Bin; 34 36 use sigtrap qw(die normal-signals); … … 44 46 sub archCommandLineArgumentsForRestrictedEnvironmentVariables(); 45 47 sub testToolPaths(); 48 sub writeJSONDataIfApplicable(); 46 49 47 50 # Defined in VCSUtils. … … 63 66 my $wtfOnly = 0; 64 67 my %testToToolMap; 68 my %jsonData = (); 69 my $jsonFileName; 65 70 66 71 … … 72 77 -d|--dump-tests Dump the names of testcases without running them 73 78 --[no-]build Build (or do not build) unit tests prior to running (default: $buildDefault) 79 --json-output= Create a file at the specified path, listing test failures and timeouts in JSON format. 74 80 --root= Path to the pre-built root containing TestWebKitAPI 75 81 --show-leaks Show leaks in the output … … 98 104 'show-leaks' => \$showLeaks, 99 105 'no-timeout' => \$disableTimeout, 106 'json-output=s' => \$jsonFileName, 100 107 'dump|d' => \$dumpTests, 101 108 'build!' => \$build, … … 112 119 113 120 setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root)); 121 122 if (defined($jsonFileName)) { 123 $jsonFileName = File::Spec->rel2abs($jsonFileName); 124 } 114 125 115 126 buildTestTool() if $build && !defined($root); … … 176 187 } 177 188 } 189 190 if (defined($jsonFileName)) { 191 $jsonData{'failures'} = \@testsFailed; 192 $jsonData{'timeouts'} = \@testsTimedOut; 193 } 194 195 writeJSONDataIfApplicable(); 178 196 179 197 return @testsFailed > 0 || @testsTimedOut > 0; … … 414 432 return ("$pathWTF$suffix.exe", "$pathWebCore$suffix.exe", "$pathWebKit$suffix.exe"); 415 433 } 434 435 sub writeJSONDataIfApplicable() 436 { 437 if (defined($jsonFileName)) { 438 open(my $fileHandler, ">", $jsonFileName) or die; 439 print $fileHandler "${\encode_json(\%jsonData)}\n"; 440 close($fileHandler); 441 } 442 }
Note: See TracChangeset
for help on using the changeset viewer.