| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 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 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 if output.exit_code != 0: | 124 if output.exit_code != 0: |
| 125 return True | 125 return True |
| 126 return "FAILED!" in output.stdout | 126 return "FAILED!" in output.stdout |
| 127 | 127 |
| 128 def DownloadData(self): | 128 def DownloadData(self): |
| 129 revision = TEST_262_ARCHIVE_REVISION | 129 revision = TEST_262_ARCHIVE_REVISION |
| 130 archive_url = TEST_262_URL % revision | 130 archive_url = TEST_262_URL % revision |
| 131 archive_name = os.path.join(self.root, "tc39-test262-%s.tar.gz" % revision) | 131 archive_name = os.path.join(self.root, "tc39-test262-%s.tar.gz" % revision) |
| 132 directory_name = os.path.join(self.root, "data") | 132 directory_name = os.path.join(self.root, "data") |
| 133 directory_old_name = os.path.join(self.root, "data.old") | 133 directory_old_name = os.path.join(self.root, "data.old") |
| 134 |
| 135 # Clobber if the test is in an outdated state, i.e. if there are any other |
| 136 # archive files present. |
| 137 archive_files = [f for f in os.listdir(self.root) |
| 138 if f.startswith("tc39-test262-")] |
| 139 if len(archive_files) > 1 or archive_name not in archive_files: |
| 140 print "Clobber outdated test archives ..." |
| 141 for f in archive_files: |
| 142 os.remove(os.path.join(self.root, f)) |
| 143 |
| 134 if not os.path.exists(archive_name): | 144 if not os.path.exists(archive_name): |
| 135 print "Downloading test data from %s ..." % archive_url | 145 print "Downloading test data from %s ..." % archive_url |
| 136 utils.URLRetrieve(archive_url, archive_name) | 146 utils.URLRetrieve(archive_url, archive_name) |
| 137 if os.path.exists(directory_name): | 147 if os.path.exists(directory_name): |
| 138 if os.path.exists(directory_old_name): | 148 if os.path.exists(directory_old_name): |
| 139 shutil.rmtree(directory_old_name) | 149 shutil.rmtree(directory_old_name) |
| 140 os.rename(directory_name, directory_old_name) | 150 os.rename(directory_name, directory_old_name) |
| 141 if not os.path.exists(directory_name): | 151 if not os.path.exists(directory_name): |
| 142 print "Extracting test262-%s.tar.gz ..." % revision | 152 print "Extracting test262-%s.tar.gz ..." % revision |
| 143 md5 = hashlib.md5() | 153 md5 = hashlib.md5() |
| (...skipping 10 matching lines...) Expand all Loading... |
| 154 # Magic incantation to allow longer path names on Windows. | 164 # Magic incantation to allow longer path names on Windows. |
| 155 archive.extractall(u"\\\\?\\%s" % self.root) | 165 archive.extractall(u"\\\\?\\%s" % self.root) |
| 156 else: | 166 else: |
| 157 archive.extractall(self.root) | 167 archive.extractall(self.root) |
| 158 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), | 168 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), |
| 159 directory_name) | 169 directory_name) |
| 160 | 170 |
| 161 | 171 |
| 162 def GetSuite(name, root): | 172 def GetSuite(name, root): |
| 163 return Test262TestSuite(name, root) | 173 return Test262TestSuite(name, root) |
| OLD | NEW |