Index: test/simdjs/testcfg.py |
diff --git a/test/test262/testcfg.py b/test/simdjs/testcfg.py |
similarity index 63% |
copy from test/test262/testcfg.py |
copy to test/simdjs/testcfg.py |
index de3c9ad7b9f3645b7081806e137f133884ef3c31..221eb7eb91f17bd8ea4db6e688647fb1948dae9a 100644 |
--- a/test/test262/testcfg.py |
+++ b/test/simdjs/testcfg.py |
@@ -1,4 +1,4 @@ |
-# Copyright 2012 the V8 project authors. All rights reserved. |
+# Copyright 2015 the V8 project authors. All rights reserved. |
Michael Achenbach
2015/05/19 07:17:48
Please use shorter licence headers as in
https://c
bradn
2015/05/19 09:37:53
Done.
|
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions are |
# met: |
@@ -31,49 +31,38 @@ import os |
import shutil |
import sys |
import tarfile |
+import imp |
from testrunner.local import testsuite |
from testrunner.local import utils |
from testrunner.objects import testcase |
+SIMDJS_ARCHIVE_REVISION = "07e2713e0c9ea19feb0732d5bd84770c87310d79" |
+SIMDJS_ARCHIVE_MD5 = "cf6bddf99f18800b68e782054268ee3c" |
+SIMDJS_URL = ( |
+ "https://github.com/johnmccutchan/ecmascript_simd/archive/%s.tar.gz") |
-TEST_262_ARCHIVE_REVISION = "fbba29f" # This is the r365 revision. |
-TEST_262_ARCHIVE_MD5 = "e1ff0db438cc12de8fb6da80621b4ef6" |
-TEST_262_URL = "https://github.com/tc39/test262/tarball/%s" |
-TEST_262_HARNESS = ["sta.js", "testBuiltInObject.js", "testIntl.js"] |
+SIMDJS_SUITE_PATH = ["data", "src"] |
-class Test262TestSuite(testsuite.TestSuite): |
+class SimdJsTestSuite(testsuite.TestSuite): |
def __init__(self, name, root): |
- super(Test262TestSuite, self).__init__(name, root) |
- self.testroot = os.path.join(root, "data", "test", "suite") |
- self.harness = [os.path.join(self.root, "data", "test", "harness", f) |
- for f in TEST_262_HARNESS] |
- self.harness += [os.path.join(self.root, "harness-adapt.js")] |
- |
- def CommonTestName(self, testcase): |
- return testcase.path.split(os.path.sep)[-1] |
+ super(SimdJsTestSuite, self).__init__(name, root) |
+ self.testroot = os.path.join(self.root, *SIMDJS_SUITE_PATH) |
+ self.ParseTestRecord = None |
def ListTests(self, context): |
- tests = [] |
- for dirname, dirs, files in os.walk(self.testroot): |
- for dotted in [x for x in dirs if x.startswith(".")]: |
- dirs.remove(dotted) |
- if context.noi18n and "intl402" in dirs: |
- dirs.remove("intl402") |
- dirs.sort() |
- files.sort() |
- for filename in files: |
- if filename.endswith(".js"): |
- testname = os.path.join(dirname[len(self.testroot) + 1:], |
- filename[:-3]) |
- case = testcase.TestCase(self, testname) |
- tests.append(case) |
+ tests = [ |
Michael Achenbach
2015/05/19 07:17:48
This wraps another runner? Is there a way to get t
bradn
2015/05/19 09:37:53
Ah, good point.
I've changed it round to expose th
|
+ testcase.TestCase(self, 'shell_test_runner'), |
+ testcase.TestCase(self, 'benchmarks/run'), |
+ ] |
return tests |
def GetFlagsForTestCase(self, testcase, context): |
- return (testcase.flags + context.mode_flags + self.harness + |
+ return (testcase.flags + context.mode_flags + |
+ [os.path.join(self.root, "harness-adapt.js")] + |
+ ["--harmony"] + |
[os.path.join(self.testroot, testcase.path + ".js")]) |
def GetSourceForTest(self, testcase): |
@@ -82,7 +71,7 @@ class Test262TestSuite(testsuite.TestSuite): |
return f.read() |
def IsNegativeTest(self, testcase): |
- return "@negative" in self.GetSourceForTest(testcase) |
+ return False |
def IsFailureOutput(self, output, testpath): |
if output.exit_code != 0: |
@@ -90,9 +79,10 @@ class Test262TestSuite(testsuite.TestSuite): |
return "FAILED!" in output.stdout |
def DownloadData(self): |
- revision = TEST_262_ARCHIVE_REVISION |
- archive_url = TEST_262_URL % revision |
- archive_name = os.path.join(self.root, "tc39-test262-%s.tar.gz" % revision) |
+ revision = SIMDJS_ARCHIVE_REVISION |
+ archive_url = SIMDJS_URL % revision |
+ archive_name = os.path.join( |
+ self.root, "ecmascript_simd-%s.tar.gz" % revision) |
directory_name = os.path.join(self.root, "data") |
directory_old_name = os.path.join(self.root, "data.old") |
if not os.path.exists(archive_name): |
@@ -103,23 +93,25 @@ class Test262TestSuite(testsuite.TestSuite): |
shutil.rmtree(directory_old_name) |
os.rename(directory_name, directory_old_name) |
if not os.path.exists(directory_name): |
- print "Extracting test262-%s.tar.gz ..." % revision |
+ print "Extracting ecmascript_simd-%s.tar.gz ..." % revision |
md5 = hashlib.md5() |
with open(archive_name, "rb") as f: |
for chunk in iter(lambda: f.read(8192), ""): |
md5.update(chunk) |
- if md5.hexdigest() != TEST_262_ARCHIVE_MD5: |
+ print "MD5 hash is %s" % md5.hexdigest() |
+ if md5.hexdigest() != SIMDJS_ARCHIVE_MD5: |
os.remove(archive_name) |
- raise Exception("Hash mismatch of test data file") |
+ print "MD5 expected %s" % SIMDJS_ARCHIVE_MD5 |
+ raise Exception("MD5 hash mismatch of test data file") |
archive = tarfile.open(archive_name, "r:gz") |
if sys.platform in ("win32", "cygwin"): |
# Magic incantation to allow longer path names on Windows. |
archive.extractall(u"\\\\?\\%s" % self.root) |
else: |
archive.extractall(self.root) |
- os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), |
+ os.rename(os.path.join(self.root, "ecmascript_simd-%s" % revision), |
directory_name) |
def GetSuite(name, root): |
- return Test262TestSuite(name, root) |
+ return SimdJsTestSuite(name, root) |