Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: test/test262-es6/testcfg.py

Issue 1177503005: [test] Fix test archive clobber. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 134
135 # Clobber if the test is in an outdated state, i.e. if there are any other 135 # Clobber if the test is in an outdated state, i.e. if there are any other
136 # archive files present. 136 # archive files present.
137 archive_files = [f for f in os.listdir(self.root) 137 archive_files = [f for f in os.listdir(self.root)
138 if f.startswith("tc39-test262-")] 138 if f.startswith("tc39-test262-")]
139 if len(archive_files) > 1 or archive_name not in archive_files: 139 if (len(archive_files) > 1 or
140 os.path.basename(archive_name) not in archive_files):
140 print "Clobber outdated test archives ..." 141 print "Clobber outdated test archives ..."
141 for f in archive_files: 142 for f in archive_files:
142 os.remove(os.path.join(self.root, f)) 143 os.remove(os.path.join(self.root, f))
143 144
144 if not os.path.exists(archive_name): 145 if not os.path.exists(archive_name):
145 print "Downloading test data from %s ..." % archive_url 146 print "Downloading test data from %s ..." % archive_url
146 utils.URLRetrieve(archive_url, archive_name) 147 utils.URLRetrieve(archive_url, archive_name)
147 if os.path.exists(directory_name): 148 if os.path.exists(directory_name):
148 if os.path.exists(directory_old_name): 149 if os.path.exists(directory_old_name):
149 shutil.rmtree(directory_old_name) 150 shutil.rmtree(directory_old_name)
(...skipping 14 matching lines...) Expand all
164 # Magic incantation to allow longer path names on Windows. 165 # Magic incantation to allow longer path names on Windows.
165 archive.extractall(u"\\\\?\\%s" % self.root) 166 archive.extractall(u"\\\\?\\%s" % self.root)
166 else: 167 else:
167 archive.extractall(self.root) 168 archive.extractall(self.root)
168 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), 169 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision),
169 directory_name) 170 directory_name)
170 171
171 172
172 def GetSuite(name, root): 173 def GetSuite(name, root):
173 return Test262TestSuite(name, root) 174 return Test262TestSuite(name, root)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698