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

Side by Side Diff: tests/run_isolated/regen_test_data.py

Issue 19917006: Move all googletest related scripts into googletest/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/swarm_client
Patch Set: Remove unnecessary pylint warning disable Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/run_isolated/gtest_fake.py ('k') | tests/run_isolated_smoke_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium 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 """Regenerates all the .isolated test data files. 6 """Regenerates all the .isolated test data files.
7 7
8 Keep in sync with ../run_isolated_smoke_test.py. 8 Keep in sync with ../run_isolated_smoke_test.py.
9 """ 9 """
10 10
11 import glob 11 import glob
12 import hashlib 12 import hashlib
13 import json 13 import json
14 import os 14 import os
15 import sys 15 import sys
16 16
17 ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) 17 ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
18 18
19 19
20 # Ordering is important to keep this script simple. 20 # Ordering is important to keep this script simple.
21 INCLUDES_TO_FIX = [ 21 INCLUDES_TO_FIX = [
22 ('manifest2.isolated', ['manifest1.isolated']), 22 ('manifest2.isolated', ['manifest1.isolated']),
23 ('check_files.isolated', ['gtest_fake.isolated', 'manifest2.isolated']), 23 ('check_files.isolated', ['manifest2.isolated', 'repeated_files.isolated']),
24 ] 24 ]
25 25
26 26
27 def sha1(filename): 27 def sha1(filename):
28 with open(filename, 'rb') as f: 28 with open(filename, 'rb') as f:
29 return hashlib.sha1(f.read()).hexdigest() 29 return hashlib.sha1(f.read()).hexdigest()
30 30
31 31
32 def load(filename): 32 def load(filename):
33 with open(filename, 'r') as f: 33 with open(filename, 'r') as f:
(...skipping 24 matching lines...) Expand all
58 # Then update the SHA-1s. 58 # Then update the SHA-1s.
59 for manifest, includes in INCLUDES_TO_FIX: 59 for manifest, includes in INCLUDES_TO_FIX:
60 data = load(manifest) 60 data = load(manifest)
61 data['includes'] = [sha1(f) for f in includes] 61 data['includes'] = [sha1(f) for f in includes]
62 save(manifest, data) 62 save(manifest, data)
63 return 0 63 return 0
64 64
65 65
66 if __name__ == '__main__': 66 if __name__ == '__main__':
67 sys.exit(main()) 67 sys.exit(main())
OLDNEW
« no previous file with comments | « tests/run_isolated/gtest_fake.py ('k') | tests/run_isolated_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698