summaryrefslogtreecommitdiffstats
path: root/testrunner
diff options
context:
space:
mode:
authorNiko Catania <>2009-04-03 14:12:46 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-03 14:12:46 -0700
commita6dc2abe8ddb4e4ad7d1e5917d9dad0b197d10ca (patch)
tree89a844f2a50847711ced21aff52f1da29b6f4145 /testrunner
parent8ec960039f19b4532d5b74098fad965f7e0e78aa (diff)
downloadandroid_development-a6dc2abe8ddb4e4ad7d1e5917d9dad0b197d10ca.tar.gz
android_development-a6dc2abe8ddb4e4ad7d1e5917d9dad0b197d10ca.tar.bz2
android_development-a6dc2abe8ddb4e4ad7d1e5917d9dad0b197d10ca.zip
AI 144500: Added support for some extra make arguments for some testsuite.
For instance the libstdc++ testsuite requires BIONIC_TESTS=1 to actually build the tests. * development/testrunner/test_defs.py: Parse the new extra_make_args attribute. * development/testrunner/runtest.py: Added support for extra make arguments. Some testsuite requires this to actually be built. Changed the log statement to log what is actually being done. * development/testrunner/test_defs.xml: Added extra make argument to enable the libstdc++ tests. Automated import of CL 144500
Diffstat (limited to 'testrunner')
-rwxr-xr-xtestrunner/runtest.py15
-rw-r--r--testrunner/test_defs.py11
-rw-r--r--testrunner/test_defs.xml7
3 files changed, 26 insertions, 7 deletions
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index b72727064..c13fb4cc9 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -177,17 +177,20 @@ class TestRunner(object):
def _DoBuild(self):
logger.SilentLog("Building tests...")
target_set = Set()
+ extra_args_set = Set()
for test_suite in self._GetTestsToRun():
- self._AddBuildTarget(test_suite.GetBuildPath(), target_set)
+ self._AddBuildTarget(test_suite, target_set, extra_args_set)
if target_set:
if self._options.coverage:
self._coverage_gen.EnableCoverageBuild()
self._AddBuildTarget(self._coverage_gen.GetEmmaBuildPath(), target_set)
target_build_string = " ".join(list(target_set))
- logger.Log("mmm %s" % target_build_string)
- cmd = 'ONE_SHOT_MAKEFILE="%s" make -C "%s" files' % (target_build_string,
- self._root_path)
+ extra_args_string = " ".join(list(extra_args_set))
+ cmd = 'ONE_SHOT_MAKEFILE="%s" make -C "%s" files %s' % (
+ target_build_string, self._root_path, extra_args_string)
+ logger.Log(cmd)
+
if self._options.preview:
# in preview mode, just display to the user what command would have been
# run
@@ -197,11 +200,13 @@ class TestRunner(object):
logger.Log("Syncing to device...")
self._adb.Sync()
- def _AddBuildTarget(self, build_dir, target_set):
+ def _AddBuildTarget(self, test_suite, target_set, extra_args_set):
+ build_dir = test_suite.GetBuildPath()
if build_dir is not None:
build_file_path = os.path.join(build_dir, "Android.mk")
if os.path.isfile(os.path.join(self._root_path, build_file_path)):
target_set.add(build_file_path)
+ extra_args_set.add(test_suite.GetExtraMakeArgs())
def _GetTestsToRun(self):
"""Get a list of TestSuite objects to run, based on command line args."""
diff --git a/testrunner/test_defs.py b/testrunner/test_defs.py
index f7a435e95..2cdcfa87c 100644
--- a/testrunner/test_defs.py
+++ b/testrunner/test_defs.py
@@ -158,6 +158,7 @@ class TestSuite(object):
_BUILD_ATTR = "build_path"
_CONTINUOUS_ATTR = "continuous"
_DESCRIPTION_ATTR = "description"
+ _EXTRA_MAKE_ARGS_ATTR = "extra_make_args"
_DEFAULT_RUNNER = "android.test.InstrumentationTestRunner"
@@ -202,6 +203,11 @@ class TestSuite(object):
self._description = suite_element.getAttribute(self._DESCRIPTION_ATTR)
else:
self._description = ""
+ if suite_element.hasAttribute(self._EXTRA_MAKE_ARGS_ATTR):
+ self._extra_make_args = suite_element.getAttribute(
+ self._EXTRA_MAKE_ARGS_ATTR)
+ else:
+ self._extra_make_args = ""
def GetName(self):
return self._name
@@ -235,8 +241,13 @@ class TestSuite(object):
return self._native
def GetDescription(self):
+ """Returns a description if available, an empty string otherwise."""
return self._description
+ def GetExtraMakeArgs(self):
+ """Returns the extra make args if available, an empty string otherwise."""
+ return self._extra_make_args
+
def Parse(file_path):
"""Parses out a TestDefinitions from given path to xml file.
diff --git a/testrunner/test_defs.xml b/testrunner/test_defs.xml
index 9007a11bf..03ecbbcfd 100644
--- a/testrunner/test_defs.xml
+++ b/testrunner/test_defs.xml
@@ -68,9 +68,11 @@ Native tests:
false if they are under development.
description: Optional string. Default is empty. Short description (typically
less than 60 characters) about this test.
+ extra_make_args: Optional string. Default is empty. Some test module require
+ extra make arguments to build. This string is append to the make command.
These attributes map to the following commands:
- make <build_path>/Android.mk
+ make <build_path>/Android.mk <extra_make_args>
adb sync
for test_prog in <tests built>; do
adb shell "/system/bin/${test_prog} >/dev/null 2>&1;echo \$?"
@@ -259,7 +261,8 @@ Native tests:
<!-- native tests -->
<test-native name="libstdcpp"
build_path="system/extras/tests/bionic/libstdc++"
- description="Bionic libstdc++." />
+ description="Bionic libstdc++."
+ extra_make_args="BIONIC_TESTS=1" />
</test-definitions>