Commit 4da32d50 authored by machenbach's avatar machenbach Committed by Commit bot

[test] Pull simdjs as a dependency.

BUG=chromium:535160
LOG=n

Review URL: https://codereview.chromium.org/1407813004

Cr-Commit-Position: refs/heads/master@{#31291}
parent cad73fcb
...@@ -60,9 +60,7 @@ shell_g ...@@ -60,9 +60,7 @@ shell_g
/test/promises-aplus/promises-tests /test/promises-aplus/promises-tests
/test/promises-aplus/promises-tests.tar.gz /test/promises-aplus/promises-tests.tar.gz
/test/promises-aplus/sinon /test/promises-aplus/sinon
/test/simdjs/CHECKED_OUT_* /test/simdjs/data
/test/simdjs/ecmascript_simd*
/test/simdjs/data*
/test/test262/data /test/test262/data
/testing/gmock /testing/gmock
/testing/gtest /testing/gtest
......
...@@ -19,6 +19,7 @@ deps = { ...@@ -19,6 +19,7 @@ deps = {
Var("git_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87", Var("git_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87",
"v8/testing/gmock": "v8/testing/gmock":
Var("git_url") + "/external/googlemock.git" + "@" + "0421b6f358139f02e102c9c332ce19a33faf75be", Var("git_url") + "/external/googlemock.git" + "@" + "0421b6f358139f02e102c9c332ce19a33faf75be",
"v8/test/simdjs/data": Var("git_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "c8ef63c728283debc25891123eb00482fee4b8cd",
"v8/test/test262/data": "v8/test/test262/data":
Var("git_url") + "/external/github.com/tc39/test262.git" + "@" + "26e6fd7c1779a63913cc7720cbc6c87b3b7b3285", Var("git_url") + "/external/github.com/tc39/test262.git" + "@" + "26e6fd7c1779a63913cc7720cbc6c87b3b7b3285",
"v8/tools/clang": "v8/tools/clang":
......
...@@ -3,21 +3,13 @@ ...@@ -3,21 +3,13 @@
# found in the LICENSE file. # found in the LICENSE file.
import hashlib
import os import os
import shutil import shutil
import sys import sys
import tarfile
import imp
from testrunner.local import testsuite from testrunner.local import testsuite
from testrunner.local import utils
from testrunner.objects import testcase from testrunner.objects import testcase
SIMDJS_ARCHIVE_REVISION = "c8ef63c728283debc25891123eb00482fee4b8cd"
SIMDJS_ARCHIVE_MD5 = "4c3120d1f5b8027b4a38b931119c89bd"
SIMDJS_URL = ("https://github.com/tc39/ecmascript_simd/archive/%s.tar.gz")
SIMDJS_SUITE_PATH = ["data", "src"] SIMDJS_SUITE_PATH = ["data", "src"]
...@@ -62,78 +54,20 @@ class SimdJsTestSuite(testsuite.TestSuite): ...@@ -62,78 +54,20 @@ class SimdJsTestSuite(testsuite.TestSuite):
return "FAILED!" in output.stdout return "FAILED!" in output.stdout
def DownloadData(self): def DownloadData(self):
revision = SIMDJS_ARCHIVE_REVISION print "SimdJs download is deprecated. It's part of DEPS."
archive_url = SIMDJS_URL % revision
archive_prefix = "ecmascript_simd-" # Clean up old directories and archive files.
archive_name = os.path.join(
self.root, "%s%s.tar.gz" % (archive_prefix, revision))
directory_name = os.path.join(self.root, "data")
directory_old_name = os.path.join(self.root, "data.old") directory_old_name = os.path.join(self.root, "data.old")
versionfile = os.path.join(self.root, "CHECKED_OUT_VERSION") if os.path.exists(directory_old_name):
shutil.rmtree(directory_old_name)
checked_out_version = None
checked_out_url = None
checked_out_revision = None
if os.path.exists(versionfile):
with open(versionfile) as f:
try:
(checked_out_version,
checked_out_url,
checked_out_revision) = f.read().splitlines()
except ValueError:
pass
if (checked_out_version != SIMDJS_ARCHIVE_MD5 or
checked_out_url != archive_url or
checked_out_revision != revision):
if os.path.exists(archive_name):
print "Clobbering %s because CHECK_OUT_VERSION is out of date" % (
archive_name)
os.remove(archive_name)
# Clobber if the test is in an outdated state, i.e. if there are any other
# archive files present.
archive_files = [f for f in os.listdir(self.root) archive_files = [f for f in os.listdir(self.root)
if f.startswith(archive_prefix)] if f.startswith("ecmascript_simd-")]
if (len(archive_files) > 1 or if len(archive_files) > 0:
os.path.basename(archive_name) not in archive_files):
print "Clobber outdated test archives ..." print "Clobber outdated test archives ..."
for f in archive_files: for f in archive_files:
print "Removing %s" % f
os.remove(os.path.join(self.root, f)) os.remove(os.path.join(self.root, f))
if not os.path.exists(archive_name):
print "Downloading test data from %s ..." % archive_url
utils.URLRetrieve(archive_url, archive_name)
if os.path.exists(directory_name):
if os.path.exists(directory_old_name):
shutil.rmtree(directory_old_name)
os.rename(directory_name, directory_old_name)
if not os.path.exists(directory_name):
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)
print "MD5 hash is %s" % md5.hexdigest()
if md5.hexdigest() != SIMDJS_ARCHIVE_MD5:
os.remove(archive_name)
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, "ecmascript_simd-%s" % revision),
directory_name)
with open(versionfile, "w") as f:
f.write(SIMDJS_ARCHIVE_MD5 + '\n')
f.write(archive_url + '\n')
f.write(revision + '\n')
def GetSuite(name, root): def GetSuite(name, root):
return SimdJsTestSuite(name, root) return SimdJsTestSuite(name, root)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment