Changeset 232112 in webkit
- Timestamp:
- May 23, 2018 8:33:49 AM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 13 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r232085 r232112 1 2018-05-23 Valerie R Young <valerie@bocoup.com> 2 3 test262/Runner.pm: add unit tests 4 https://bugs.webkit.org/show_bug.cgi?id=185783 5 6 Reviewed by Aakash Jain. 7 8 Add unit tests to be run by test-webkitperl 9 10 * Scripts/test262/Runner.pm: 11 (main): 12 - If harness files cannot be found in a custom, supplies test262 path, 13 then sure the webkit test262 harness files. 14 - Lazily create the test262-results directory. 15 - If an expectation file is supplied via command line, save to the 16 supplied location instead of the detault webkit location. 17 (compileTest): 18 (processResult): 19 (getHarness): 20 * Scripts/webkitperl/test262_unittest/README: Added. 21 * Scripts/webkitperl/test262_unittest/fixtures/expectations-compare.yaml: Added. 22 * Scripts/webkitperl/test262_unittest/fixtures/expectations.yaml: Added. 23 * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing-with-new-error.js: Added. 24 * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing.js: Added. 25 * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-passing.js: Added. 26 (f): 27 * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-pass-now-failing.js: Added. 28 * Scripts/webkitperl/test262_unittest/fixtures/test/fail.js: Added. 29 * Scripts/webkitperl/test262_unittest/fixtures/test/pass.js: Added. 30 (f): 31 * Scripts/webkitperl/test262_unittest/test262-runner-tests.pl: Added. 32 1 33 2018-05-22 Roy Reapor <rreapor@apple.com> 2 34 -
trunk/Tools/Scripts/test262/Runner.pm
r231919 r232112 79 79 my $verbose; 80 80 my $JSC; 81 my $test262Dir;82 81 my $harnessDir; 83 82 my %filterFeatures; … … 92 91 my $timeout; 93 92 93 my $test262Dir; 94 my $webkitTest262Dir = abs_path("$Bin/../../../JSTests/test262"); 94 95 my $expectationsFile = abs_path("$Bin/../../../JSTests/test262/expectations.yaml"); 95 96 my $configFile = abs_path("$Bin/../../../JSTests/test262/config.yaml"); 96 97 97 98 my $resultsDir = $ENV{PWD} . "/test262-results"; 98 mkpath($resultsDir); 99 100 my $resultsFile = abs_path("$resultsDir/results.yaml"); 101 my $summaryTxtFile = abs_path("$resultsDir/summary.txt"); 102 my $summaryFile = abs_path("$resultsDir/summary.yaml"); 99 my $resultsFile; 100 my $summaryTxtFile; 101 my $summaryFile; 103 102 104 103 my @results; … … 107 106 my $tempdir = tempdir(); 108 107 my ($deffh, $deffile) = getTempFile(); 109 110 my @default_harnesses;111 108 112 109 my $startTime = time(); … … 167 164 } 168 165 169 if ($stats) { 170 if (! -e $resultsFile) { 171 die "Error: cannot find results file to summarize," . 166 if ($stats || $failingOnly) { 167 # If not supplied, try to find the results file in expected directory 168 $resultsFile ||= abs_path("$resultsDir/results.yaml"); 169 170 if ($failingOnly && ! -e $resultsFile) { 171 die "Error: cannot find results file to run failing tests," . 172 172 "please specify with --results."; 173 173 } 174 summarizeResults(); 175 exit; 176 } 174 175 if ($stats) { 176 if (! -e $resultsFile) { 177 die "Error: cannot find results file to summarize," . 178 " please specify with --results."; 179 } 180 summarizeResults(); 181 exit; 182 } 183 } 184 177 185 178 186 if ($JSC) { … … 196 204 197 205 if (! $test262Dir) { 198 $test262Dir = abs_path("$Bin/../../../JSTests/test262");206 $test262Dir = $webkitTest262Dir; 199 207 } else { 200 208 $test262Dir = abs_path($test262Dir); 201 209 } 210 202 211 $harnessDir = "$test262Dir/harness"; 212 if (! -e $harnessDir) { 213 # if the harness directory does not exist in the custom test262 path, 214 # then use the webkits harness directory. 215 $harnessDir = "$webkitTest262Dir/harness"; 216 } 217 203 218 204 219 if (! $ignoreConfig) { … … 211 226 %configSkipHash = map { $_ => 1 } @{$config->{skip}->{files}}; 212 227 } 213 }214 215 if ( $failingOnly && ! -e $resultsFile ) {216 die "Error: cannot find results file to run failing tests," .217 " please specify with --results.";218 228 } 219 229 … … 257 267 } 258 268 269 259 270 sub main { 260 271 processCLI(); 261 272 262 @default_harnesses = (273 my @defaultHarnessFiles = ( 263 274 "$harnessDir/sta.js", 264 275 "$harnessDir/assert.js", … … 266 277 "$Bin/agent.js" 267 278 ); 268 print $deffh getHarness(<@default_harnesses>); 279 280 print $deffh getHarness(\@defaultHarnessFiles); 269 281 270 282 # If not commandline test path supplied, use the root directory of all tests. … … 390 402 391 403 if ($runningAllTests) { 404 if (! -e $resultsDir) { 405 mkpath($resultsDir); 406 } 407 $resultsFile = abs_path("$resultsDir/results.yaml"); 408 392 409 DumpFile($resultsFile, \@results); 393 410 print "Saved all the results in $resultsFile\n"; … … 593 610 my ($tfh, $tfname) = getTempFile(); 594 611 595 my $includesContent = getHarness(map { "$harnessDir/$_" } @{ $includes }); 612 my @includes = map { "$harnessDir/$_" } @{ $includes }; 613 my $includesContent = getHarness(\@includes); 596 614 print $tfh $includesContent; 597 615 … … 665 683 if ($scenario ne 'skip' && $currentfailure) { 666 684 667 # We have a new failure if we have loaded an expectation file 668 # AND (there is no expected failure OR the failure has changed). 669 my $isnewfailure = $expect 670 && (!$expectedfailure || $expectedfailure ne $currentfailure); 685 # We have a new failure if we haven't loaded an expectation file 686 # (all fails are new) OR we have loaded an expectation fail and 687 # (there is no expected failure OR the failure has changed). 688 my $isnewfailure = ! $expect 689 || !$expectedfailure || $expectedfailure ne $currentfailure; 671 690 672 691 # Print the failure if we haven't loaded an expectation file … … 744 763 745 764 sub getHarness { 746 my @files = @_; 765 my ($filesref) = @_; 766 747 767 my $content; 748 for (@ files) {768 for (@{$filesref}) { 749 769 my $file = $_; 750 770 … … 757 777 }; 758 778 759 return $content ;779 return $content || ''; 760 780 } 761 781 … … 767 787 @results = @{$rawresults[0]}; 768 788 } 789 790 # Create test262-results folder if it does not exits 791 if (! -e $resultsDir) { 792 mkpath($resultsDir); 793 } 794 $summaryTxtFile = abs_path("$resultsDir/summary.txt"); 795 $summaryFile = abs_path("$resultsDir/summary.yaml"); 796 769 797 my %byfeature; 770 798 my %bypath;
Note: See TracChangeset
for help on using the changeset viewer.