OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
Yaron
2012/10/31 00:40:28
Where were you thinking to run this script? Curren
michaelbai
2012/10/31 04:36:24
I am plan to run it in a bot, might just after fin
| |
2 # | |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 | |
7 # This is used to test the findbugs plugin, it calls | |
8 # build/android/pylib/findbugs.py to analyze the classes in | |
9 # org.chromium.tools.findbugs.plugin package, and expects to get the same | |
10 # issue with those in expected_result.txt, If the difference is fund out, | |
Yaron
2012/10/31 00:40:28
Change the "," to "." and remove the rest of the s
michaelbai
2012/10/31 04:36:24
Done.
| |
11 # the test fails. | |
12 # | |
13 # Useful command line: | |
14 # --rebaseline to generate the expected_result.txt, please make sure don't | |
15 # remove the expected result of exsting tests. | |
16 | |
17 | |
18 import optparse | |
19 import os | |
20 import sys | |
21 | |
22 lib_folder = os.path.join(os.getenv('CHROME_SRC'), 'build', 'android', 'pylib') | |
23 if lib_folder not in sys.path: | |
24 sys.path.append(lib_folder) | |
25 | |
26 import findbugs | |
27 | |
28 | |
29 def main(argv): | |
30 if not findbugs.CheckEnvironment(): | |
31 return 1 | |
32 | |
33 parser = findbugs.GetCommonParser() | |
34 | |
35 options, _ = parser.parse_args() | |
36 | |
37 chrome_src = os.getenv('CHROME_SRC') | |
38 | |
39 if not options.known_bugs: | |
40 options.known_bugs = os.path.join(chrome_src, 'tools', 'android', | |
41 'findbugs_plugin', 'test', | |
42 'expected_result.txt') | |
43 if not options.only_analyze: | |
44 options.only_analyze = 'org.chromium.tools.findbugs.plugin.*' | |
45 | |
46 return findbugs.Run(options) | |
47 | |
48 if __name__ == '__main__': | |
49 sys.exit(main(sys.argv)) | |
OLD | NEW |