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

Side by Side Diff: build/android/pylib/utils/run_tests_helper.py

Issue 19537004: [Android] Converts host driven tests to common test_dispatcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sharding_refactoring
Patch Set: Converts --official-build into a boolean flag Created 7 years, 4 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/pylib/instrumentation/test_jar.py ('k') | build/android/run_monkey_test.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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Helper functions common to native, java and python test runners.""" 5 """Helper functions common to native, java and host-driven test runners."""
6 6
7 import logging 7 import logging
8 import os
9 import sys 8 import sys
10 import time 9 import time
11 10
12 11
13 class CustomFormatter(logging.Formatter): 12 class CustomFormatter(logging.Formatter):
14 """Custom log formatter.""" 13 """Custom log formatter."""
15 14
16 #override 15 #override
17 def __init__(self, fmt='%(threadName)-4s %(message)s'): 16 def __init__(self, fmt='%(threadName)-4s %(message)s'):
18 # Can't use super() because in older Python versions logging.Formatter does 17 # Can't use super() because in older Python versions logging.Formatter does
(...skipping 17 matching lines...) Expand all
36 log_level = logging.WARNING # Default. 35 log_level = logging.WARNING # Default.
37 if verbose_count == 1: 36 if verbose_count == 1:
38 log_level = logging.INFO 37 log_level = logging.INFO
39 elif verbose_count >= 2: 38 elif verbose_count >= 2:
40 log_level = logging.DEBUG 39 log_level = logging.DEBUG
41 logger = logging.getLogger() 40 logger = logging.getLogger()
42 logger.setLevel(log_level) 41 logger.setLevel(log_level)
43 custom_handler = logging.StreamHandler(sys.stdout) 42 custom_handler = logging.StreamHandler(sys.stdout)
44 custom_handler.setFormatter(CustomFormatter()) 43 custom_handler.setFormatter(CustomFormatter())
45 logging.getLogger().addHandler(custom_handler) 44 logging.getLogger().addHandler(custom_handler)
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/test_jar.py ('k') | build/android/run_monkey_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698