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

Side by Side Diff: tools-webrtc/check_package_boundaries_test.py

Issue 2695573003: Fix check_package_boundaries presubmit test for Windows. (Closed)
Patch Set: Created 3 years, 10 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 | « tools-webrtc/check_package_boundaries.py ('k') | 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license 5 # Use of this source code is governed by a BSD-style license
6 # that can be found in the LICENSE file in the root of the source 6 # that can be found in the LICENSE file in the root of the source
7 # tree. An additional intellectual property rights grant can be found 7 # tree. An additional intellectual property rights grant can be found
8 # in the file PATENTS. All contributing project authors may 8 # in the file PATENTS. All contributing project authors may
9 # be found in the AUTHORS file in the root of the source tree. 9 # be found in the AUTHORS file in the root of the source tree.
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 27
28 class Logger(object): 28 class Logger(object):
29 def __init__(self, test_dir): 29 def __init__(self, test_dir):
30 self.messages = [] 30 self.messages = []
31 self.test_dir = test_dir 31 self.test_dir = test_dir
32 32
33 def log(self, build_file_path, line_number, target_name, source_file, 33 def log(self, build_file_path, line_number, target_name, source_file,
34 subpackage): 34 subpackage):
35 build_file_path = os.path.relpath(build_file_path, self.test_dir) 35 build_file_path = os.path.relpath(build_file_path, self.test_dir)
36 build_file_path = build_file_path.replace(os.path.sep, '/')
36 self.messages.append([build_file_path, line_number, target_name, 37 self.messages.append([build_file_path, line_number, target_name,
37 source_file, subpackage]) 38 source_file, subpackage])
38 39
39 40
40 class UnitTest(unittest.TestCase): 41 class UnitTest(unittest.TestCase):
41 def RunTest(self, test_dir, check_all_build_files=False): 42 def RunTest(self, test_dir, check_all_build_files=False):
42 logger = Logger(test_dir) 43 logger = Logger(test_dir)
43 build_files = [os.path.join(test_dir, 'BUILD.gn')] 44 build_files = [os.path.join(test_dir, 'BUILD.gn')]
44 if check_all_build_files: 45 if check_all_build_files:
45 build_files = None 46 build_files = None
(...skipping 12 matching lines...) Expand all
58 59
59 def test_common_prefix(self): 60 def test_common_prefix(self):
60 self.RunTest(os.path.join(TESTDATA_DIR, 'common_prefix')) 61 self.RunTest(os.path.join(TESTDATA_DIR, 'common_prefix'))
61 62
62 def test_all_build_files(self): 63 def test_all_build_files(self):
63 self.RunTest(os.path.join(TESTDATA_DIR, 'all_build_files'), True) 64 self.RunTest(os.path.join(TESTDATA_DIR, 'all_build_files'), True)
64 65
65 66
66 if __name__ == '__main__': 67 if __name__ == '__main__':
67 unittest.main() 68 unittest.main()
OLDNEW
« no previous file with comments | « tools-webrtc/check_package_boundaries.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698