Index: tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py |
diff --git a/tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py b/tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..765ae5132268ff9aee0111051172d31fa79e962e |
--- /dev/null |
+++ b/tools/android/findbugs_plugin/test/run_findbugs_plugin_tests.py |
@@ -0,0 +1,49 @@ |
+#!/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
|
+# |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+# This is used to test the findbugs plugin, it calls |
+# build/android/pylib/findbugs.py to analyze the classes in |
+# org.chromium.tools.findbugs.plugin package, and expects to get the same |
+# 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.
|
+# the test fails. |
+# |
+# Useful command line: |
+# --rebaseline to generate the expected_result.txt, please make sure don't |
+# remove the expected result of exsting tests. |
+ |
+ |
+import optparse |
+import os |
+import sys |
+ |
+lib_folder = os.path.join(os.getenv('CHROME_SRC'), 'build', 'android', 'pylib') |
+if lib_folder not in sys.path: |
+ sys.path.append(lib_folder) |
+ |
+import findbugs |
+ |
+ |
+def main(argv): |
+ if not findbugs.CheckEnvironment(): |
+ return 1 |
+ |
+ parser = findbugs.GetCommonParser() |
+ |
+ options, _ = parser.parse_args() |
+ |
+ chrome_src = os.getenv('CHROME_SRC') |
+ |
+ if not options.known_bugs: |
+ options.known_bugs = os.path.join(chrome_src, 'tools', 'android', |
+ 'findbugs_plugin', 'test', |
+ 'expected_result.txt') |
+ if not options.only_analyze: |
+ options.only_analyze = 'org.chromium.tools.findbugs.plugin.*' |
+ |
+ return findbugs.Run(options) |
+ |
+if __name__ == '__main__': |
+ sys.exit(main(sys.argv)) |