Title: [232115] trunk/Tools
Revision
232115
Author
[email protected]
Date
2018-05-23 09:59:58 -0700 (Wed, 23 May 2018)

Log Message

Unreviewed, rolling out r232112.

The tests added with this change  are failing on the bots.

Reverted changeset:

"test262/Runner.pm: add unit tests"
https://bugs.webkit.org/show_bug.cgi?id=185783
https://trac.webkit.org/changeset/232112

Modified Paths

Removed Paths

  • trunk/Tools/Scripts/webkitperl/test262_unittest/

Diff

Modified: trunk/Tools/ChangeLog (232114 => 232115)


--- trunk/Tools/ChangeLog	2018-05-23 16:56:12 UTC (rev 232114)
+++ trunk/Tools/ChangeLog	2018-05-23 16:59:58 UTC (rev 232115)
@@ -1,3 +1,15 @@
+2018-05-23  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r232112.
+
+        The tests added with this change  are failing on the bots.
+
+        Reverted changeset:
+
+        "test262/Runner.pm: add unit tests"
+        https://bugs.webkit.org/show_bug.cgi?id=185783
+        https://trac.webkit.org/changeset/232112
+
 2018-05-23  Valerie R Young  <[email protected]>
 
         test262/Runner.pm: add unit tests

Modified: trunk/Tools/Scripts/test262/Runner.pm (232114 => 232115)


--- trunk/Tools/Scripts/test262/Runner.pm	2018-05-23 16:56:12 UTC (rev 232114)
+++ trunk/Tools/Scripts/test262/Runner.pm	2018-05-23 16:59:58 UTC (rev 232115)
@@ -78,6 +78,7 @@
 my @cliTestDirs;
 my $verbose;
 my $JSC;
+my $test262Dir;
 my $harnessDir;
 my %filterFeatures;
 my $ignoreConfig;
@@ -90,16 +91,16 @@
 my $runningAllTests;
 my $timeout;
 
-my $test262Dir;
-my $webkitTest262Dir = abs_path("$Bin/../../../JSTests/test262");
 my $expectationsFile = abs_path("$Bin/../../../JSTests/test262/expectations.yaml");
 my $configFile = abs_path("$Bin/../../../JSTests/test262/config.yaml");
 
 my $resultsDir = $ENV{PWD} . "/test262-results";
-my $resultsFile;
-my $summaryTxtFile;
-my $summaryFile;
+mkpath($resultsDir);
 
+my $resultsFile = abs_path("$resultsDir/results.yaml");
+my $summaryTxtFile = abs_path("$resultsDir/summary.txt");
+my $summaryFile = abs_path("$resultsDir/summary.yaml");
+
 my @results;
 my @files;
 
@@ -106,6 +107,8 @@
 my $tempdir = tempdir();
 my ($deffh, $deffile) = getTempFile();
 
+my @default_harnesses;
+
 my $startTime = time();
 
 main();
@@ -163,26 +166,15 @@
         }
     }
 
