blob: 6c1b1b6c160298bb63b2af148796a2f3f9de2eb5 [file] [log] [blame]
The Android Open Source Project6ffae012009-03-18 17:39:43 -07001#!/usr/bin/python2.4
2#
3# Copyright 2008, The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
Brett Chabot59b47782009-10-21 17:23:01 -070017"""Command line utility for running Android tests
The Android Open Source Project6ffae012009-03-18 17:39:43 -070018
Brett Chabot59b47782009-10-21 17:23:01 -070019runtest helps automate the instructions for building and running tests
20- It builds the corresponding test package for the code you want to test
21- It pushes the test package to your device or emulator
22- It launches InstrumentationTestRunner (or similar) to run the tests you
23specify.
24
25runtest supports running tests whose attributes have been pre-defined in
26_TEST_FILE_NAME files, (runtest <testname>), or by specifying the file
27system path to the test to run (runtest --path <path>).
28
29Do runtest --help to see full list of options.
The Android Open Source Project6ffae012009-03-18 17:39:43 -070030"""
31
32# Python imports
33import glob
34import optparse
35import os
36from sets import Set
37import sys
Brett Chabotcdfaae12011-06-07 10:10:38 -070038import time
The Android Open Source Project6ffae012009-03-18 17:39:43 -070039
40# local imports
41import adb_interface
42import android_build
43import coverage
44import errors
45import logger
46import run_command
Brett Chabot764d3fa2009-06-25 17:57:31 -070047from test_defs import test_defs
Brett Chabot59b47782009-10-21 17:23:01 -070048from test_defs import test_walker
The Android Open Source Project6ffae012009-03-18 17:39:43 -070049
50
51class TestRunner(object):
52 """Command line utility class for running pre-defined Android test(s)."""
53
Brett Chabotf61f43e2009-04-02 11:52:48 -070054 _TEST_FILE_NAME = "test_defs.xml"
55
The Android Open Source Project6ffae012009-03-18 17:39:43 -070056 # file path to android core platform tests, relative to android build root
57 # TODO move these test data files to another directory
Nicolas Catania97b24c42009-04-22 11:08:32 -070058 _CORE_TEST_PATH = os.path.join("development", "testrunner",
Brett Chabotf61f43e2009-04-02 11:52:48 -070059 _TEST_FILE_NAME)
The Android Open Source Project6ffae012009-03-18 17:39:43 -070060
61 # vendor glob file path patterns to tests, relative to android
62 # build root
63 _VENDOR_TEST_PATH = os.path.join("vendor", "*", "tests", "testinfo",
Brett Chabotf61f43e2009-04-02 11:52:48 -070064 _TEST_FILE_NAME)
The Android Open Source Project6ffae012009-03-18 17:39:43 -070065
66 _RUNTEST_USAGE = (
67 "usage: runtest.py [options] short-test-name[s]\n\n"
68 "The runtest script works in two ways. You can query it "
69 "for a list of tests, or you can launch one or more tests.")
70
Brett Chabot2477b382009-09-23 18:05:28 -070071 # default value for make -jX
Brett Chabot12db4362012-01-17 16:03:49 -080072 _DEFAULT_JOBS = 16
Brett Chabot2477b382009-09-23 18:05:28 -070073
Brett Chabotccae47d2010-06-14 15:19:25 -070074 _DALVIK_VERIFIER_OFF_PROP = "dalvik.vm.dexopt-flags = v=n"
75
Brett Chabot72731f32009-03-31 11:14:05 -070076 def __init__(self):
77 # disable logging of timestamp
Niko Catania2e990b92009-04-02 16:52:26 -070078 self._root_path = android_build.GetTop()
Nicolas Catania97b24c42009-04-22 11:08:32 -070079 logger.SetTimestampLogging(False)
Brett Chabot3ae5f8a2009-06-28 12:00:47 -070080 self._adb = None
81 self._known_tests = None
82 self._options = None
83 self._test_args = None
Brett Chabot59b47782009-10-21 17:23:01 -070084 self._tests_to_run = None
Brett Chabot72731f32009-03-31 11:14:05 -070085
The Android Open Source Project6ffae012009-03-18 17:39:43 -070086 def _ProcessOptions(self):
87 """Processes command-line options."""
88 # TODO error messages on once-only or mutually-exclusive options.
89 user_test_default = os.path.join(os.environ.get("HOME"), ".android",
Brett Chabotf61f43e2009-04-02 11:52:48 -070090 self._TEST_FILE_NAME)
The Android Open Source Project6ffae012009-03-18 17:39:43 -070091
92 parser = optparse.OptionParser(usage=self._RUNTEST_USAGE)
93
94 parser.add_option("-l", "--list-tests", dest="only_list_tests",
95 default=False, action="store_true",
96 help="To view the list of tests")
97 parser.add_option("-b", "--skip-build", dest="skip_build", default=False,
98 action="store_true", help="Skip build - just launch")
Brett Chabot2477b382009-09-23 18:05:28 -070099 parser.add_option("-j", "--jobs", dest="make_jobs",
100 metavar="X", default=self._DEFAULT_JOBS,
101 help="Number of make jobs to use when building")
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700102 parser.add_option("-n", "--skip_execute", dest="preview", default=False,
103 action="store_true",
104 help="Do not execute, just preview commands")
105 parser.add_option("-r", "--raw-mode", dest="raw_mode", default=False,
106 action="store_true",
107 help="Raw mode (for output to other tools)")
108 parser.add_option("-a", "--suite-assign", dest="suite_assign_mode",
109 default=False, action="store_true",
110 help="Suite assignment (for details & usage see "
111 "InstrumentationTestRunner)")
112 parser.add_option("-v", "--verbose", dest="verbose", default=False,
113 action="store_true",
114 help="Increase verbosity of %s" % sys.argv[0])
115 parser.add_option("-w", "--wait-for-debugger", dest="wait_for_debugger",
116 default=False, action="store_true",
117 help="Wait for debugger before launching tests")
118 parser.add_option("-c", "--test-class", dest="test_class",
119 help="Restrict test to a specific class")
120 parser.add_option("-m", "--test-method", dest="test_method",
121 help="Restrict test to a specific method")
Brett Chabot8a101cb2009-05-05 12:56:39 -0700122 parser.add_option("-p", "--test-package", dest="test_package",
123 help="Restrict test to a specific java package")
124 parser.add_option("-z", "--size", dest="test_size",
125 help="Restrict test to a specific test size")
Brett Chabotc0611542010-02-20 20:09:58 -0800126 parser.add_option("--annotation", dest="test_annotation",
127 help="Include only those tests tagged with a specific"
128 " annotation")
129 parser.add_option("--not-annotation", dest="test_not_annotation",
Brett Chabot2e16fbc2010-02-23 12:28:27 -0800130 help="Exclude any tests tagged with a specific"
Brett Chabotc0611542010-02-20 20:09:58 -0800131 " annotation")
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700132 parser.add_option("-u", "--user-tests-file", dest="user_tests_file",
133 metavar="FILE", default=user_test_default,
134 help="Alternate source of user test definitions")
135 parser.add_option("-o", "--coverage", dest="coverage",
136 default=False, action="store_true",
137 help="Generate code coverage metrics for test(s)")
Brett Chabot59b47782009-10-21 17:23:01 -0700138 parser.add_option("-x", "--path", dest="test_path",
139 help="Run test(s) at given file system path")
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700140 parser.add_option("-t", "--all-tests", dest="all_tests",
141 default=False, action="store_true",
142 help="Run all defined tests")
143 parser.add_option("--continuous", dest="continuous_tests",
144 default=False, action="store_true",
145 help="Run all tests defined as part of the continuous "
146 "test set")
Wei-Ta Chen97752d42009-05-21 16:24:04 -0700147 parser.add_option("--timeout", dest="timeout",
148 default=300, help="Set a timeout limit (in sec) for "
149 "running native tests on a device (default: 300 secs)")
Brett Chabot4a5d9f12010-02-18 20:01:11 -0800150 parser.add_option("--suite", dest="suite",
Brett Chabot49b77112009-06-02 11:46:04 -0700151 help="Run all tests defined as part of the "
Brett Chabot4a5d9f12010-02-18 20:01:11 -0800152 "the given test suite")
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700153 group = optparse.OptionGroup(
154 parser, "Targets", "Use these options to direct tests to a specific "
155 "Android target")
156 group.add_option("-e", "--emulator", dest="emulator", default=False,
157 action="store_true", help="use emulator")
158 group.add_option("-d", "--device", dest="device", default=False,
159 action="store_true", help="use device")
160 group.add_option("-s", "--serial", dest="serial",
161 help="use specific serial")
162 parser.add_option_group(group)
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700163 self._options, self._test_args = parser.parse_args()
164
Brett Chabot49b77112009-06-02 11:46:04 -0700165 if (not self._options.only_list_tests
166 and not self._options.all_tests
167 and not self._options.continuous_tests
Brett Chabot4a5d9f12010-02-18 20:01:11 -0800168 and not self._options.suite
Brett Chabot59b47782009-10-21 17:23:01 -0700169 and not self._options.test_path
Brett Chabot49b77112009-06-02 11:46:04 -0700170 and len(self._test_args) < 1):
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700171 parser.print_help()
172 logger.SilentLog("at least one test name must be specified")
173 raise errors.AbortError
174
175 self._adb = adb_interface.AdbInterface()
176 if self._options.emulator:
177 self._adb.SetEmulatorTarget()
178 elif self._options.device:
179 self._adb.SetDeviceTarget()
180 elif self._options.serial is not None:
181 self._adb.SetTargetSerial(self._options.serial)
182
183 if self._options.verbose:
184 logger.SetVerbose(True)
185
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700186 self._known_tests = self._ReadTests()
187
Brett Chabot764d3fa2009-06-25 17:57:31 -0700188 self._options.host_lib_path = android_build.GetHostLibraryPath()
189 self._options.test_data_path = android_build.GetTestAppPath()
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700190
191 def _ReadTests(self):
192 """Parses the set of test definition data.
193
194 Returns:
195 A TestDefinitions object that contains the set of parsed tests.
196 Raises:
197 AbortError: If a fatal error occurred when parsing the tests.
198 """
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700199 try:
200 known_tests = test_defs.TestDefinitions()
Brett Chabot3c9cefc2011-06-06 20:53:56 -0700201 # only read tests when not in path mode
202 if not self._options.test_path:
203 core_test_path = os.path.join(self._root_path, self._CORE_TEST_PATH)
204 if os.path.isfile(core_test_path):
205 known_tests.Parse(core_test_path)
206 # read all <android root>/vendor/*/tests/testinfo/test_defs.xml paths
207 vendor_tests_pattern = os.path.join(self._root_path,
208 self._VENDOR_TEST_PATH)
209 test_file_paths = glob.glob(vendor_tests_pattern)
210 for test_file_path in test_file_paths:
211 known_tests.Parse(test_file_path)
212 if os.path.isfile(self._options.user_tests_file):
213 known_tests.Parse(self._options.user_tests_file)
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700214 return known_tests
215 except errors.ParseError:
216 raise errors.AbortError
217
218 def _DumpTests(self):
219 """Prints out set of defined tests."""
Brett Chabotbe659c02009-09-21 17:48:26 -0700220 print "The following tests are currently defined:\n"
221 print "%-25s %-40s %s" % ("name", "build path", "description")
222 print "-" * 80
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700223 for test in self._known_tests:
Brett Chabotbe659c02009-09-21 17:48:26 -0700224 print "%-25s %-40s %s" % (test.GetName(), test.GetBuildPath(),
225 test.GetDescription())
226 print "\nSee %s for more information" % self._TEST_FILE_NAME
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700227
228 def _DoBuild(self):
229 logger.SilentLog("Building tests...")
Brett Chabot8dc9eb82010-04-15 15:43:04 -0700230
231 tests = self._GetTestsToRun()
Brett Chabotb1eb5d22010-06-15 11:18:42 -0700232 # turn off dalvik verifier if necessary
233 self._TurnOffVerifier(tests)
Brett Chabot8dc9eb82010-04-15 15:43:04 -0700234 self._DoFullBuild(tests)
235
Brian Muramatsu95cbc9e2012-01-10 12:06:12 -0800236 target_set = []
Brian Muramatsu95cbc9e2012-01-10 12:06:12 -0800237
238 extra_args_set = []
Brett Chabot2477b382009-09-23 18:05:28 -0700239 for test_suite in tests:
Niko Cataniaa6dc2ab2009-04-03 14:12:46 -0700240 self._AddBuildTarget(test_suite, target_set, extra_args_set)
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700241
Brett Chabotccae47d2010-06-14 15:19:25 -0700242 if not self._options.preview:
243 self._adb.EnableAdbRoot()
244 else:
245 logger.Log("adb root")
Guang Zhu8aff3602010-04-15 10:48:26 -0700246 rebuild_libcore = False
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700247 if target_set:
248 if self._options.coverage:
Brett Chabot764d3fa2009-06-25 17:57:31 -0700249 coverage.EnableCoverageBuild()
Guang Zhu8aff3602010-04-15 10:48:26 -0700250 # hack to remove core library intermediates
251 # hack is needed because:
252 # 1. EMMA_INSTRUMENT changes what source files to include in libcore
253 # but it does not trigger a rebuild
254 # 2. there's no target (like "clear-intermediates") to remove the files
255 # decently
256 rebuild_libcore = not coverage.TestDeviceCoverageSupport(self._adb)
257 if rebuild_libcore:
258 cmd = "rm -rf %s" % os.path.join(
259 self._root_path,
260 "out/target/common/obj/JAVA_LIBRARIES/core_intermediates/")
261 logger.Log(cmd)
262 run_command.RunCommand(cmd, return_output=False)
Brett Chabot2477b382009-09-23 18:05:28 -0700263
Brian Muramatsu95cbc9e2012-01-10 12:06:12 -0800264 target_build_string = " ".join(target_set)
265 extra_args_string = " ".join(extra_args_set)
Brett Chabotb1eb5d22010-06-15 11:18:42 -0700266
Brett Chabot764d3fa2009-06-25 17:57:31 -0700267 # mmm cannot be used from python, so perform a similar operation using
Brett Chabot2b6643b2009-04-07 18:35:27 -0700268 # ONE_SHOT_MAKEFILE
Brett Chabot546a3282011-06-07 19:19:30 -0700269 cmd = 'ONE_SHOT_MAKEFILE="%s" make -j%s -C "%s" all_modules %s' % (
Brett Chabot2477b382009-09-23 18:05:28 -0700270 target_build_string, self._options.make_jobs, self._root_path,
271 extra_args_string)
Brett Chabot764d3fa2009-06-25 17:57:31 -0700272 logger.Log(cmd)
Niko Cataniaa6dc2ab2009-04-03 14:12:46 -0700273
Brett Chabot72731f32009-03-31 11:14:05 -0700274 if self._options.preview:
275 # in preview mode, just display to the user what command would have been
276 # run
277 logger.Log("adb sync")
278 else:
Guang Zhu8aff3602010-04-15 10:48:26 -0700279 # set timeout for build to 10 minutes, since libcore may need to
280 # be rebuilt
281 run_command.RunCommand(cmd, return_output=False, timeout_time=600)
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700282 logger.Log("Syncing to device...")
Guang Zhu8aff3602010-04-15 10:48:26 -0700283 self._adb.Sync(runtime_restart=rebuild_libcore)
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700284
Brett Chabot8dc9eb82010-04-15 15:43:04 -0700285 def _DoFullBuild(self, tests):
286 """If necessary, run a full 'make' command for the tests that need it."""
287 extra_args_set = Set()
288
289 # hack to build cts dependencies
290 # TODO: remove this when cts dependencies are removed
291 if self._IsCtsTests(tests):
292 # need to use make since these fail building with ONE_SHOT_MAKEFILE
293 extra_args_set.add('CtsTestStubs')
294 extra_args_set.add('android.core.tests.runner')
295 for test in tests:
296 if test.IsFullMake():
297 if test.GetExtraBuildArgs():
298 # extra args contains the args to pass to 'make'
299 extra_args_set.add(test.GetExtraBuildArgs())
300 else:
301 logger.Log("Warning: test %s needs a full build but does not specify"
302 " extra_build_args" % test.GetName())
303
304 # check if there is actually any tests that required a full build
305 if extra_args_set:
306 cmd = ('make -j%s %s' % (self._options.make_jobs,
307 ' '.join(list(extra_args_set))))
308 logger.Log(cmd)
309 if not self._options.preview:
310 old_dir = os.getcwd()
311 os.chdir(self._root_path)
312 run_command.RunCommand(cmd, return_output=False)
313 os.chdir(old_dir)
314
Niko Cataniaa6dc2ab2009-04-03 14:12:46 -0700315 def _AddBuildTarget(self, test_suite, target_set, extra_args_set):
Brett Chabot8dc9eb82010-04-15 15:43:04 -0700316 if not test_suite.IsFullMake():
317 build_dir = test_suite.GetBuildPath()
318 if self._AddBuildTargetPath(build_dir, target_set):
Brian Muramatsu95cbc9e2012-01-10 12:06:12 -0800319 extra_args_set.append(test_suite.GetExtraBuildArgs())
Brett Chabot8dc9eb82010-04-15 15:43:04 -0700320 for path in test_suite.GetBuildDependencies(self._options):
321 self._AddBuildTargetPath(path, target_set)
Brett Chabot2b6643b2009-04-07 18:35:27 -0700322
323 def _AddBuildTargetPath(self, build_dir, target_set):
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700324 if build_dir is not None:
325 build_file_path = os.path.join(build_dir, "Android.mk")
326 if os.path.isfile(os.path.join(self._root_path, build_file_path)):
Brian Muramatsu95cbc9e2012-01-10 12:06:12 -0800327 target_set.append(build_file_path)
Brett Chabot2b6643b2009-04-07 18:35:27 -0700328 return True
Brett Chabote00595b2009-10-21 20:01:31 -0700329 else:
330 logger.Log("%s has no Android.mk, skipping" % build_dir)
Brett Chabot2b6643b2009-04-07 18:35:27 -0700331 return False
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700332
333 def _GetTestsToRun(self):
334 """Get a list of TestSuite objects to run, based on command line args."""
Brett Chabot59b47782009-10-21 17:23:01 -0700335 if self._tests_to_run:
336 return self._tests_to_run
337
338 self._tests_to_run = []
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700339 if self._options.all_tests:
Brett Chabot59b47782009-10-21 17:23:01 -0700340 self._tests_to_run = self._known_tests.GetTests()
Brett Chabot49b77112009-06-02 11:46:04 -0700341 elif self._options.continuous_tests:
Brett Chabot59b47782009-10-21 17:23:01 -0700342 self._tests_to_run = self._known_tests.GetContinuousTests()
Brett Chabot4a5d9f12010-02-18 20:01:11 -0800343 elif self._options.suite:
344 self._tests_to_run = \
345 self._known_tests.GetTestsInSuite(self._options.suite)
Brett Chabot59b47782009-10-21 17:23:01 -0700346 elif self._options.test_path:
347 walker = test_walker.TestWalker()
348 self._tests_to_run = walker.FindTests(self._options.test_path)
349
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700350 for name in self._test_args:
351 test = self._known_tests.GetTest(name)
352 if test is None:
353 logger.Log("Error: Could not find test %s" % name)
354 self._DumpTests()
355 raise errors.AbortError
Brett Chabot59b47782009-10-21 17:23:01 -0700356 self._tests_to_run.append(test)
357 return self._tests_to_run
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700358
Brett Chabot2477b382009-09-23 18:05:28 -0700359 def _IsCtsTests(self, test_list):
360 """Check if any cts tests are included in given list of tests to run."""
361 for test in test_list:
Brett Chabot4a5d9f12010-02-18 20:01:11 -0800362 if test.GetSuite() == 'cts':
Brett Chabot2477b382009-09-23 18:05:28 -0700363 return True
364 return False
365
Brett Chabotccae47d2010-06-14 15:19:25 -0700366 def _TurnOffVerifier(self, test_list):
367 """Turn off the dalvik verifier if needed by given tests.
368
369 If one or more tests needs dalvik verifier off, and it is not already off,
370 turns off verifier and reboots device to allow change to take effect.
371 """
372 # hack to check if these are framework/base tests. If so, turn off verifier
373 # to allow framework tests to access package-private framework api
374 framework_test = False
375 for test in test_list:
376 if os.path.commonprefix([test.GetBuildPath(), "frameworks/base"]):
377 framework_test = True
378 if framework_test:
379 # check if verifier is off already - to avoid the reboot if not
380 # necessary
381 output = self._adb.SendShellCommand("cat /data/local.prop")
382 if not self._DALVIK_VERIFIER_OFF_PROP in output:
383 if self._options.preview:
384 logger.Log("adb shell \"echo %s >> /data/local.prop\""
385 % self._DALVIK_VERIFIER_OFF_PROP)
Brett Chabot25dfd792012-02-16 15:51:43 -0800386 logger.Log("adb shell chmod 644 /data/local.prop")
Brett Chabotccae47d2010-06-14 15:19:25 -0700387 logger.Log("adb reboot")
388 logger.Log("adb wait-for-device")
389 else:
390 logger.Log("Turning off dalvik verifier and rebooting")
391 self._adb.SendShellCommand("\"echo %s >> /data/local.prop\""
392 % self._DALVIK_VERIFIER_OFF_PROP)
Brett Chabot25dfd792012-02-16 15:51:43 -0800393
394 self._ChmodReboot()
395 elif not self._options.preview:
396 # check the permissions on the file
397 permout = self._adb.SendShellCommand("ls -l /data/local.prop")
398 if not "-rw-r--r--" in permout:
399 logger.Log("Fixing permissions on /data/local.prop and rebooting")
400 self._ChmodReboot()
401
402 def _ChmodReboot(self):
403 """Perform a chmod of /data/local.prop and reboot.
404 """
405 self._adb.SendShellCommand("chmod 644 /data/local.prop")
406 self._adb.SendCommand("reboot")
407 # wait for device to go offline
408 time.sleep(10)
409 self._adb.SendCommand("wait-for-device", timeout_time=60,
410 retry_count=3)
411 self._adb.EnableAdbRoot()
412
Brett Chabotccae47d2010-06-14 15:19:25 -0700413
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700414 def RunTests(self):
415 """Main entry method - executes the tests according to command line args."""
416 try:
417 run_command.SetAbortOnError()
418 self._ProcessOptions()
419 if self._options.only_list_tests:
420 self._DumpTests()
421 return
422
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700423 if not self._options.skip_build:
424 self._DoBuild()
425
426 for test_suite in self._GetTestsToRun():
Brett Chabot920e9fe2010-01-21 17:30:47 -0800427 try:
428 test_suite.Run(self._options, self._adb)
429 except errors.WaitForResponseTimedOutError:
430 logger.Log("Timed out waiting for response")
Brett Chabot764d3fa2009-06-25 17:57:31 -0700431
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700432 except KeyboardInterrupt:
433 logger.Log("Exiting...")
Brett Chabot3ae5f8a2009-06-28 12:00:47 -0700434 except errors.AbortError, error:
435 logger.Log(error.msg)
The Android Open Source Project6ffae012009-03-18 17:39:43 -0700436 logger.SilentLog("Exiting due to AbortError...")
437 except errors.WaitForResponseTimedOutError:
438 logger.Log("Timed out waiting for response")
439
440
441def RunTests():
442 runner = TestRunner()
443 runner.RunTests()
444
445if __name__ == "__main__":
446 RunTests()