summaryrefslogtreecommitdiffstats
path: root/testrunner/test_defs/test_suite.py
diff options
context:
space:
mode:
authorBrett Chabot <brettchabot@android.com>2011-06-17 17:07:12 -0700
committerBrett Chabot <brettchabot@android.com>2011-07-10 13:26:41 -0700
commitbb5918ed814ed8dded262d4558588a7183ca71ce (patch)
tree48adabe79f50f2dca57fb2ccbe0ce05af71b269d /testrunner/test_defs/test_suite.py
parent6b47b8888cfa5c9e24b52b8077b611c7fd8d9a34 (diff)
downloadandroid_development-bb5918ed814ed8dded262d4558588a7183ca71ce.tar.gz
android_development-bb5918ed814ed8dded262d4558588a7183ca71ce.tar.bz2
android_development-bb5918ed814ed8dded262d4558588a7183ca71ce.zip
Add gtest target support for runtest --path.
This is a rough initial version. It makes several assumptions: - assumes each test source file is built into module with name equal to basename of source file - assumes tests get installed into /data/nativetest However, given those assumptions, both: $ runtest --path <path to directory containing gtest source> and $ runtest --path <path to single source file> should work. Coming soon: gtest host support Bugs 4563370, 4584339 Change-Id: Ia42aeed7f9ee6402b0ceb7b5ccaaa66ac636fe49
Diffstat (limited to 'testrunner/test_defs/test_suite.py')
-rw-r--r--testrunner/test_defs/test_suite.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/testrunner/test_defs/test_suite.py b/testrunner/test_defs/test_suite.py
index 102a738e2..20f96297c 100644
--- a/testrunner/test_defs/test_suite.py
+++ b/testrunner/test_defs/test_suite.py
@@ -105,3 +105,41 @@ class AbstractTestSuite(object):
adb: asdb_interface to device under test
"""
raise NotImplementedError
+
+class AbstractTestFactory(object):
+ """generic test suite factory."""
+
+ def __init__(self, test_root_path, upstream_build_path=None):
+ """Creates a test suite factory.
+
+ Args:
+ test_root_path: the filesystem path to the tests build directory
+ upstream_build_path: optional filesystem path for the directory
+ to build when running tests. If unspecified, will use test_root_path
+ """
+ self._test_root_path = test_root_path
+ if upstream_build_path:
+ self._build_path = upstream_build_path
+ else:
+ self._build_path = self._test_root_path
+
+ def GetBuildPath(self):
+ return self._build_path
+
+ def GetTestsRootPath(self):
+ return self._test_root_path
+
+ def CreateTests(self, sub_tests_path=None):
+ """Creates the tests at given test_path.
+
+ Subclasses must implement this.
+
+ Args:
+ sub_tests_path: the child path of test_root_path containing the tests to
+ run. If unspecified will be set to test_root_path.
+
+ Returns:
+ an array of AbstractTestSuite, or empty AbstractTestSuite if no tests
+ were defined
+ """
+ raise NotImplementedError