Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
b888e23f
Commit
b888e23f
authored
Aug 01, 2018
by
Gennadiy Civil
Browse files
googletest list tests unitest
parent
35aa4fe9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
googletest/test/BUILD.bazel
googletest/test/BUILD.bazel
+5
-5
googletest/test/googletest-list-tests-unittest.py
googletest/test/googletest-list-tests-unittest.py
+7
-7
googletest/test/googletest-list-tests-unittest_.cc
googletest/test/googletest-list-tests-unittest_.cc
+0
-0
No files found.
googletest/test/BUILD.bazel
View file @
b888e23f
...
...
@@ -282,17 +282,17 @@ py_test(
cc_binary
(
name
=
"gtest
_
list
_
tests
_
unittest_"
,
name
=
"g
oogle
test
-
list
-
tests
-
unittest_"
,
testonly
=
1
,
srcs
=
[
"gtest
_
list
_
tests
_
unittest_.cc"
],
srcs
=
[
"g
oogle
test
-
list
-
tests
-
unittest_.cc"
],
deps
=
[
"//:gtest"
],
)
py_test
(
name
=
"gtest
_
list
_
tests
_
unittest"
,
name
=
"g
oogle
test
-
list
-
tests
-
unittest"
,
size
=
"small"
,
srcs
=
[
"gtest
_
list
_
tests
_
unittest.py"
],
data
=
[
":gtest
_
list
_
tests
_
unittest_"
],
srcs
=
[
"g
oogle
test
-
list
-
tests
-
unittest.py"
],
data
=
[
":g
oogle
test
-
list
-
tests
-
unittest_"
],
deps
=
[
":gtest_test_utils"
],
)
...
...
googletest/test/gtest
_
list
_
tests
_
unittest.py
→
googletest/test/g
oogle
test
-
list
-
tests
-
unittest.py
View file @
b888e23f
...
...
@@ -33,7 +33,7 @@
A user can ask Google Test to list all tests by specifying the
--gtest_list_tests flag. This script tests such functionality
by invoking gtest
_
list
_
tests
_
unittest_ (a program written with
by invoking g
oogle
test
-
list
-
tests
-
unittest_ (a program written with
Google Test) the command line flags.
"""
...
...
@@ -47,10 +47,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling listing all tests.
LIST_TESTS_FLAG
=
'gtest_list_tests'
# Path to the gtest
_
list
_
tests
_
unittest_ program.
EXE_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'gtest
_
list
_
tests
_
unittest_'
)
# Path to the g
oogle
test
-
list
-
tests
-
unittest_ program.
EXE_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
oogle
test
-
list
-
tests
-
unittest_'
)
# The expected output when running gtest
_
list
_
tests
_
unittest_ with
# The expected output when running g
oogle
test
-
list
-
tests
-
unittest_ with
# --gtest_list_tests
EXPECTED_OUTPUT_NO_FILTER_RE
=
re
.
compile
(
r
"""FooDeathTest\.
Test1
...
...
@@ -94,7 +94,7 @@ MyInstantiation/ValueParamTest\.
TestB/2 # GetParam\(\) = a very\\nlo{241}\.\.\.
"""
)
# The expected output when running gtest
_
list
_
tests
_
unittest_ with
# The expected output when running g
oogle
test
-
list
-
tests
-
unittest_ with
# --gtest_list_tests and --gtest_filter=Foo*.
EXPECTED_OUTPUT_FILTER_FOO_RE
=
re
.
compile
(
r
"""FooDeathTest\.
Test1
...
...
@@ -114,7 +114,7 @@ FooTest\.
def
Run
(
args
):
"""Runs gtest
_
list
_
tests
_
unittest_ and returns the list of tests printed."""
"""Runs g
oogle
test
-
list
-
tests
-
unittest_ and returns the list of tests printed."""
return
gtest_test_utils
.
Subprocess
([
EXE_PATH
]
+
args
,
capture_stderr
=
False
).
output
...
...
@@ -127,7 +127,7 @@ class GTestListTestsUnitTest(gtest_test_utils.TestCase):
"""Tests using the --gtest_list_tests flag to list all tests."""
def
RunAndVerify
(
self
,
flag_value
,
expected_output_re
,
other_flag
):
"""Runs gtest
_
list
_
tests
_
unittest_ and verifies that it prints
"""Runs g
oogle
test
-
list
-
tests
-
unittest_ and verifies that it prints
the correct tests.
Args:
...
...
googletest/test/gtest
_
list
_
tests
_
unittest_.cc
→
googletest/test/g
oogle
test
-
list
-
tests
-
unittest_.cc
View file @
b888e23f
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment