Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: build/android/test_runner.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/symbolize.py ('k') | build/android/tombstones.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs all types of tests from one unified interface.""" 7 """Runs all types of tests from one unified interface."""
8 8
9 import argparse 9 import argparse
10 import collections 10 import collections
11 import logging 11 import logging
12 import os 12 import os
13 import shutil
14 import signal 13 import signal
15 import sys 14 import sys
16 import threading 15 import threading
17 import unittest 16 import unittest
18 17
19 from devil import base_error 18 from devil import base_error
20 from devil.android import apk_helper 19 from devil.android import apk_helper
21 from devil.android import device_blacklist 20 from devil.android import device_blacklist
22 from devil.android import device_errors 21 from devil.android import device_errors
23 from devil.android import device_utils 22 from devil.android import device_utils
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 test_package='ChromiumLinkerTest') 704 test_package='ChromiumLinkerTest')
706 705
707 if args.json_results_file: 706 if args.json_results_file:
708 json_results.GenerateJsonResultsFile(results, args.json_results_file) 707 json_results.GenerateJsonResultsFile(results, args.json_results_file)
709 708
710 return exit_code 709 return exit_code
711 710
712 711
713 def _RunInstrumentationTests(args, devices): 712 def _RunInstrumentationTests(args, devices):
714 """Subcommand of RunTestsCommands which runs instrumentation tests.""" 713 """Subcommand of RunTestsCommands which runs instrumentation tests."""
715 logging.info('_RunInstrumentationTests(%s, %s)' % (str(args), str(devices))) 714 logging.info('_RunInstrumentationTests(%s, %s)', str(args), str(devices))
716 715
717 instrumentation_options = ProcessInstrumentationOptions(args) 716 instrumentation_options = ProcessInstrumentationOptions(args)
718 717
719 if len(devices) > 1 and args.wait_for_debugger: 718 if len(devices) > 1 and args.wait_for_debugger:
720 logging.warning('Debugger can not be sharded, using first available device') 719 logging.warning('Debugger can not be sharded, using first available device')
721 devices = devices[:1] 720 devices = devices[:1]
722 721
723 results = base_test_result.TestRunResults() 722 results = base_test_result.TestRunResults()
724 exit_code = 0 723 exit_code = 0
725 724
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 'Did not find device %s among attached device. Attached devices: %s' 909 'Did not find device %s among attached device. Attached devices: %s'
911 % (test_device, ', '.join(attached_devices))) 910 % (test_device, ', '.join(attached_devices)))
912 return test_device 911 return test_device
913 912
914 else: 913 else:
915 if not attached_devices: 914 if not attached_devices:
916 raise device_errors.NoDevicesError() 915 raise device_errors.NoDevicesError()
917 return sorted(attached_devices) 916 return sorted(attached_devices)
918 917
919 918
920 def RunTestsCommand(args, parser): 919 def RunTestsCommand(args, parser): # pylint: disable=too-many-return-statements
921 """Checks test type and dispatches to the appropriate function. 920 """Checks test type and dispatches to the appropriate function.
922 921
923 Args: 922 Args:
924 args: argparse.Namespace object. 923 args: argparse.Namespace object.
925 parser: argparse.ArgumentParser object. 924 parser: argparse.ArgumentParser object.
926 925
927 Returns: 926 Returns:
928 Integer indicated exit code. 927 Integer indicated exit code.
929 928
930 Raises: 929 Raises:
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 if e.is_infra_error: 1065 if e.is_infra_error:
1067 return constants.INFRA_EXIT_CODE 1066 return constants.INFRA_EXIT_CODE
1068 return constants.ERROR_EXIT_CODE 1067 return constants.ERROR_EXIT_CODE
1069 except: # pylint: disable=W0702 1068 except: # pylint: disable=W0702
1070 logging.exception('Unrecognized error occurred.') 1069 logging.exception('Unrecognized error occurred.')
1071 return constants.ERROR_EXIT_CODE 1070 return constants.ERROR_EXIT_CODE
1072 1071
1073 1072
1074 if __name__ == '__main__': 1073 if __name__ == '__main__':
1075 sys.exit(main()) 1074 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/symbolize.py ('k') | build/android/tombstones.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698