diff options
author | Yabin Cui <yabinc@google.com> | 2019-11-06 11:38:22 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-11-06 11:38:22 -0800 |
commit | dc60d56b3aa03926df6c51899bdb6a2be54f006e (patch) | |
tree | 712cc2ac33bf276e6c1673916408bce98aa27cfb | |
parent | e80c8cea43ab69351b2c25459dbc28f8350caf95 (diff) | |
parent | 015d80a24497c7899ec40c53a0e8bd1e29ff1de8 (diff) | |
download | extras-dc60d56b3aa03926df6c51899bdb6a2be54f006e.tar.gz |
Merge "simpleperf: add browser option in test.py." am: ffb407b459
am: 015d80a244
Change-Id: Ifdbd00577bee5ded025900a48f096d6e0d0ede0b
-rwxr-xr-x | simpleperf/scripts/test.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/simpleperf/scripts/test.py b/simpleperf/scripts/test.py index f6295d4e..caf3fb2a 100755 --- a/simpleperf/scripts/test.py +++ b/simpleperf/scripts/test.py @@ -115,6 +115,7 @@ class TestHelper(object): self.adb = AdbHelper(enable_switch_to_root=True) self.android_version = self.adb.get_android_version() self.device_features = None + self.browser_option = [] def get_test_base_dir(self, python_version): """ Return the dir of generated data for a python version. """ @@ -185,6 +186,8 @@ class TestBase(unittest.TestCase): os.chdir(self.test_dir) def run_cmd(self, args, return_output=False): + if args[0] == 'report_html.py' or args[0] == INFERNO_SCRIPT: + args += TEST_HELPER.browser_option if args[0].endswith('.py'): args = [sys.executable, TEST_HELPER.script_path(args[0])] + args[1:] use_shell = args[0].endswith('.bat') @@ -1682,6 +1685,7 @@ def main(): parser.add_argument('--repeat', type=int, nargs=1, default=[1], help='run test multiple times') parser.add_argument('--no-test-result', dest='report_test_result', action='store_false', help="Don't report test result.") + parser.add_argument('--browser', action='store_true', help='pop report html file in browser.') parser.add_argument('pattern', nargs='*', help='Run tests matching the selected pattern.') args = parser.parse_args() tests = get_all_tests() @@ -1717,6 +1721,9 @@ def main(): for python_version in python_versions: remove(TEST_HELPER.get_test_base_dir(python_version)) + if not args.browser: + TEST_HELPER.browser_option = ['--no_browser'] + test_results = [] for version in python_versions: os.chdir(TEST_HELPER.cur_dir) |