OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 BlinkGcPluginTest(plugin_testing.ClangPluginTest): | 18 class BlinkGcPluginTest(plugin_testing.ClangPluginTest): |
19 """Test harness for the Blink GC plugin.""" | 19 """Test harness for the Blink GC plugin.""" |
20 | 20 |
21 def AdjustClangArguments(self, clang_cmd): | 21 def AdjustClangArguments(self, clang_cmd): |
22 clang_cmd.append('-Wno-inaccessible-base') | 22 clang_cmd.append('-Wno-inaccessible-base') |
| 23 clang_cmd.append('-Xclang') |
| 24 clang_cmd.append('-plugin-arg-blink-gc-plugin') |
| 25 clang_cmd.append('-Xclang') |
| 26 clang_cmd.append('use-chromium-style-naming') |
23 | 27 |
24 def ProcessOneResult(self, test_name, actual): | 28 def ProcessOneResult(self, test_name, actual): |
25 # Some Blink GC plugins dump a JSON representation of the object graph, and | 29 # Some Blink GC plugins dump a JSON representation of the object graph, and |
26 # use the processed results as the actual results of the test. | 30 # use the processed results as the actual results of the test. |
27 if os.path.exists('%s.graph.json' % test_name): | 31 if os.path.exists('%s.graph.json' % test_name): |
28 try: | 32 try: |
29 actual = subprocess.check_output( | 33 actual = subprocess.check_output( |
30 ['python', '../process-graph.py', '-c', | 34 ['python', '../process-graph.py', '-c', |
31 '%s.graph.json' % test_name], | 35 '%s.graph.json' % test_name], |
32 stderr=subprocess.STDOUT) | 36 stderr=subprocess.STDOUT) |
(...skipping 24 matching lines...) Expand all Loading... |
57 return BlinkGcPluginTest( | 61 return BlinkGcPluginTest( |
58 os.path.dirname(os.path.realpath(__file__)), | 62 os.path.dirname(os.path.realpath(__file__)), |
59 args.clang_path, | 63 args.clang_path, |
60 args.plugin_path, | 64 args.plugin_path, |
61 'blink-gc-plugin', | 65 'blink-gc-plugin', |
62 args.reset_results).Run() | 66 args.reset_results).Run() |
63 | 67 |
64 | 68 |
65 if __name__ == '__main__': | 69 if __name__ == '__main__': |
66 sys.exit(main()) | 70 sys.exit(main()) |
OLD | NEW |