Commit 53a33c28 authored by machenbach's avatar machenbach Committed by Commit bot

[test] Pull mozilla tests as a dependency.

BUG=chromium:535160
LOG=n

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

Cr-Commit-Position: refs/heads/master@{#31336}
parent 47c9e1c9
......@@ -53,10 +53,7 @@ shell_g
/test/benchmarks/kraken
/test/benchmarks/octane
/test/benchmarks/sunspider
/test/mozilla/CHECKED_OUT_VERSION
/test/mozilla/data
/test/mozilla/data.old
/test/mozilla/downloaded_*
/test/promises-aplus/promises-tests
/test/promises-aplus/promises-tests.tar.gz
/test/promises-aplus/sinon
......
......@@ -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/mozilla/data":
Var("git_url") + "/v8/deps/third_party/mozilla-tests.git" + "@" + "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be",
"v8/test/simdjs/data": Var("git_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "c8ef63c728283debc25891123eb00482fee4b8cd",
"v8/test/test262/data":
Var("git_url") + "/external/github.com/tc39/test262.git" + "@" + "26e6fd7c1779a63913cc7720cbc6c87b3b7b3285",
......
......@@ -29,16 +29,10 @@
import os
import shutil
import subprocess
import tarfile
from testrunner.local import testsuite
from testrunner.objects import testcase
SVN_SERVER = (
"svn://svn.chromium.org/chrome/trunk/deps/third_party/mozilla-tests")
MOZILLA_VERSION = "51236"
EXCLUDED = ["CVS", ".svn"]
......@@ -119,49 +113,19 @@ class MozillaTestSuite(testsuite.TestSuite):
return "FAILED!" in output.stdout
def DownloadData(self):
old_cwd = os.getcwd()
os.chdir(os.path.abspath(self.root))
# Maybe we're still up to date?
versionfile = "CHECKED_OUT_VERSION"
checked_out_version = None
if os.path.exists(versionfile):
with open(versionfile) as f:
checked_out_version = f.read()
if checked_out_version == MOZILLA_VERSION:
os.chdir(old_cwd)
return
# If we have a local archive file with the test data, extract it.
directory_name = "data"
directory_name_old = "data.old"
if os.path.exists(directory_name):
if os.path.exists(directory_name_old):
shutil.rmtree(directory_name_old)
os.rename(directory_name, directory_name_old)
archive_file = "downloaded_%s.tar.gz" % MOZILLA_VERSION
if os.path.exists(archive_file):
with tarfile.open(archive_file, "r:gz") as tar:
tar.extractall()
with open(versionfile, "w") as f:
f.write(MOZILLA_VERSION)
os.chdir(old_cwd)
return
# No cached copy. Check out via SVN, and pack as .tar.gz for later use.
command = ("svn co -r %s %s mozilla/js/tests" %
(MOZILLA_VERSION, SVN_SERVER))
code = subprocess.call(command, shell=True)
if code != 0:
os.chdir(old_cwd)
raise Exception("Error checking out Mozilla test suite!")
os.rename(os.path.join("mozilla", "js", "tests"), directory_name)
shutil.rmtree("mozilla")
with tarfile.open(archive_file, "w:gz") as tar:
tar.add("data")
with open(versionfile, "w") as f:
f.write(MOZILLA_VERSION)
os.chdir(old_cwd)
print "Mozilla 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)
archive_files = [f for f in os.listdir(self.root)
if f.startswith("downloaded_")]
if len(archive_files) > 0:
print "Clobber outdated test archives ..."
for f in archive_files:
os.remove(os.path.join(self.root, f))
def GetSuite(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