Reviewers: Jakob,

Message:
PTAL


https://codereview.chromium.org/1226803002/diff/1/test/test262/testcfg.py
File test/test262/testcfg.py (right):

https://codereview.chromium.org/1226803002/diff/1/test/test262/testcfg.py#newcode99
test/test262/testcfg.py:99: # Clobber if the test is in an outdated
state, i.e. if there are any other
Copied from test262-es6

Description:
[test] Port clobber of old test262 archive files.

BUG=v8:4254
LOG=n
NOTRY=true
[email protected]

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

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

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


Index: test/test262/testcfg.py
diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py
index de3c9ad7b9f3645b7081806e137f133884ef3c31..a0c2cd6568232524ad00742ec81eaa91bf1c3ef1 100644
--- a/test/test262/testcfg.py
+++ b/test/test262/testcfg.py
@@ -95,6 +95,17 @@ class Test262TestSuite(testsuite.TestSuite):
archive_name = os.path.join(self.root, "tc39-test262-%s.tar.gz" % revision)
     directory_name = os.path.join(self.root, "data")
     directory_old_name = os.path.join(self.root, "data.old")
+
+ # 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):
+      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)
@@ -108,8 +119,10 @@ class Test262TestSuite(testsuite.TestSuite):
       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("Hash mismatch of test data file")
       archive = tarfile.open(archive_name, "r:gz")
       if sys.platform in ("win32", "cygwin"):


--
--
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