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

Side by Side Diff: tools/telemetry/telemetry/unittest/run_tests.py

Issue 134623006: Allow disabled tests on cros to be run with -d flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unittest
Patch Set: Created 6 years, 11 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 | « no previous file | no next file » | 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 import logging 4 import logging
5 import unittest 5 import unittest
6 6
7 from telemetry.core import browser_options 7 from telemetry.core import browser_options
8 from telemetry.core import discover 8 from telemetry.core import discover
9 from telemetry.core import util 9 from telemetry.core import util
10 from telemetry.core.backends.chrome import cros_interface 10 from telemetry.core.backends.chrome import cros_interface
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return False 63 return False
64 64
65 if hasattr(test, '_testMethodName'): 65 if hasattr(test, '_testMethodName'):
66 method = getattr(test, test._testMethodName) # pylint: disable=W0212 66 method = getattr(test, test._testMethodName) # pylint: disable=W0212
67 if hasattr(method, '_requires_browser_types'): 67 if hasattr(method, '_requires_browser_types'):
68 types = method._requires_browser_types # pylint: disable=W0212 68 types = method._requires_browser_types # pylint: disable=W0212
69 if options_for_unittests.GetBrowserType() not in types: 69 if options_for_unittests.GetBrowserType() not in types:
70 logging.debug('Skipping test %s because it requires %s' % 70 logging.debug('Skipping test %s because it requires %s' %
71 (test.id(), types)) 71 (test.id(), types))
72 return False 72 return False
73 if hasattr(method, '_disabled_test'): 73
74 if not run_disabled_tests: 74 if (not run_disabled_tests and
75 return False 75 (hasattr(method, '_disabled_test') or
76 if (hasattr(method, '_disabled_test_on_cros') and 76 (hasattr(method, '_disabled_test_on_cros') and
77 cros_interface.IsRunningOnCrosDevice()): 77 cros_interface.IsRunningOnCrosDevice()))):
78 return False 78 return False
79 79
80 return True 80 return True
81 81
82 filtered_suite = FilterSuite(suite, IsTestSelected) 82 filtered_suite = FilterSuite(suite, IsTestSelected)
83 test_result = runner.run(filtered_suite) 83 test_result = runner.run(filtered_suite)
84 return test_result 84 return test_result
85 85
86 86
87 def RestoreLoggingLevel(func): 87 def RestoreLoggingLevel(func):
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 default_options.run_test_repeat_count): # pylint: disable=E1101 143 default_options.run_test_repeat_count): # pylint: disable=E1101
144 success = success and DiscoverAndRunTests( 144 success = success and DiscoverAndRunTests(
145 start_dir, args, top_level_dir, 145 start_dir, args, top_level_dir,
146 runner, default_options.run_disabled_tests) 146 runner, default_options.run_disabled_tests)
147 if success: 147 if success:
148 return 0 148 return 0
149 finally: 149 finally:
150 options_for_unittests.Set(None, None) 150 options_for_unittests.Set(None, None)
151 151
152 return 1 152 return 1
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698