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

Side by Side Diff: tools/clang/scripts/test_tool.py

Issue 2609473002: Renaming blink method names inside gmock's EXPECT_CALL macro invocation. (Closed)
Patch Set: Make SourceFileCallbacks's constructor explicit. Created 3 years, 11 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/clang/scripts/run_tool.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 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 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 """Test harness for chromium clang tools.""" 6 """Test harness for chromium clang tools."""
7 7
8 import difflib 8 import difflib
9 import glob 9 import glob
10 import json 10 import json
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 'compile_commands.json') 112 'compile_commands.json')
113 source_files = glob.glob(os.path.join(test_directory_for_tool, 113 source_files = glob.glob(os.path.join(test_directory_for_tool,
114 '*-original.cc')) 114 '*-original.cc'))
115 actual_files = ['-'.join([source_file.rsplit('-', 1)[0], 'actual.cc']) 115 actual_files = ['-'.join([source_file.rsplit('-', 1)[0], 'actual.cc'])
116 for source_file in source_files] 116 for source_file in source_files]
117 expected_files = ['-'.join([source_file.rsplit('-', 1)[0], 'expected.cc']) 117 expected_files = ['-'.join([source_file.rsplit('-', 1)[0], 'expected.cc'])
118 for source_file in source_files] 118 for source_file in source_files]
119 include_paths = [] 119 include_paths = []
120 include_paths.append( 120 include_paths.append(
121 os.path.realpath(os.path.join(tools_clang_directory, '../..'))) 121 os.path.realpath(os.path.join(tools_clang_directory, '../..')))
122 # Many gtest headers expect to have testing/gtest/include in the include 122 # Many gtest and gmock headers expect to have testing/gtest/include and/or
123 # search path. 123 # testing/gmock/include in the include search path.
124 include_paths.append( 124 include_paths.append(
125 os.path.realpath(os.path.join(tools_clang_directory, 125 os.path.realpath(os.path.join(tools_clang_directory,
126 '../..', 126 '../..',
127 'testing/gtest/include'))) 127 'testing/gtest/include')))
128 include_paths.append(
129 os.path.realpath(os.path.join(tools_clang_directory,
130 '../..',
131 'testing/gmock/include')))
128 132
129 if len(actual_files) == 0: 133 if len(actual_files) == 0:
130 print 'Tool "%s" does not have compatible test files.' % tool_to_test 134 print 'Tool "%s" does not have compatible test files.' % tool_to_test
131 return 1 135 return 1
132 136
133 # Set up the test environment. 137 # Set up the test environment.
134 for source, actual in zip(source_files, actual_files): 138 for source, actual in zip(source_files, actual_files):
135 shutil.copyfile(source, actual) 139 shutil.copyfile(source, actual)
136 # Generate a temporary compilation database to run the tool over. 140 # Generate a temporary compilation database to run the tool over.
137 with open(compile_database, 'w') as f: 141 with open(compile_database, 'w') as f:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 print '[==========] %s ran.' % _NumberOfTestsToString(len(source_files)) 177 print '[==========] %s ran.' % _NumberOfTestsToString(len(source_files))
174 if passed > 0: 178 if passed > 0:
175 print '[ PASSED ] %s.' % _NumberOfTestsToString(passed) 179 print '[ PASSED ] %s.' % _NumberOfTestsToString(passed)
176 if failed > 0: 180 if failed > 0:
177 print '[ FAILED ] %s.' % _NumberOfTestsToString(failed) 181 print '[ FAILED ] %s.' % _NumberOfTestsToString(failed)
178 return 1 182 return 1
179 183
180 184
181 if __name__ == '__main__': 185 if __name__ == '__main__':
182 sys.exit(main(sys.argv[1:])) 186 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « tools/clang/scripts/run_tool.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698