-    if ($stats || $failingOnly) {
-        # If not supplied, try to find the results file in expected directory
-        $resultsFile ||= abs_path("$resultsDir/results.yaml");
-
-        if ($failingOnly && ! -e $resultsFile) {
-            die "Error: cannot find results file to run failing tests," .
+    if ($stats) {
+        if (! -e $resultsFile) {
+            die "Error: cannot find results file to summarize," .
                 "please specify with --results.";
         }
-
-        if ($stats) {
-            if (! -e $resultsFile) {
-                die "Error: cannot find results file to summarize," .
-                    " please specify with --results.";
-            }
-            summarizeResults();
-            exit;
-        }
+        summarizeResults();
+        exit;
     }
 
-
     if ($JSC) {
         $JSC = abs_path($JSC);
         # Make sure the path and file jsc exist
@@ -203,19 +195,12 @@
     }
 
     if (! $test262Dir) {
-        $test262Dir = $webkitTest262Dir;
+        $test262Dir = abs_path("$Bin/../../../JSTests/test262");
     } else {
         $test262Dir = abs_path($test262Dir);
     }
-
     $harnessDir = "$test262Dir/harness";
-    if (! -e $harnessDir) {
-        # if the harness directory does not exist in the custom test262 path,
-        # then use the webkits harness directory.
-        $harnessDir = "$webkitTest262Dir/harness";
-    }
 
-
     if (! $ignoreConfig) {
         if ($configFile && ! -e $configFile) {
             die "Error: Config file $configFile does not exist!\n" .
@@ -227,6 +212,11 @@
         }
     }
 
+    if ( $failingOnly && ! -e $resultsFile ) {
+        die "Error: cannot find results file to run failing tests," .
+            " please specify with --results.";
+    }
+
     if ($specifiedExpectationsFile) {
         $expectationsFile = abs_path($specifiedExpectationsFile);
         if (! -e $expectationsFile && ! $ignoreExpectations) {
@@ -266,19 +256,17 @@
     print "--------------------------------------------------------\n\n";
 }
 
-
 sub main {
     processCLI();
 
-    my @defaultHarnessFiles = (
+    @default_harnesses = (
         "$harnessDir/sta.js",
         "$harnessDir/assert.js",
         "$harnessDir/doneprintHandle.js",
         "$Bin/agent.js"
     );
+    print $deffh getHarness(<@default_harnesses>);
 
-    print $deffh getHarness(\@defaultHarnessFiles);
-
     # If not commandline test path supplied, use the root directory of all tests.
     push(@cliTestDirs, 'test') if not @cliTestDirs;
 
@@ -401,11 +389,6 @@
     }
 
     if ($runningAllTests) {
-        if (! -e $resultsDir) {
-            mkpath($resultsDir);
-        }
-        $resultsFile = abs_path("$resultsDir/results.yaml");
-
         DumpFile($resultsFile, \@results);
         print "Saved all the results in $resultsFile\n";
         summarizeResults();
@@ -609,8 +592,7 @@
     my $includes = shift;
     my ($tfh, $tfname) = getTempFile();
 
-    my @includes = map { "$harnessDir/$_" } @{ $includes };
-    my $includesContent = getHarness(\@includes);
+    my $includesContent = getHarness(map { "$harnessDir/$_" } @{ $includes });
     print $tfh $includesContent;
 
     return ($tfh, $tfname);
@@ -682,11 +664,10 @@
 
     if ($scenario ne 'skip' && $currentfailure) {
 
-        # We have a new failure if we haven't loaded an expectation file
-        # (all fails are new) OR we have loaded an expectation fail and
-        # (there is no expected failure OR the failure has changed).
-        my $isnewfailure = ! $expect
-            || !$expectedfailure || $expectedfailure ne $currentfailure;
+        # We have a new failure if we have loaded an expectation file
+        # AND (there is no expected failure OR the failure has changed).
+        my $isnewfailure = $expect
+            && (!$expectedfailure || $expectedfailure ne $currentfailure);
 
         # Print the failure if we haven't loaded an expectation file
         # or the failure is new.
@@ -762,10 +743,9 @@
 }
 
 sub getHarness {
-    my ($filesref) = @_;
-
+    my @files = @_;
     my $content;
-    for (@{$filesref}) {
+    for (@files) {
         my $file = $_;
 
         open(my $harness_file, '<', $file)
@@ -776,7 +756,7 @@
         close $harness_file;
     };
 
-    return $content || '';
+    return $content;
 }
 
 sub summarizeResults {
@@ -786,14 +766,6 @@
         my @rawresults = LoadFile($resultsFile) or die $!;
         @results = @{$rawresults[0]};
     }
-
-    # Create test262-results folder if it does not exits
-    if (! -e $resultsDir) {
-        mkpath($resultsDir);
-    }
-    $summaryTxtFile = abs_path("$resultsDir/summary.txt");
-    $summaryFile = abs_path("$resultsDir/summary.yaml");
-
     my %byfeature;
     my %bypath;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to