summaryrefslogtreecommitdiff
path: root/deps/v8/test/test262/testcfg.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/test262/testcfg.py')
-rw-r--r--deps/v8/test/test262/testcfg.py47
1 files changed, 27 insertions, 20 deletions
diff --git a/deps/v8/test/test262/testcfg.py b/deps/v8/test/test262/testcfg.py
index 294b39c916..07f760c8d7 100644
--- a/deps/v8/test/test262/testcfg.py
+++ b/deps/v8/test/test262/testcfg.py
@@ -1,4 +1,4 @@
-# Copyright 2011 the V8 project authors. All rights reserved.
+# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@@ -31,11 +31,12 @@ import os
from os.path import join, exists
import urllib
import hashlib
+import sys
import tarfile
-TEST_262_ARCHIVE_REVISION = '3a890174343c' # This is the r309 revision.
-TEST_262_ARCHIVE_MD5 = 'be5d4cfbe69cef70430907b8f3a92b50'
+TEST_262_ARCHIVE_REVISION = 'fb327c439e20' # This is the r334 revision.
+TEST_262_ARCHIVE_MD5 = '307acd166ec34629592f240dc12d57ed'
TEST_262_URL = 'http://hg.ecmascript.org/tests/test262/archive/%s.tar.bz2'
TEST_262_HARNESS = ['sta.js']
@@ -103,23 +104,29 @@ class Test262TestConfiguration(test.TestConfiguration):
revision = TEST_262_ARCHIVE_REVISION
archive_url = TEST_262_URL % revision
archive_name = join(self.root, 'test262-%s.tar.bz2' % revision)
- directory_name = join(self.root, "test262-%s" % revision)
- if not exists(directory_name) or not exists(archive_name):
- if not exists(archive_name):
- print "Downloading test data from %s ..." % archive_url
- urllib.urlretrieve(archive_url, archive_name)
- if not exists(directory_name):
- print "Extracting test262-%s.tar.bz2 ..." % revision
- md5 = hashlib.md5()
- with open(archive_name,'rb') as f:
- for chunk in iter(lambda: f.read(8192), ''):
- md5.update(chunk)
- if md5.hexdigest() != TEST_262_ARCHIVE_MD5:
- raise Exception("Hash mismatch of test data file")
- archive = tarfile.open(archive_name, 'r:bz2')
- archive.extractall(join(self.root))
- if not exists(join(self.root, 'data')):
- os.symlink(directory_name, join(self.root, 'data'))
+ directory_name = join(self.root, 'data')
+ directory_old_name = join(self.root, 'data.old')
+ if not exists(archive_name):
+ print "Downloading test data from %s ..." % archive_url
+ urllib.urlretrieve(archive_url, archive_name)
+ if exists(directory_name):
+ os.rename(directory_name, directory_old_name)
+ if not exists(directory_name):
+ print "Extracting test262-%s.tar.bz2 ..." % revision
+ md5 = hashlib.md5()
+ with open(archive_name,'rb') as f:
+ for chunk in iter(lambda: f.read(8192), ''):
+ md5.update(chunk)
+ if md5.hexdigest() != TEST_262_ARCHIVE_MD5:
+ os.remove(archive_name)
+ raise Exception("Hash mismatch of test data file")
+ archive = tarfile.open(archive_name, 'r:bz2')
+ 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(join(self.root, 'test262-%s' % revision), directory_name)
def GetBuildRequirements(self):
return ['d8']