OLD | NEW |
---|---|
1 # Copyright 2011 the V8 project authors. All rights reserved. | 1 # Copyright 2011 the V8 project authors. All rights reserved. |
Jakob Kummerow
2012/03/28 08:06:10
2012
Michael Starzinger
2012/03/28 09:29:29
Done.
| |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
11 # with the distribution. | 11 # with the distribution. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 if self.Contains(path, test_path): | 96 if self.Contains(path, test_path): |
97 test = Test262TestCase(join(root, file), test_path, self.context, | 97 test = Test262TestCase(join(root, file), test_path, self.context, |
98 self.root, mode, harness) | 98 self.root, mode, harness) |
99 tests.append(test) | 99 tests.append(test) |
100 return tests | 100 return tests |
101 | 101 |
102 def DownloadData(self): | 102 def DownloadData(self): |
103 revision = TEST_262_ARCHIVE_REVISION | 103 revision = TEST_262_ARCHIVE_REVISION |
104 archive_url = TEST_262_URL % revision | 104 archive_url = TEST_262_URL % revision |
105 archive_name = join(self.root, 'test262-%s.tar.bz2' % revision) | 105 archive_name = join(self.root, 'test262-%s.tar.bz2' % revision) |
106 directory_name = join(self.root, "test262-%s" % revision) | 106 directory_name = join(self.root, 'data') |
107 if not exists(directory_name) or not exists(archive_name): | 107 if not exists(archive_name): |
108 if not exists(archive_name): | 108 print "Downloading test data from %s ..." % archive_url |
109 print "Downloading test data from %s ..." % archive_url | 109 urllib.urlretrieve(archive_url, archive_name) |
110 urllib.urlretrieve(archive_url, archive_name) | 110 if not exists(directory_name): |
111 if not exists(directory_name): | 111 print "Extracting test262-%s.tar.bz2 ..." % revision |
112 print "Extracting test262-%s.tar.bz2 ..." % revision | 112 md5 = hashlib.md5() |
113 md5 = hashlib.md5() | 113 with open(archive_name,'rb') as f: |
114 with open(archive_name,'rb') as f: | 114 for chunk in iter(lambda: f.read(8192), ''): |
115 for chunk in iter(lambda: f.read(8192), ''): | 115 md5.update(chunk) |
116 md5.update(chunk) | 116 if md5.hexdigest() != TEST_262_ARCHIVE_MD5: |
117 if md5.hexdigest() != TEST_262_ARCHIVE_MD5: | 117 raise Exception("Hash mismatch of test data file") |
118 raise Exception("Hash mismatch of test data file") | 118 archive = tarfile.open(archive_name, 'r:bz2') |
119 archive = tarfile.open(archive_name, 'r:bz2') | 119 archive.extractall(join(self.root)) |
120 archive.extractall(join(self.root)) | 120 os.rename(join(self.root, 'test262-%s' % revision), directory_name) |
121 if not exists(join(self.root, 'data')): | |
122 os.symlink(directory_name, join(self.root, 'data')) | |
123 | 121 |
124 def GetBuildRequirements(self): | 122 def GetBuildRequirements(self): |
125 return ['d8'] | 123 return ['d8'] |
126 | 124 |
127 def GetTestStatus(self, sections, defs): | 125 def GetTestStatus(self, sections, defs): |
128 status_file = join(self.root, 'test262.status') | 126 status_file = join(self.root, 'test262.status') |
129 if exists(status_file): | 127 if exists(status_file): |
130 test.ReadConfigurationInto(status_file, sections, defs) | 128 test.ReadConfigurationInto(status_file, sections, defs) |
131 | 129 |
132 | 130 |
133 def GetConfiguration(context, root): | 131 def GetConfiguration(context, root): |
134 return Test262TestConfiguration(context, root) | 132 return Test262TestConfiguration(context, root) |
OLD | NEW |