Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: test/simdjs/testcfg.py

Issue 1240453003: Make simdjs tests redownload on a revision change. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/simdjs/testcfg.py
diff --git a/test/simdjs/testcfg.py b/test/simdjs/testcfg.py
index c0390afd65ea2f38da8f4bc1191863bcd38bd91e..66f0cce0811537a37165b858732bbfe212564a64 100644
--- a/test/simdjs/testcfg.py
+++ b/test/simdjs/testcfg.py
@@ -65,10 +65,44 @@ class SimdJsTestSuite(testsuite.TestSuite):
def DownloadData(self):
revision = SIMDJS_ARCHIVE_REVISION
archive_url = SIMDJS_URL % revision
+
+ archive_prefix = "ecmascript_simd-"
archive_name = os.path.join(
- self.root, "ecmascript_simd-%s.tar.gz" % revision)
+ 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")
+ versionfile = os.path.join(self.root, "CHECKED_OUT_VERSION")
Michael Achenbach 2015/07/23 21:05:13 Maybe this file needs to be added to the .gitignor
+
+ 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)
+ if f.startswith(archive_prefix)]
+ if (len(archive_files) > 1 or
+ os.path.basename(archive_name) not in archive_files):
+ print "Clobber outdated test archives ..."
+ for f in archive_files:
+ print "Removing %s" % 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)
@@ -96,6 +130,11 @@ class SimdJsTestSuite(testsuite.TestSuite):
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')
Michael Achenbach 2015/07/23 21:05:13 Maybe the line splitting doesn't work as expected?
+ f.write(archive_url + '\n')
+ f.write(revision + '\n')
+
def GetSuite(name, root):
return SimdJsTestSuite(name, root)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698