Reviewers: bbudge, Michael Achenbach,

Description:
Make simdjs tests redownload on a revision change.

LOG=N
BUG=None
TEST=manual,local
[email protected],[email protected]

Please review this at https://codereview.chromium.org/1240453003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+25, -0 lines):
  M test/simdjs/testcfg.py


Index: test/simdjs/testcfg.py
diff --git a/test/simdjs/testcfg.py b/test/simdjs/testcfg.py
index c0390afd65ea2f38da8f4bc1191863bcd38bd91e..29012fcc67b80ef8d128527f260f3ed3c4002d1b 100644
--- a/test/simdjs/testcfg.py
+++ b/test/simdjs/testcfg.py
@@ -65,10 +65,30 @@ class SimdJsTestSuite(testsuite.TestSuite):
   def DownloadData(self):
     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")
+    versionfile = os.path.join(self.root, "CHECKED_OUT_VERSION")
+
+    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):
+        os.remove(archive_name)
+
     if not os.path.exists(archive_name):
       print "Downloading test data from %s ..." % archive_url
       utils.URLRetrieve(archive_url, archive_name)
@@ -96,6 +116,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')
+        f.write(archive_url + '\n')
+        f.write(revision + '\n')
+

 def GetSuite(name, root):
   return SimdJsTestSuite(name, root)


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to