https://bugs.webkit.org/show_bug.cgi?id=146174
Reviewed by Geoffrey Garen.
PerformanceTests:
* JetStream/cdjs/cdjs-tests.yaml: Added. This tells JSC stress tests what tests to run. It uses new syntax ("tests" being a list) that I add in this change.
* JetStream/cdjs/main.js: Mark this as a slow test.
* JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.
Tools:
* Scripts/run-javascriptcore-tests:
(runJSCStressTests): Make this aware of the cdjs-tests.yaml.
* Scripts/run-jsc-stress-tests:
- Teach this about tests that indicate error by returning an error code while also having lots of output even when they succeed.
- Add the ability to have "tests" be a list of tests rather than just one test. This could also be a list of directories that have tests.
- Fix a bug with bundle copying: whether the $collection should have the basename appended depends on whether we copy into bundleDir.dirname, not on whether absoluteCollection is a directory.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185833
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-06-19 Filip Pizlo <fpizlo@apple.com>
+
+ Run CDjs as part of JSC stress testing
+ https://bugs.webkit.org/show_bug.cgi?id=146174
+
+ Reviewed by Geoffrey Garen.
+
+ * JetStream/cdjs/cdjs-tests.yaml: Added. This tells JSC stress tests what tests to run. It uses new syntax ("tests" being a list) that I add in this change.
+ * JetStream/cdjs/main.js: Mark this as a slow test.
+ * JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.
+
2015-06-19 Filip Pizlo <fpizlo@apple.com>
Unreviewed, fix a small indentation goof.
--- /dev/null
+# Copyright (C) 2015 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+- path: .
+ tests:
+ - red_black_tree_test.js
+ - motion_test.js
+ - reduce_collision_set_test.js
+ - main.js
+ cmd: defaultRunNoisyTest unless parseRunCommands
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// This is run as a JSC stress test. Let the harness know that this is a slow test.
+//@ slow!
+
load("constants.js");
load("util.js");
load("red_black_tree.js");
VERSION = "1.1-alpha2"
DIRECTORY_NAME = "JetStream-#{VERSION}"
+CDJS_FILES = [
+ "constants.js",
+ "util.js",
+ "red_black_tree.js",
+ "call_sign.js",
+ "vector_2d.js",
+ "vector_3d.js",
+ "motion.js",
+ "reduce_collision_set.js",
+ "simulator.js",
+ "collision.js",
+ "collision_detector.js",
+ "benchmark.js"
+]
+
raise unless system("rm -rf " + DIRECTORY_NAME)
raise unless system("mkdir -p " + DIRECTORY_NAME)
raise unless system("mkdir -p #{DIRECTORY_NAME}/sunspider")
raise unless system("mkdir -p #{DIRECTORY_NAME}/sources")
raise unless system("cp sunspider/*.js #{DIRECTORY_NAME}/sunspider")
-raise unless system("cp -r JetStream.css JetStreamDriver.js LLVM-test-suite-LICENSE.txt simple Octane2 Octane2Setup.js SimpleSetup.js SunSpiderSetup.js Octane OctaneSetup.js CDjsSetup.js cdjs Reference.js TestingSetup.js JetStream-Logo.png JetStream-Logo@2x.png Swoosh.png Swoosh@2x.png " + DIRECTORY_NAME)
+raise unless system("mkdir -p #{DIRECTORY_NAME}/cdjs")
+CDJS_FILES.each {
+ | filename |
+ raise unless system("cp cdjs/#{filename} #{DIRECTORY_NAME}/cdjs")
+}
+raise unless system("cp -r JetStream.css JetStreamDriver.js LLVM-test-suite-LICENSE.txt simple Octane2 Octane2Setup.js SimpleSetup.js SunSpiderSetup.js Octane OctaneSetup.js CDjsSetup.js Reference.js TestingSetup.js JetStream-Logo.png JetStream-Logo@2x.png Swoosh.png Swoosh@2x.png " + DIRECTORY_NAME)
def detemplatize(basename)
File.open(DIRECTORY_NAME + "/#{basename}.html", "w") {
transferSource("box2d", "Octane2/box2d.js")
transferSource("zlib", "Octane2/zlib.js", "Octane2/zlib-data.js")
transferSource("typescript", "Octane2/typescript.js", "Octane2/typescript-compiler.js", "Octane2/typescript-input.js")
-transferSource("cdjs", "cdjs/constants.js", "cdjs/util.js", "cdjs/red_black_tree.js", "cdjs/call_sign.js", "cdjs/vector_2d.js", "cdjs/vector_3d.js", "cdjs/motion.js", "cdjs/reduce_collision_set.js", "cdjs/simulator.js", "cdjs/collision.js", "cdjs/collision_detector.js", "cdjs/benchmark.js")
+transferSource("cdjs", *(CDJS_FILES.collect { | filename | "cdjs/#{filename}" }))
puts "You can now run JetStream by navigating to file://" + (Pathname.new(DIRECTORY_NAME) + "index.html").realpath.to_s
+2015-06-19 Filip Pizlo <fpizlo@apple.com>
+
+ Run CDjs as part of JSC stress testing
+ https://bugs.webkit.org/show_bug.cgi?id=146174
+
+ Reviewed by Geoffrey Garen.
+
+ * Scripts/run-javascriptcore-tests:
+ (runJSCStressTests): Make this aware of the cdjs-tests.yaml.
+ * Scripts/run-jsc-stress-tests:
+ - Teach this about tests that indicate error by returning an error code while also having lots of output even when they succeed.
+ - Add the ability to have "tests" be a list of tests rather than just one test. This could also be a list of directories that have tests.
+ - Fix a bug with bundle copying: whether the $collection should have the basename appended depends on whether we copy into bundleDir.dirname, not on whether absoluteCollection is a directory.
+
2015-06-21 Alexey Proskuryakov <ap@apple.com>
REGRESSION (r172975): navigator.language unable to tell region for Traditional Chinese users
"/usr/bin/env", "ruby", "Tools/Scripts/run-jsc-stress-tests",
"-j", jscPath($productDir), "-o", $jscStressResultsDir,
"PerformanceTests/SunSpider/tests/sunspider-1.0",
+ "PerformanceTests/JetStream/cdjs/cdjs-tests.yaml",
"Source/JavaScriptCore/tests/executableAllocationFuzz.yaml",
"Source/JavaScriptCore/tests/exceptionFuzz.yaml",
"PerformanceTests/SunSpider/no-architecture-specific-optimizations.yaml",
}
end
+# Error handler for tests that fail exactly when they return non-zero exit status and produce
+# lots of spew. This will echo that spew when the test fails.
+def noisyErrorHandler
+ Proc.new {
+ | outp, plan |
+ outputFilename = Shellwords.shellescape((Pathname("..") + (plan.name + ".out")).to_s)
+
+ outp.puts "if test -e #{plan.failFile}"
+ outp.puts "then"
+ outp.puts " (cat #{outputFilename} && echo ERROR: Unexpected exit code: `cat #{plan.failFile}`) | " + redirectAndPrefixCommand(plan.name)
+ outp.puts " " + plan.failCommand
+ outp.puts "else"
+ outp.puts " " + plan.successCommand
+ outp.puts "fi"
+ }
+end
+
# Error handler for tests that diff their output with some expectation.
def diffErrorHandler(expectedFilename)
Proc.new {
end
end
+def runNoisyTest(kind, *options)
+ addRunCommand(kind, [pathToVM.to_s] + BASE_OPTIONS + options + [$benchmark.to_s], noisyOutputHandler, noisyErrorHandler)
+end
+
+def runNoisyTestDefault
+ runNoisyTest("default")
+end
+
+def runNoisyTestDefaultFTL
+ runNoisyTest("ftl", *FTL_OPTIONS) if $enableFTL
+end
+
+def runNoisyTestNoCJIT
+ runNoisyTest($enableFTL ? "ftl-no-cjit" : "no-cjit", "--validateBytecode=true", "--validateGraphAtEachPhase=true", *(($enableFTL ? FTL_OPTIONS : []) + NO_CJIT_OPTIONS))
+end
+
+def runNoisyTestEagerNoCJIT
+ runNoisyTest($enableFTL ? "ftl-eager-no-cjit" : "eager-no-cjit", "--validateBytecode=true", "--validateGraphAtEachPhase=true", *(($enableFTL ? FTL_OPTIONS : []) + NO_CJIT_OPTIONS + EAGER_OPTIONS))
+end
+
+def defaultRunNoisyTest
+ runNoisyTestDefault
+ if $jitTests
+ runNoisyTestDefaultFTL
+ runNoisyTestNoCJIT
+ runNoisyTestEagerNoCJIT
+ end
+end
+
def skip
$didAddRunCommand = true
puts "Skipping #{$collectionName}/#{$benchmark}"
FileUtils.mkdir_p bundleDir
if bundleDir.basename == $collection.basename
FileUtils.cp_r absoluteCollection, bundleDir.dirname
+ $collection = bundleDir
else
FileUtils.cp_r absoluteCollection, bundleDir
+ $collection = bundleDir + $collection.basename
end
$extraFilesBaseDir = absoluteCollection
-
- # Redirect the collection's location to the newly constructed bundle.
- if absoluteCollection.directory?
- $collection = bundleDir
- else
- $collection = bundleDir + $collection.basename
- end
}
end
prepareCollection($collectionName)
Dir.chdir($outputDir) {
- directoryToSearch = $collection
+ pathsToSearch = [$collection]
if entry["tests"]
- directoryToSearch += entry["tests"]
+ if entry["tests"].is_a? Array
+ pathsToSearch = entry["tests"].map {
+ | testName |
+ pathsToSearch[0] + testName
+ }
+ else
+ pathsToSearch[0] += entry["tests"]
+ end
end
- allJSFiles(directoryToSearch).each {
- | path |
-
- $benchmark = path.basename
- $benchmarkDirectory = path.dirname
-
- $runCommandOptions = {}
- eval entry["cmd"]
+ pathsToSearch.each {
+ | pathToSearch |
+ allJSFiles(pathToSearch).each {
+ | path |
+
+ $benchmark = path.basename
+ $benchmarkDirectory = path.dirname
+
+ $runCommandOptions = {}
+ eval entry["cmd"]
+ }
}
}
}