| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 import argparse | 6 import argparse |
| 7 import os | 7 import os |
| 8 import subprocess | 8 import subprocess |
| 9 import sys | 9 import sys |
| 10 | 10 |
| 11 script_dir = os.path.dirname(os.path.realpath(__file__)) | 11 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 12 tool_dir = os.path.abspath(os.path.join(script_dir, '../../pylib')) | 12 tool_dir = os.path.abspath(os.path.join(script_dir, '../../pylib')) |
| 13 sys.path.insert(0, tool_dir) | 13 sys.path.insert(0, tool_dir) |
| 14 | 14 |
| 15 from clang import plugin_testing | 15 from clang import plugin_testing |
| 16 | 16 |
| 17 | 17 |
| 18 class ChromeStylePluginTest(plugin_testing.ClangPluginTest): | 18 class ChromeStylePluginTest(plugin_testing.ClangPluginTest): |
| 19 """Test harness for the Chrome style plugin.""" | 19 """Test harness for the Chrome style plugin.""" |
| 20 | 20 |
| 21 def AdjustClangArguments(self, clang_cmd): | 21 def AdjustClangArguments(self, clang_cmd): |
| 22 self.AddPluginArg(clang_cmd, 'follow-macro-expansion') | |
| 23 clang_cmd.extend([ | 22 clang_cmd.extend([ |
| 24 # Skip code generation | 23 # Skip code generation |
| 25 '-fsyntax-only', | 24 '-fsyntax-only', |
| 26 # Fake system directory for tests | 25 # Fake system directory for tests |
| 27 '-isystem', os.path.join(os.getcwd(), 'system'), | 26 '-isystem', os.path.join(os.getcwd(), 'system'), |
| 28 '-Wno-inconsistent-missing-override', | 27 '-Wno-inconsistent-missing-override', |
| 29 ]) | 28 ]) |
| 30 | 29 |
| 31 | 30 |
| 32 def main(): | 31 def main(): |
| (...skipping 11 matching lines...) Expand all Loading... |
| 44 return ChromeStylePluginTest( | 43 return ChromeStylePluginTest( |
| 45 os.path.dirname(os.path.realpath(__file__)), | 44 os.path.dirname(os.path.realpath(__file__)), |
| 46 args.clang_path, | 45 args.clang_path, |
| 47 args.plugin_path, | 46 args.plugin_path, |
| 48 'find-bad-constructs', | 47 'find-bad-constructs', |
| 49 args.reset_results).Run() | 48 args.reset_results).Run() |
| 50 | 49 |
| 51 | 50 |
| 52 if __name__ == '__main__': | 51 if __name__ == '__main__': |
| 53 sys.exit(main()) | 52 sys.exit(main()) |
| OLD | NEW |