Merge "Support -c and -m for GTEST." am: 85578a8515

am: 02dbc20df0

Change-Id: I8151028f99c05f340aa491357811e05a875fed2d
This commit is contained in:
Jonathan Basseri
2017-09-19 18:55:41 +00:00
committed by android-build-merger

View File

@@ -49,7 +49,19 @@ class GTestSuite(test_suite.AbstractTestSuite):
options: command line options
adb: adb interface
"""
shell_cmd = adb.PreviewShellCommand(self.GetTargetExecPath())
test_class = "*"
test_method = "*"
if options.test_class is not None:
test_class = options.test_class.lstrip()
if options.test_method is not None:
test_method = options.test_method.lstrip()
filter_arg = ""
if test_class != "*" or test_method != "*":
filter_arg = "--gtest_filter=%s.%s" % (test_class, test_method)
shell_cmd = adb.PreviewShellCommand(
" ".join((self.GetTargetExecPath(), filter_arg)))
logger.Log(shell_cmd)
if not options.preview:
# gtest will log to test results to stdout, so no need to do any