Skip to content

Commit 85578a8

Browse files
Jonathan BasseriGerrit Code Review
authored andcommitted
Merge "Support -c and -m for GTEST."
2 parents c18174e + f6051de commit 85578a8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

testrunner/test_defs/gtest.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,19 @@ def Run(self, options, adb):
4949
options: command line options
5050
adb: adb interface
5151
"""
52-
shell_cmd = adb.PreviewShellCommand(self.GetTargetExecPath())
52+
53+
test_class = "*"
54+
test_method = "*"
55+
if options.test_class is not None:
56+
test_class = options.test_class.lstrip()
57+
if options.test_method is not None:
58+
test_method = options.test_method.lstrip()
59+
filter_arg = ""
60+
if test_class != "*" or test_method != "*":
61+
filter_arg = "--gtest_filter=%s.%s" % (test_class, test_method)
62+
63+
shell_cmd = adb.PreviewShellCommand(
64+
" ".join((self.GetTargetExecPath(), filter_arg)))
5365
logger.Log(shell_cmd)
5466
if not options.preview:
5567
# gtest will log to test results to stdout, so no need to do any

0 commit comments

Comments
 (0)