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

Side by Side Diff: test/test262/archive.py

Issue 2131743002: [test262] Use standalone Test262 harness project (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: itertools.chain Created 4 years, 5 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 the V8 project authors. All rights reserved. 2 # Copyright 2016 the V8 project authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import os 6 import os
7 import sys 7 import sys
8 import tarfile 8 import tarfile
9 import time 9 import time
10 10
11 # In GN we expect the path to a stamp file as an argument. 11 # In GN we expect the path to a stamp file as an argument.
12 if len(sys.argv) == 2: 12 if len(sys.argv) == 2:
13 STAMP_FILE = os.path.abspath(sys.argv[1]) 13 STAMP_FILE = os.path.abspath(sys.argv[1])
14 14
15 os.chdir(os.path.dirname(os.path.abspath(__file__))) 15 os.chdir(os.path.dirname(os.path.abspath(__file__)))
16 16
17 # Workaround for slow grp and pwd calls. 17 # Workaround for slow grp and pwd calls.
18 tarfile.grp = None 18 tarfile.grp = None
19 tarfile.pwd = None 19 tarfile.pwd = None
20 20
21 def filter_git(tar_info): 21 def filter_git(tar_info):
22 if tar_info.name.startswith(os.path.join('data', '.git')): 22 if tar_info.name.startswith(os.path.join('data', '.git')) or \
23 tar_info.name.startswith(os.path.join('harness', '.git')):
23 return None 24 return None
24 else: 25 else:
25 tar_info.uname = tar_info.gname = "test262" 26 tar_info.uname = tar_info.gname = "test262"
26 return tar_info 27 return tar_info
27 28
28 with tarfile.open('data.tar', 'w') as tar: 29 with tarfile.open('data.tar', 'w') as tar:
29 tar.add('data', filter=filter_git) 30 tar.add('data', filter=filter_git)
31 tar.add('harness', filter=filter_git)
30 32
31 # Workaround for GN. We can't specify the tarfile as output because it's 33 # Workaround for GN. We can't specify the tarfile as output because it's
32 # not in the product directory. Therefore we track running of this script 34 # not in the product directory. Therefore we track running of this script
33 # with an extra stamp file in the product directory. 35 # with an extra stamp file in the product directory.
34 if len(sys.argv) == 2: 36 if len(sys.argv) == 2:
35 with open(STAMP_FILE, 'w') as f: 37 with open(STAMP_FILE, 'w') as f:
36 f.write(str(time.time())) 38 f.write(str(time.time()))
OLDNEW
« no previous file with comments | « DEPS ('k') | test/test262/list.py » ('j') | test/test262/testcfg.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698