Title: [156976] trunk
Revision
156976
Author
fpi...@apple.com
Date
2013-10-05 16:53:54 -0700 (Sat, 05 Oct 2013)

Log Message

Allow skipping of run-jsc-stress-tests that are configured using yaml files
https://bugs.webkit.org/show_bug.cgi?id=122385

Tools: 

Reviewed by Sam Wieinig.
        
Make tests run via YAML be able to do the parse-for-commands trick that allows
us to skip tests and do other custom per-test stuff.

* Scripts/jsc-stress-test-helpers/layout-test-helper:
* Scripts/run-jsc-stress-tests:

LayoutTests: 

Reviewed by Sam Weinig.
        
The way that we "skip" tests is by having a custom command at the top using //@ notation,
and then use "//@ skip". But the machinery to do that also allows us to do things like
run tests in a no-concurrent-JIT mode - so I've also implemented that in this patch.
        
Use the skip machinery to skip large-expressions.js.

* js/script-tests/large-expressions.js:
* jsc-layout-tests.yaml:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (156975 => 156976)


--- trunk/LayoutTests/ChangeLog	2013-10-05 23:02:42 UTC (rev 156975)
+++ trunk/LayoutTests/ChangeLog	2013-10-05 23:53:54 UTC (rev 156976)
@@ -1,3 +1,19 @@
+2013-10-05  Filip Pizlo  <fpi...@apple.com>
+
+        Allow skipping of run-jsc-stress-tests that are configured using yaml files
+        https://bugs.webkit.org/show_bug.cgi?id=122385
+
+        Reviewed by Sam Weinig.
+        
+        The way that we "skip" tests is by having a custom command at the top using //@ notation,
+        and then use "//@ skip". But the machinery to do that also allows us to do things like
+        run tests in a no-concurrent-JIT mode - so I've also implemented that in this patch.
+        
+        Use the skip machinery to skip large-expressions.js.
+
+        * js/script-tests/large-expressions.js:
+        * jsc-layout-tests.yaml:
+
 2013-10-05  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [CSS Regions] Layout Test for selecting text ignoring region content

Modified: trunk/LayoutTests/js/script-tests/large-expressions.js (156975 => 156976)


--- trunk/LayoutTests/js/script-tests/large-expressions.js	2013-10-05 23:02:42 UTC (rev 156975)
+++ trunk/LayoutTests/js/script-tests/large-expressions.js	2013-10-05 23:53:54 UTC (rev 156976)
@@ -1,3 +1,7 @@
+// This test isn't very effective in jsc-stress-tests; it appears that we get a large enough
+// heap on a lot of machines that this just passes. Better to skip for now.
+//@ skip
+
 description(
 "This test checks behavior with expressions that create deep parse trees."
 );

Modified: trunk/LayoutTests/jsc-layout-tests.yaml (156975 => 156976)


--- trunk/LayoutTests/jsc-layout-tests.yaml	2013-10-05 23:02:42 UTC (rev 156975)
+++ trunk/LayoutTests/jsc-layout-tests.yaml	2013-10-05 23:53:54 UTC (rev 156976)
@@ -22,8 +22,8 @@
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 - path: js/script-tests
-  cmd: runLayoutTest
+  cmd: defaultRunLayoutTest unless parseRunCommands
 
 - path: fast/regex/script-tests
-  cmd: runLayoutTest
+  cmd: defaultRunLayoutTest unless parseRunCommands
 

Modified: trunk/Tools/ChangeLog (156975 => 156976)


--- trunk/Tools/ChangeLog	2013-10-05 23:02:42 UTC (rev 156975)
+++ trunk/Tools/ChangeLog	2013-10-05 23:53:54 UTC (rev 156976)
@@ -1,5 +1,18 @@
 2013-10-05  Filip Pizlo  <fpi...@apple.com>
 
+        Allow skipping of run-jsc-stress-tests that are configured using yaml files
+        https://bugs.webkit.org/show_bug.cgi?id=122385
+
+        Reviewed by Sam Wieinig.
+        
+        Make tests run via YAML be able to do the parse-for-commands trick that allows
+        us to skip tests and do other custom per-test stuff.
+
+        * Scripts/jsc-stress-test-helpers/layout-test-helper:
+        * Scripts/run-jsc-stress-tests:
+
+2013-10-05  Filip Pizlo  <fpi...@apple.com>
+
         Unreviewed, fix tests on older Rubies.
 
         * Scripts/run-jsc-stress-tests:

Modified: trunk/Tools/Scripts/jsc-stress-test-helpers/layout-test-helper (156975 => 156976)


--- trunk/Tools/Scripts/jsc-stress-test-helpers/layout-test-helper	2013-10-05 23:02:42 UTC (rev 156975)
+++ trunk/Tools/Scripts/jsc-stress-test-helpers/layout-test-helper	2013-10-05 23:53:54 UTC (rev 156976)
@@ -23,18 +23,14 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-jscShell=$1
-preScript=$2
-testScript=$3
-postScript=$4
-baseOutputFilename=$5
-expectedFilename=$6
+baseOutputFilename=$1;shift;
+expectedFilename=$1;shift;
 
 actualErr=$baseOutputFilename.stderr
 actualOut=$baseOutputFilename.actual
 diffOut=$baseOutputFilename.diff
 
