diff --git a/.gitignore b/.gitignore index 17b6bb55aa..6373555964 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,8 @@ /test/test262/data.tar /test/test262/harness /test/wasm-js +/test/wasm-spec-tests/tests +/test/wasm-spec-tests/tests.tar.gz /testing/gmock /testing/gtest /third_party/* diff --git a/DEPS b/DEPS index e99d53e866..c01efd0283 100644 --- a/DEPS +++ b/DEPS @@ -201,6 +201,17 @@ hooks = [ "-s", "v8/buildtools/linux64/gn.sha1", ], }, + { + "name": "wasm_spec_tests", + "pattern": ".", + "action": [ "download_from_google_storage", + "--no_resume", + "--no_auth", + "-u", + "--bucket", "v8-wasm-spec-tests", + "-s", "v8/test/wasm-spec-tests/tests.tar.gz.sha1", + ], + }, { "name": "wasm_fuzzer", "pattern": ".", diff --git a/test/BUILD.gn b/test/BUILD.gn index 440f340545..936a6f6afc 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -52,6 +52,7 @@ group("default_tests") { ":mkgrokdump_run", ":preparser_run", ":unittests_run", + ":wasm_spec_tests_run", ] } } @@ -198,6 +199,14 @@ v8_isolate_run("unittests") { isolate = "unittests/unittests.isolate" } +v8_isolate_run("wasm_spec_tests") { + deps = [ + "..:d8_run", + ] + + isolate = "wasm-spec-tests/wasm-spec-tests.isolate" +} + v8_isolate_run("webkit") { deps = [ "..:d8_run", diff --git a/test/bot_default.gyp b/test/bot_default.gyp index 88538004d9..13c77e2d03 100644 --- a/test/bot_default.gyp +++ b/test/bot_default.gyp @@ -18,6 +18,7 @@ 'mjsunit/mjsunit.gyp:mjsunit_run', 'preparser/preparser.gyp:preparser_run', 'unittests/unittests.gyp:unittests_run', + 'wasm-spec-tests/wasm-spec-tests.gyp:wasm_spec_tests_run', 'webkit/webkit.gyp:webkit_run', ], 'includes': [ diff --git a/test/bot_default.isolate b/test/bot_default.isolate index ee5f5e4a81..c4db291cc0 100644 --- a/test/bot_default.isolate +++ b/test/bot_default.isolate @@ -18,6 +18,7 @@ 'mkgrokdump/mkgrokdump.isolate', 'preparser/preparser.isolate', 'unittests/unittests.isolate', + 'wasm-spec-tests/wasm-spec-tests.isolate', 'webkit/webkit.isolate', ], } diff --git a/test/default.gyp b/test/default.gyp index fe4e47f29d..2c6429bada 100644 --- a/test/default.gyp +++ b/test/default.gyp @@ -18,6 +18,7 @@ 'mjsunit/mjsunit.gyp:mjsunit_run', 'preparser/preparser.gyp:preparser_run', 'unittests/unittests.gyp:unittests_run', + 'wasm-spec-tests/wasm-spec-tests.gyp:wasm_spec_tests_run', ], 'includes': [ '../gypfiles/features.gypi', diff --git a/test/default.isolate b/test/default.isolate index 79f3af5660..e9104631d6 100644 --- a/test/default.isolate +++ b/test/default.isolate @@ -18,5 +18,6 @@ 'mkgrokdump/mkgrokdump.isolate', 'preparser/preparser.isolate', 'unittests/unittests.isolate', + 'wasm-spec-tests/wasm-spec-tests.isolate', ], } diff --git a/test/wasm-spec-tests/OWNERS b/test/wasm-spec-tests/OWNERS new file mode 100644 index 0000000000..f1e9a3c2a6 --- /dev/null +++ b/test/wasm-spec-tests/OWNERS @@ -0,0 +1,4 @@ +ahaas@chromium.org +clemensh@chromium.org +machenbach@chromium.org +rossberg@chromium.org diff --git a/test/wasm-spec-tests/testcfg.py b/test/wasm-spec-tests/testcfg.py new file mode 100644 index 0000000000..81a0f4a51a --- /dev/null +++ b/test/wasm-spec-tests/testcfg.py @@ -0,0 +1,37 @@ +# Copyright 2017 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import os + +from testrunner.local import testsuite +from testrunner.objects import testcase + +class WasmSpecTestsTestSuite(testsuite.TestSuite): + def __init__(self, name, root): + super(WasmSpecTestsTestSuite, self).__init__(name, root) + + def ListTests(self, context): + tests = [] + for dirname, dirs, files in os.walk(self.root): + for dotted in [x for x in dirs if x.startswith('.')]: + dirs.remove(dotted) + dirs.sort() + files.sort() + for filename in files: + if (filename.endswith(".js")): + fullpath = os.path.join(dirname, filename) + relpath = fullpath[len(self.root) + 1 : -3] + testname = relpath.replace(os.path.sep, "/") + test = testcase.TestCase(self, testname) + tests.append(test) + return tests + + def GetFlagsForTestCase(self, testcase, context): + flags = [] + context.mode_flags + flags.append(os.path.join(self.root, testcase.path + self.suffix())) + return testcase.flags + flags + + +def GetSuite(name, root): + return WasmSpecTestsTestSuite(name, root) diff --git a/test/wasm-spec-tests/tests.tar.gz.sha1 b/test/wasm-spec-tests/tests.tar.gz.sha1 new file mode 100644 index 0000000000..496b6381cf --- /dev/null +++ b/test/wasm-spec-tests/tests.tar.gz.sha1 @@ -0,0 +1 @@ +cf636dce30e87016854d6bbeb0af141621630fea \ No newline at end of file diff --git a/test/wasm-spec-tests/wasm-spec-tests.gyp b/test/wasm-spec-tests/wasm-spec-tests.gyp new file mode 100644 index 0000000000..711f982c9a --- /dev/null +++ b/test/wasm-spec-tests/wasm-spec-tests.gyp @@ -0,0 +1,26 @@ +# Copyright 2017 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'conditions': [ + ['test_isolation_mode != "noop"', { + 'targets': [ + { + 'target_name': 'wasm_spec_tests_run', + 'type': 'none', + 'dependencies': [ + '../../src/d8.gyp:d8_run', + ], + 'includes': [ + '../../gypfiles/features.gypi', + '../../gypfiles/isolate.gypi', + ], + 'sources': [ + 'wasm-spec-tests.isolate', + ], + }, + ], + }], + ], +} diff --git a/test/wasm-spec-tests/wasm-spec-tests.isolate b/test/wasm-spec-tests/wasm-spec-tests.isolate new file mode 100644 index 0000000000..4c29f9fed7 --- /dev/null +++ b/test/wasm-spec-tests/wasm-spec-tests.isolate @@ -0,0 +1,15 @@ +# Copyright 2017 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'variables': { + 'files': [ + './', + ], + }, + 'includes': [ + '../../src/d8.isolate', + '../../tools/testrunner/testrunner.isolate', + ], +} + diff --git a/test/wasm-spec-tests/wasm-spec-tests.status b/test/wasm-spec-tests/wasm-spec-tests.status new file mode 100644 index 0000000000..04c5dea85b --- /dev/null +++ b/test/wasm-spec-tests/wasm-spec-tests.status @@ -0,0 +1,17 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +[ +[ALWAYS, { + # These tests fail because mips does not support the correct NaN bit patterns. + 'tests/float_misc': [PASS, ['arch == mipsel or arch == mips64el', SKIP]], + 'tests/float_exprs': [PASS, ['arch == mipsel or arch == mips64el', SKIP]], + 'tests/f32': [PASS, ['arch == mipsel or arch == mips64el', SKIP]], + 'tests/f64': [PASS, ['arch == mipsel or arch == mips64el', SKIP]], + + #TODO(ahaas): Add additional stack checks on mips. + 'tests/skip-stack-guard-page': [PASS, ['arch == mipsel or arch == mips64el', SKIP]], +}], # ALWAYS + +] diff --git a/tools/run-tests.py b/tools/run-tests.py index c86a4994b1..fa1232643c 100755 --- a/tools/run-tests.py +++ b/tools/run-tests.py @@ -68,6 +68,7 @@ TEST_MAP = { "debugger", "mjsunit", "cctest", + "wasm-spec-tests", "inspector", "webkit", "mkgrokdump", @@ -82,6 +83,7 @@ TEST_MAP = { "debugger", "mjsunit", "cctest", + "wasm-spec-tests", "inspector", "mkgrokdump", "fuzzer", diff --git a/tools/update-wasm-spec-tests.sh b/tools/update-wasm-spec-tests.sh new file mode 100755 index 0000000000..e10224c1f4 --- /dev/null +++ b/tools/update-wasm-spec-tests.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2017 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e + +TOOLS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd ${TOOLS_DIR}/.. + +mkdir -p ./test/wasm-spec-tests/tests/ +rm -rf ./test/wasm-spec-tests/tests/* + +./tools/dev/gm.py x64.release all + +cd ${TOOLS_DIR}/../test/wasm-js/interpreter +make + +cd ${TOOLS_DIR}/../test/wasm-js/test/core + +./run.py --wasm ${TOOLS_DIR}/../test/wasm-js/interpreter/wasm --js ${TOOLS_DIR}/../out/x64.release/d8 + +cp ${TOOLS_DIR}/../test/wasm-js/test/core/output/*.js ${TOOLS_DIR}/../test/wasm-spec-tests/tests + +cd ${TOOLS_DIR}/../test/wasm-spec-tests +upload_to_google_storage.py -a -b v8-wasm-spec-tests tests + +