diff --git a/testrunner/errors.py b/testrunner/errors.py
index e24089918..c04fd012c 100755
--- a/testrunner/errors.py
+++ b/testrunner/errors.py
@@ -34,7 +34,7 @@ class AbortError(Exception):
"""Generic exception that indicates a fatal error has occurred and program
execution should be aborted."""
- def __init__(self, msg="AbortError"):
+ def __init__(self, msg=""):
self.msg = msg
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index 046eb7c31..e66b8def5 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -115,7 +115,10 @@ class TestRunner(object):
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)")
-
+ parser.add_option("--cts", dest="cts_tests",
+ default=False, action="store_true",
+ help="Run all tests defined as part of the "
+ "compatibility test suite")
group = optparse.OptionGroup(
parser, "Targets", "Use these options to direct tests to a specific "
"Android target")
@@ -129,8 +132,11 @@ class TestRunner(object):
self._options, self._test_args = parser.parse_args()
- if (not self._options.only_list_tests and not self._options.all_tests
- and not self._options.continuous_tests and len(self._test_args) < 1):
+ if (not self._options.only_list_tests
+ and not self._options.all_tests
+ and not self._options.continuous_tests
+ and not self._options.cts_tests
+ and len(self._test_args) < 1):
parser.print_help()
logger.SilentLog("at least one test name must be specified")
raise errors.AbortError
@@ -229,8 +235,10 @@ class TestRunner(object):
"""Get a list of TestSuite objects to run, based on command line args."""
if self._options.all_tests:
return self._known_tests.GetTests()
- if self._options.continuous_tests:
+ elif self._options.continuous_tests:
return self._known_tests.GetContinuousTests()
+ elif self._options.cts_tests:
+ return self._known_tests.GetCtsTests()
tests = []
for name in self._test_args:
test = self._known_tests.GetTest(name)
diff --git a/testrunner/test_defs.py b/testrunner/test_defs.py
index 2cdcfa87c..0542a053d 100644
--- a/testrunner/test_defs.py
+++ b/testrunner/test_defs.py
@@ -144,6 +144,14 @@ class TestDefinitions(object):
con_tests.append(test)
return con_tests
+ def GetCtsTests(self):
+ """Return list of cts tests."""
+ cts_tests = []
+ for test in self.GetTests():
+ if test.IsCts():
+ cts_tests.append(test)
+ return cts_tests
+
def GetTest(self, name):
return self._testname_map.get(name, None)
@@ -157,6 +165,7 @@ class TestSuite(object):
_TARGET_ATTR = "coverage_target"
_BUILD_ATTR = "build_path"
_CONTINUOUS_ATTR = "continuous"
+ _CTS_ATTR = "cts"
_DESCRIPTION_ATTR = "description"
_EXTRA_MAKE_ARGS_ATTR = "extra_make_args"
@@ -199,6 +208,11 @@ class TestSuite(object):
self._continuous = suite_element.getAttribute(self._CONTINUOUS_ATTR)
else:
self._continuous = False
+ if suite_element.hasAttribute(self._CTS_ATTR):
+ self._cts = suite_element.getAttribute(self._CTS_ATTR)
+ else:
+ self._cts = False
+
if suite_element.hasAttribute(self._DESCRIPTION_ATTR):
self._description = suite_element.getAttribute(self._DESCRIPTION_ATTR)
else:
@@ -236,6 +250,10 @@ class TestSuite(object):
"""Returns true if test is flagged as being part of the continuous tests"""
return self._continuous
+ def IsCts(self):
+ """Returns true if test is part of the compatibility test suite"""
+ return self._cts
+
def IsNative(self):
"""Returns true if test is a native one."""
return self._native
diff --git a/testrunner/test_defs.xml b/testrunner/test_defs.xml
index 4121f7b90..e1d9cc54c 100644
--- a/testrunner/test_defs.xml
+++ b/testrunner/test_defs.xml
@@ -42,6 +42,8 @@ JAVA/application tests:
continuous: Optional boolean. Default is false. Set to true if tests are known
to be reliable, and should be included in a continuous test system. false if
they are under development.
+ cts: Optional boolean. Default is false. Set to true if test is included in
+ compatibility test suite.
description: Optional string. Default is empty. Short description (typically
less than 60 characters) about this test.
@@ -166,6 +168,162 @@ Native tests:
coverage_target="framework"
continuous="true" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+