-$jscShell $preScript $testScript $postScript 2>$actualErr >$actualOut
+"$@" 2>$actualErr >$actualOut
 JSC_RES=$?
 
 if [ $JSC_RES -eq 0 ]

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (156975 => 156976)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2013-10-05 23:02:42 UTC (rev 156975)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2013-10-05 23:53:54 UTC (rev 156976)
@@ -211,6 +211,30 @@
     $runlist << Plan.new($benchmarkDirectory, command, baseOutputName(kind))
 end
 
+# Returns true if there were run commands found in the file ($benchmarkDirectory +
+# $benchmark), in which case those run commands have already been executed. Otherwise
+# returns false, in which case you're supposed to add your own run commands.
+def parseRunCommands
+    didRun = false
+    File.open($benchmarkDirectory + $benchmark) {
+        | inp |
+        inp.each_line {
+            | line |
+            begin
+                doesMatch = line =~ /^\/\/@/
+            rescue Exception => e
+                # Apparently this happens in the case of some UTF8 stuff in some files, where
+                # Ruby tries to be strict and throw exceptions.
+                next
+            end
+            next unless doesMatch
+            eval $~.post_match
+            didRun = true
+        }
+    }
+    didRun
+end
+
 def run(kind, *options)
     addRunCommand(kind, [$jscPath.to_s] + options + [$benchmark.to_s])
 end
@@ -247,22 +271,6 @@
     run("ftl-eager-no-cjit", "--useExperimentalFTL=true", "--enableConcurrentJIT=false", *EAGER_OPTIONS)
 end
 
-def runProfiler
-    profilerOutput = uniqueFilename(".json")
-    if $haveShellwords and $canRunDisplayProfilerOutput
-        addRunCommand("profiler", ["ruby", (HELPERS_PATH + "profiler-test-helper").to_s, (SCRIPTS_PATH + "display-profiler-output").to_s, profilerOutput.to_s, $jscPath.to_s, "-p", profilerOutput.to_s, $benchmark.to_s])
-    else
-        puts "Running simple version of #{$collectionName}/#{$benchmark} because some required Ruby features are unavailable."
-        run("profiler-simple", "-p", profilerOutput.to_s)
-    end
-end
-
-def runLayoutTest
-    raise unless $benchmark.to_s =~ /\.js$/
-    testName = $~.pre_match
-    addRunCommand("layout", ["sh", (HELPERS_PATH + "layout-test-helper").to_s, $jscPath.to_s, (LAYOUTTESTS_PATH + "resources" + "standalone-pre.js").to_s, $benchmark.to_s, (LAYOUTTESTS_PATH + "resources" + "standalone-post.js").to_s, ($outputDir + baseOutputName("layout")).to_s, ($benchmarkDirectory.dirname + "#{testName}-expected.txt").to_s])
-end
-
 def runAlwaysTriggerCopyPhase
     run("always-trigger-copy-phase", "--minHeapUtilization=2.0", "--minCopiedBlockUtilization=2.0")
 end
@@ -281,6 +289,49 @@
     end
 end
 
+def runProfiler
+    profilerOutput = uniqueFilename(".json")
+    if $haveShellwords and $canRunDisplayProfilerOutput
+        addRunCommand("profiler", ["ruby", (HELPERS_PATH + "profiler-test-helper").to_s, (SCRIPTS_PATH + "display-profiler-output").to_s, profilerOutput.to_s, $jscPath.to_s, "-p", profilerOutput.to_s, $benchmark.to_s])
+    else
+        puts "Running simple version of #{$collectionName}/#{$benchmark} because some required Ruby features are unavailable."
+        run("profiler-simple", "-p", profilerOutput.to_s)
+    end
+end
+
+def runLayoutTest(kind, *options)
+    raise unless $benchmark.to_s =~ /\.js$/
+    if kind
+        kind = "layout-" + kind
+    else
+        kind = "layout"
+    end
+    testName = $~.pre_match
+    args =
+        ["sh",
+         (HELPERS_PATH + "layout-test-helper").to_s,
+         ($outputDir + baseOutputName(kind)).to_s,
+         ($benchmarkDirectory.dirname + "#{testName}-expected.txt").to_s,
+         $jscPath.to_s] + options +
+        [(LAYOUTTESTS_PATH + "resources" + "standalone-pre.js").to_s,
+         $benchmark.to_s,
+         (LAYOUTTESTS_PATH + "resources" + "standalone-post.js").to_s]
+    addRunCommand(kind, args)
+end
+
+def runLayoutTestDefault
+    runLayoutTest(nil)
+end
+
+def runLayoutTestNoCJIT
+    runLayoutTest("no-cjit", "--enableConcurrentJIT=false")
+end
+
+def defaultRunLayoutTest
+    runLayoutTestDefault
+    runLayoutTestNoCJIT
+end
+
 def skip
     puts "Skipping #{$collectionName}/#{$benchmark}"
 end
@@ -380,18 +431,7 @@
             
             $benchmark = path.basename
             
-            didRun = false
-            File.open($collection + $benchmark) {
-                | inp |
-                inp.each_line {
-                    | line |
-                    next unless line =~ /^\/\/@/
-                    eval $~.post_match
-                    didRun = true
-                }
-            }
-            
-            defaultRun unless didRun
+            defaultRun unless parseRunCommands
         }
     end
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to