Title: [198807] trunk/Tools
Revision
198807
Author
commit-qu...@webkit.org
Date
2016-03-29 15:23:42 -0700 (Tue, 29 Mar 2016)

Log Message

Add machine-readable results for JSC stress tests
https://bugs.webkit.org/show_bug.cgi?id=155771

Patch by Srinivasan Vijayaraghavan <svijayaragha...@apple.com> on 2016-03-29
Reviewed by Darin Adler and Dean Johnson

Add an option to output JSC stress test results to a user-specified file in JSON format.

* Scripts/run-_javascript_core-tests:
(runJSCStressTests): Add JSON output support
(readAllLines): Remove trailing newline from the end of each item

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (198806 => 198807)


--- trunk/Tools/ChangeLog	2016-03-29 22:19:40 UTC (rev 198806)
+++ trunk/Tools/ChangeLog	2016-03-29 22:23:42 UTC (rev 198807)
@@ -1,3 +1,16 @@
+2016-03-29  Srinivasan Vijayaraghavan  <svijayaragha...@apple.com>
+
+        Add machine-readable results for JSC stress tests
+        https://bugs.webkit.org/show_bug.cgi?id=155771
+
+        Reviewed by Darin Adler and Dean Johnson
+
+        Add an option to output JSC stress test results to a user-specified file in JSON format.
+
+        * Scripts/run-_javascript_core-tests:
+        (runJSCStressTests): Add JSON output support
+        (readAllLines): Remove trailing newline from the end of each item
+
 2016-03-29  Alex Christensen  <achristen...@webkit.org>
 
         Fix Windows build.

Modified: trunk/Tools/Scripts/run-_javascript_core-tests (198806 => 198807)


--- trunk/Tools/Scripts/run-_javascript_core-tests	2016-03-29 22:19:40 UTC (rev 198806)
+++ trunk/Tools/Scripts/run-_javascript_core-tests	2016-03-29 22:23:42 UTC (rev 198807)
@@ -31,12 +31,14 @@
 # as well as other tests: testapi on Mac and LayoutTests/js.
 
 use strict;
+use File::Spec;
 use FindBin;
 use Getopt::Long qw(:config pass_through);
+use JSON::PP;
+use lib $FindBin::Bin;
 use List::Util qw(min max);
-use lib $FindBin::Bin;
+use POSIX;
 use webkitdirs;
-use POSIX;
 
 # determine configuration
 setConfiguration();
@@ -66,6 +68,7 @@
 my $createTarball = 0;
 my $remoteHost = 0;
 my $remoteConfigFile;
+my $jsonFileName;
 
 my $programName = basename($0);
 my $buildJSCDefault = $buildJSC ? "will check" : "will not check";
@@ -87,6 +90,7 @@
                                 If the runner only runs some it will run the default and no-cjit-validate modes.
                                 Note, this will not change the behavior of tests that specify their own modes.
 
+  --json-output=                Create a file at specified path, listing failed stress tests in JSON format.
   --tarball                     Create a tarball of the bundle produced by running the JSC stress tests.
   --remote=                     Run the JSC stress tests on the specified remote host. Implies --tarball.
   --remote-config-file=         Same as remote, but read config from JSON file.
@@ -112,6 +116,7 @@
     'jsc-stress!' => \$runJSCStress,
     'jit-stress-tests!' => \$runJITStressTests,
     'quick!' => \$runQuickMode,
+    'json-output=s' => \$jsonFileName,
     'tarball!' => \$createTarball,
     'remote=s' => \$remoteHost,
     'remote-config-file=s' => \$remoteConfigFile,
@@ -121,7 +126,7 @@
     'filter=s' => \$filter,
     'help' => \$showHelp,
     'env-vars=s' => \$envVars,
-    'gmalloc:s' => \$gmallocPath
+    'gmalloc:s' => \$gmallocPath,
 );
 
 # Assume any arguments left over from GetOptions are assumed to be build arguments
@@ -139,6 +144,10 @@
 
 setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
 
+if (defined($jsonFileName)) {
+    $jsonFileName = File::Spec->rel2abs($jsonFileName);
+}
+
 if (!defined($root) && $buildJSC) {
     chdirWebKit();
 
@@ -283,7 +292,7 @@
     if ($makeRunner) {
         push(@jscStressDriverCmd, "--make-runner");
     }
-    
+
     if ($filter) {
         push(@jscStressDriverCmd, "--filter");
         push(@jscStressDriverCmd, $filter);
@@ -309,7 +318,7 @@
     if ($numJSCStressFailures) {
         print "\n** The following JSC stress test failures have been introduced:\n";
         foreach my $testFailure (@jscStressFailList) {
-            print "\t$testFailure";
+            print "\t$testFailure\n";
         }
     }
     print "\n";
@@ -320,6 +329,17 @@
 
     print "\n";
 
+    if (defined($jsonFileName)) {
+        my %jsonData = (
+            "numJSCStressFailures" => $numJSCStressFailures,
+            "jscStressFailList" => \@jscStressFailList,
+        );
+
+        open(my $fileHandler, ">", $jsonFileName) or die;
+        print $fileHandler "${\encode_json(\%jsonData)}\n";
+        close($fileHandler);
+    }
+
     exit(1) if $numJSCStressFailures;
 }
 
@@ -330,6 +350,7 @@
     eval {
         open FILE, $filename or die;
         while (<FILE>) {
+            chomp;
             push @array, $_;
         }
         close FILE;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to