diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-08-05 23:05:44 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-08-05 23:05:44 +0000 |
commit | 548f841b745404224698a3eafc6d4cb190d0ca8c (patch) | |
tree | 8a0d6fd78eb610653f12ded770595c80f1e89a61 /catapult/devil/bin/run_py_devicetests | |
parent | 1d3aa42aef5ab74bf9b13fb5a7e18c73e137f58c (diff) | |
parent | a5e4f4d2969520f4563ec0d66cbe469c49ee38bc (diff) | |
download | chromium-trace-548f841b745404224698a3eafc6d4cb190d0ca8c.tar.gz |
Merge changes Ie9f01eed,I3acb8a0d am: fb769a1607 am: 316160b179 am: 3fd616f492 am: 5338649baa am: a5e4f4d296
Original change: https://android-review.googlesource.com/c/platform/external/chromium-trace/+/1392438
Change-Id: I7a428aa7cb0cdad8a449e25867e8c4bb514c2d2d
Diffstat (limited to 'catapult/devil/bin/run_py_devicetests')
-rwxr-xr-x | catapult/devil/bin/run_py_devicetests | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/catapult/devil/bin/run_py_devicetests b/catapult/devil/bin/run_py_devicetests index 656bedf2..6a6da188 100755 --- a/catapult/devil/bin/run_py_devicetests +++ b/catapult/devil/bin/run_py_devicetests @@ -3,13 +3,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import logging import os import sys -_CATAPULT_PATH = os.path.abspath(os.path.join( - os.path.dirname(__file__), '..', '..')) -_DEVIL_PATH = os.path.abspath(os.path.join( - os.path.dirname(__file__), '..')) +_CATAPULT_PATH = os.path.abspath( + os.path.join(os.path.dirname(__file__), '..', '..')) +_DEVIL_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) _TYP_PATH = os.path.abspath(os.path.join(_CATAPULT_PATH, 'third_party', 'typ')) sys.path.append(_TYP_PATH) @@ -19,7 +19,24 @@ sys.path.append(_DEVIL_PATH) from devil.android import device_test_case +def _SetUpLogging(): + parsed_args = typ.arg_parser.ArgumentParser().parse_args(args=sys.argv[1:]) + verbosity = parsed_args.verbose + level = None + if verbosity == 0: + level = logging.WARNING + elif verbosity == 1: + level = logging.INFO + elif verbosity >= 2: + level = logging.DEBUG + else: + raise RuntimeError( + 'Logging verbosity of {} is not allowed.'.format(verbosity)) + logging.basicConfig(level=level) + + def main(): + _SetUpLogging() runner = typ.Runner() runner.setup_fn = device_test_case.PrepareDevices return runner.main( @@ -28,5 +45,6 @@ def main(): suffixes=['*_devicetest.py'], top_level_dir=_DEVIL_PATH) + if __name__ == '__main__': sys.exit(main()) |