Commit 2b87016a authored by machenbach's avatar machenbach Committed by Commit bot

[test] Pull test262 as a dependency.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#31182}
parent cfe7c9c5
......@@ -64,11 +64,6 @@ shell_g
/test/simdjs/ecmascript_simd*
/test/simdjs/data*
/test/test262/data
/test/test262/data.old
/test/test262/tc39-test262-*
/test/test262-es6/data
/test/test262-es6/data.old
/test/test262-es6/tc39-test262-*
/testing/gmock
/testing/gtest
/third_party
......
......@@ -19,6 +19,8 @@ deps = {
Var("git_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87",
"v8/testing/gmock":
Var("git_url") + "/external/googlemock.git" + "@" + "0421b6f358139f02e102c9c332ce19a33faf75be",
"v8/test/test262/data":
Var("git_url") + "/external/github.com/tc39/test262.git" + "@" + "26e6fd7c1779a63913cc7720cbc6c87b3b7b3285",
"v8/tools/clang":
Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "ee2cf312005aa4d47268041d36bfc50921afea29",
}
......
This directory contains code for binding the test262 test suite
into the v8 test harness. To use the tests check out the test262
tests from
into the v8 test harness. The tests are checked out as a dependency from
https://github.com/tc39/test262
https://chromium.googlesource.com/external/github.com/tc39/test262
at hash c6ac390 (2015/07/06 revision) as 'data' in this directory. Using later
version may be possible but the tests are only known to pass (and indeed run)
with that revision.
at hash 26e6fd7 (2015/10/01 revision) as 'data' in this directory. They are
fetched with 'gclient sync'. To update to a newer version, please change the
DEPS file.
Using a newer version, e.g. 'deadbeef' may be possible but the tests are only
known to pass (and indeed run) with that revision. Example:
git clone https://github.com/tc39/test262 data
cd data
git checkout c6ac390
git fetch
git checkout deadbeef
If you do update to a newer revision you may have to change the test
harness adapter code since it uses internal functionality from the
......
......@@ -39,10 +39,6 @@ from testrunner.local import testsuite
from testrunner.local import utils
from testrunner.objects import testcase
# The revision hash needs to be 7 characters?
TEST_262_ARCHIVE_REVISION = "26e6fd7" # This is the 2015-10-1 revision.
TEST_262_ARCHIVE_MD5 = "36fdd27f026f396234132fb5afdcfffb"
TEST_262_URL = "https://github.com/tc39/test262/tarball/%s"
TEST_262_HARNESS_FILES = ["sta.js", "assert.js"]
TEST_262_SUITE_PATH = ["data", "test"]
......@@ -196,49 +192,20 @@ class Test262TestSuite(testsuite.TestSuite):
return not outcome in (testcase.outcomes or [statusfile.PASS])
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)
directory_name = os.path.join(self.root, "data")
print "Test262 download is deprecated. It's part of DEPS."
# Clean up old directories and archive files.
directory_old_name = os.path.join(self.root, "data.old")
if os.path.exists(directory_old_name):
shutil.rmtree(directory_old_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)
if f.startswith("tc39-test262-")]
if (len(archive_files) > 1 or
os.path.basename(archive_name) not in archive_files):
if len(archive_files) > 0:
print "Clobber outdated test archives ..."
for f in archive_files:
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 test262-%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() != TEST_262_ARCHIVE_MD5:
os.remove(archive_name)
print "MD5 expected %s" % TEST_262_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),
directory_name)
def GetSuite(name, root):
return Test262TestSuite(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