Title: [121394] trunk/Source/_javascript_Core
Revision
121394
Author
msab...@apple.com
Date
2012-06-27 18:14:20 -0700 (Wed, 27 Jun 2012)

Log Message

[Win] jscore-tests flakey
https://bugs.webkit.org/show_bug.cgi?id=88118

Reviewed by Jessie Berlin.

jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
instead it gets 126.  Added a new option to jsc (-x) which prints the exit
code before exiting.  jsDriver.pl uses this option on Windows and parses the
exit code output for the exit code, removing it before comparing the actual
and expected outputs.  Filed a follow on "FIXME" defect:
[WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
https://bugs.webkit.org/show_bug.cgi?id=90119

* jsc.cpp:
(CommandLine::CommandLine):
(CommandLine):
(printUsageStatement):
(parseArguments):
(jscmain):
* tests/mozilla/jsDriver.pl:
(execute_tests):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (121393 => 121394)


--- trunk/Source/_javascript_Core/ChangeLog	2012-06-28 01:09:22 UTC (rev 121393)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-06-28 01:14:20 UTC (rev 121394)
@@ -1,3 +1,27 @@
+2012-06-27  Michael Saboff  <msab...@apple.com>
+
+        [Win] jscore-tests flakey
+        https://bugs.webkit.org/show_bug.cgi?id=88118
+
+        Reviewed by Jessie Berlin.
+
+        jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
+        instead it gets 126.  Added a new option to jsc (-x) which prints the exit
+        code before exiting.  jsDriver.pl uses this option on Windows and parses the
+        exit code output for the exit code, removing it before comparing the actual
+        and expected outputs.  Filed a follow on "FIXME" defect:
+        [WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
+        https://bugs.webkit.org/show_bug.cgi?id=90119
+
+        * jsc.cpp:
+        (CommandLine::CommandLine):
+        (CommandLine):
+        (printUsageStatement):
+        (parseArguments):
+        (jscmain):
+        * tests/mozilla/jsDriver.pl:
+        (execute_tests):
+
 2012-06-27  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r121359.

Modified: trunk/Source/_javascript_Core/jsc.cpp (121393 => 121394)


--- trunk/Source/_javascript_Core/jsc.cpp	2012-06-28 01:09:22 UTC (rev 121393)
+++ trunk/Source/_javascript_Core/jsc.cpp	2012-06-28 01:14:20 UTC (rev 121394)
@@ -117,11 +117,13 @@
     CommandLine()
         : interactive(false)
         , dump(false)
+        , exitCode(false)
     {
     }
 
     bool interactive;
     bool dump;
+    bool exitCode;
     Vector<Script> scripts;
     Vector<UString> arguments;
 };
@@ -611,6 +613,7 @@
 #if HAVE(SIGNAL_H)
     fprintf(stderr, "  -s         Installs signal handlers that exit on a crash (Unix platforms only)\n");
 #endif
+    fprintf(stderr, "  -x         Output exit code before terminating\n");
 
     exit(help ? EXIT_SUCCESS : EXIT_FAILURE);
 }
@@ -649,6 +652,10 @@
 #endif
             continue;
         }
+        if (!strcmp(arg, "-x")) {
+            options.exitCode = true;
+            continue;
+        }
         if (!strcmp(arg, "--")) {
             ++i;
             break;
@@ -667,9 +674,9 @@
 
 int jscmain(int argc, char** argv)
 {
-    
     RefPtr<JSGlobalData> globalData = JSGlobalData::create(ThreadStackTypeLarge, LargeHeap);
     JSLockHolder lock(globalData.get());
+    int result;
 
     CommandLine options;
     parseArguments(argc, argv, options);
@@ -679,7 +686,12 @@
     if (options.interactive && success)
         runInteractive(globalObject);
 
-    return success ? 0 : 3;
+    result = success ? 0 : 3;
+
+    if (options.exitCode)
+        printf("jsc exiting %d\n", result);
+
+    return result;
 }
 
 static bool fillBufferWithContentsOfFile(const UString& fileName, Vector<char>& buffer)

Modified: trunk/Source/_javascript_Core/tests/mozilla/jsDriver.pl (121393 => 121394)


--- trunk/Source/_javascript_Core/tests/mozilla/jsDriver.pl	2012-06-28 01:09:22 UTC (rev 121393)
+++ trunk/Source/_javascript_Core/tests/mozilla/jsDriver.pl	2012-06-28 01:14:20 UTC (rev 121394)
@@ -164,6 +164,7 @@
         my $failure_lines;
         my $bug_number;
         my $status_lines;
+        my @jsc_exit_code;
         
 # user selected [Q]uit from ^C handler.
         if ($user_exit) {
@@ -177,7 +178,20 @@
             $shell_command = $opt_arch . " ";
             
             $shell_command .= &xp_path($engine_command)  . " -s ";
-            
+
+# FIXME: <https://bugs.webkit.org/show_bug.cgi?id=90119>
+# Sporadically on Windows, the exit code returned after close() in $?
+# is 126 (after the appropraite shifting, even though jsc exits with
+# 0 or 3). To work around this, a -x option was added to jsc that will
+# output the exit value right before exiting.  We parse that value and
+# remove it from the output stream before comparing the actual and expected
+# outputs. When that bug is found and fixed, the code for processing of
+# "jsc exiting [\d]" and use of @jsc_exit_code can be removed along with
+# the -x option in jsc.cpp
+            if ($os_type eq "WIN") {
+                $shell_command .= " -x ";
+            }
+
             $path = &xp_path($opt_suite_path . $suite . "/shell.js");
             if (-f $path) {
                 $shell_command .= $file_param . $path;
@@ -202,10 +216,19 @@
               $redirect_command . " |");
         @output = <OUTPUT>;
         close (OUTPUT);
-        
-        @output = grep (!/js\>/, @output);
-        
-        if ($opt_exit_munge == 1) {
+
+        @jsc_exit_code = grep (/jsc exiting [\d]/, @output);
+        @output = grep (!/js\>|jsc exiting [\d]/, @output);
+
+        if (($#jsc_exit_code == 0) && ($jsc_exit_code[0] =~ /jsc exiting ([\d])\W*/)) {
+# return value from jsc output to work around windows bug
+            $got_exit = $1;
+            if ($opt_exit_munge == 1) {
+                $exit_signal = ($? & 255);
+            } else {
+                $exit_signal = 0;
+            }
+        } elsif ($opt_exit_munge == 1) {
 # signal information in the lower 8 bits, exit code above that
             $got_exit = ($? >> 8);
             $exit_signal = ($? & 255);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to