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

am: a6088f0828

Change-Id: Ic8e694a1e2a8a17cb47bb7fc050ad57416f75e10
This commit is contained in:
Jonathan Basseri
2017-09-19 19:03:10 +00:00
committed by android-build-merger

View File

@@ -49,7 +49,19 @@ class GTestSuite(test_suite.AbstractTestSuite):
options: command line options options: command line options
adb: adb interface 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) logger.Log(shell_cmd)
if not options.preview: if not options.preview:
# gtest will log to test results to stdout, so no need to do any # gtest will log to test results to stdout, so no need to do any