summaryrefslogtreecommitdiffstats
path: root/testrunner
diff options
context:
space:
mode:
authorWei-Ta Chen <weita@google.com>2009-05-22 07:57:20 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-05-22 07:57:20 -0700
commitefbbe29a2ca619007e9819d4a0bfc66aa72c3d01 (patch)
tree5244f209053759e086124b10b2e8988ebd984891 /testrunner
parente56dc15be2114c439b349e6ac3e692a7516474f5 (diff)
parent97752d4f80740485ec7a248a0f80074fa6a784db (diff)
downloadandroid_development-efbbe29a2ca619007e9819d4a0bfc66aa72c3d01.tar.gz
android_development-efbbe29a2ca619007e9819d4a0bfc66aa72c3d01.tar.bz2
android_development-efbbe29a2ca619007e9819d4a0bfc66aa72c3d01.zip
am 97752d4f: Add a timeout flag to runtest for running native tests on devices.
Merge commit '97752d4f80740485ec7a248a0f80074fa6a784db' * commit '97752d4f80740485ec7a248a0f80074fa6a784db': Add a timeout flag to runtest for running native tests on devices.
Diffstat (limited to 'testrunner')
-rwxr-xr-xtestrunner/runtest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index 05d29ec34..5a8c3f47e 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -112,6 +112,9 @@ class TestRunner(object):
default=False, action="store_true",
help="Run all tests defined as part of the continuous "
"test set")
+ parser.add_option("--timeout", dest="timeout",
+ default=300, help="Set a timeout limit (in sec) for "
+ "running native tests on a device (default: 300 secs)")
group = optparse.OptionGroup(
parser, "Targets", "Use these options to direct tests to a specific "
@@ -384,7 +387,8 @@ class TestRunner(object):
# Single quotes are needed to prevent the shell splitting it.
output = self._adb.SendShellCommand("'%s 2>&1;echo -n exit code:$?'" %
- full_path)
+ full_path,
+ int(self._options.timeout))
success = output.endswith("exit code:0")
logger.Log("%s... %s" % (f, success and "ok" or "failed"))
# Print the captured output when the test failed.