Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
a28968d6
Commit
a28968d6
authored
Aug 01, 2018
by
Gennadiy Civil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to googletest break on failure and googletest filter unittests
parent
d75922ca
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
31 deletions
+38
-31
BUILD.bazel
googletest/test/BUILD.bazel
+23
-16
googletest-break-on-failure-unittest.py
googletest/test/googletest-break-on-failure-unittest.py
+4
-4
googletest-break-on-failure-unittest_.cc
googletest/test/googletest-break-on-failure-unittest_.cc
+0
-0
googletest-filter-unittest.py
googletest/test/googletest-filter-unittest.py
+6
-6
googletest-filter-unittest_.cc
googletest/test/googletest-filter-unittest_.cc
+0
-0
googletest-throw-on-failure-test.py
googletest/test/googletest-throw-on-failure-test.py
+4
-4
googletest-throw-on-failure-test_.cc
googletest/test/googletest-throw-on-failure-test_.cc
+1
-1
No files found.
googletest/test/BUILD.bazel
View file @
a28968d6
...
...
@@ -227,35 +227,39 @@ py_test(
)
cc_binary(
name = "g
test_filter_
unittest_",
name = "g
oogletest-filter-
unittest_",
testonly = 1,
srcs = ["g
test_filter_
unittest_.cc"],
srcs = ["g
oogletest-filter-
unittest_.cc"],
deps = ["//:gtest"],
)
py_test(
name = "g
test_filter_
unittest",
size = "
small
",
srcs = ["g
test_filter_
unittest.py"],
data = [":g
test_filter_
unittest_"],
name = "g
oogletest-filter-
unittest",
size = "
medium
",
srcs = ["g
oogletest-filter-
unittest.py"],
data = [":g
oogletest-filter-
unittest_"],
deps = [":gtest_test_utils"],
)
cc_binary(
name = "g
test_break_on_failure_
unittest_",
name = "g
oogletest-break-on-failure-
unittest_",
testonly = 1,
srcs = ["g
test_break_on_failure_
unittest_.cc"],
srcs = ["g
oogletest-break-on-failure-
unittest_.cc"],
deps = ["//:gtest"],
)
py_test(
name = "g
test_break_on_failure_
unittest",
name = "g
oogletest-break-on-failure-
unittest",
size = "small",
srcs = ["g
test_break_on_failure_
unittest.py"],
data = [":g
test_break_on_failure_
unittest_"],
srcs = ["g
oogletest-break-on-failure-
unittest.py"],
data = [":g
oogletest-break-on-failure-
unittest_"],
deps = [":gtest_test_utils"],
)
cc_test(
name = "gtest_assert_by_exception_test",
size = "small",
...
...
@@ -263,21 +267,24 @@ cc_test(
deps = ["//:gtest"],
)
cc_binary(
name = "g
test_throw_on_failure_
test_",
name = "g
oogletest-throw-on-failure-
test_",
testonly = 1,
srcs = ["g
test_throw_on_failure_
test_.cc"],
srcs = ["g
oogletest-throw-on-failure-
test_.cc"],
deps = ["//:gtest"],
)
py_test(
name = "g
test_throw_on_failure_
test",
name = "g
oogletest-throw-on-failure-
test",
size = "small",
srcs = ["g
test_throw_on_failure_
test.py"],
data = [":g
test_throw_on_failure_
test_"],
srcs = ["g
oogletest-throw-on-failure-
test.py"],
data = [":g
oogletest-throw-on-failure-
test_"],
deps = [":gtest_test_utils"],
)
cc_binary(
name = "gtest_list_tests_unittest_",
testonly = 1,
...
...
googletest/test/g
test_break_on_failure_
unittest.py
→
googletest/test/g
oogletest-break-on-failure-
unittest.py
View file @
a28968d6
...
...
@@ -34,7 +34,7 @@
A user can ask Google Test to seg-fault when an assertion fails, using
either the GTEST_BREAK_ON_FAILURE environment variable or the
--gtest_break_on_failure flag. This script tests such functionality
by invoking g
test_break_on_failure_
unittest_ (a program written with
by invoking g
oogletest-break-on-failure-
unittest_ (a program written with
Google Test) with different environments and command line flags.
"""
...
...
@@ -59,9 +59,9 @@ THROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
# The environment variable for enabling/disabling the catch-exceptions mode.
CATCH_EXCEPTIONS_ENV_VAR
=
'GTEST_CATCH_EXCEPTIONS'
# Path to the g
test_break_on_failure_
unittest_ program.
# Path to the g
oogletest-break-on-failure-
unittest_ program.
EXE_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
test_break_on_failure_
unittest_'
)
'g
oogletest-break-on-failure-
unittest_'
)
environ
=
gtest_test_utils
.
environ
...
...
@@ -95,7 +95,7 @@ class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
"""
def
RunAndVerify
(
self
,
env_var_value
,
flag_value
,
expect_seg_fault
):
"""Runs g
test_break_on_failure_
unittest_ and verifies that it does
"""Runs g
oogletest-break-on-failure-
unittest_ and verifies that it does
(or does not) have a seg-fault.
Args:
...
...
googletest/test/g
test_break_on_failure_
unittest_.cc
→
googletest/test/g
oogletest-break-on-failure-
unittest_.cc
View file @
a28968d6
File moved
googletest/test/g
test_filter_
unittest.py
→
googletest/test/g
oogletest-filter-
unittest.py
View file @
a28968d6
...
...
@@ -33,7 +33,7 @@
A user can specify which test(s) in a Google Test program to run via either
the GTEST_FILTER environment variable or the --gtest_filter flag.
This script tests such functionality by invoking
g
test_filter_
unittest_ (a program written with Google Test) with different
g
oogletest-filter-
unittest_ (a program written with Google Test) with different
environments and command line flags.
Note that test sharding may also influence which tests are filtered. Therefore,
...
...
@@ -100,8 +100,8 @@ FILTER_FLAG = 'gtest_filter'
# The command line flag for including disabled tests.
ALSO_RUN_DISABLED_TESTS_FLAG
=
'gtest_also_run_disabled_tests'
# Command to run the g
test_filter_
unittest_ program.
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
test_filter_
unittest_'
)
# Command to run the g
oogletest-filter-
unittest_ program.
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
oogletest-filter-
unittest_'
)
# Regex for determining whether parameterized tests are enabled in the binary.
PARAM_TEST_REGEX
=
re
.
compile
(
r'/ParamTest'
)
...
...
@@ -120,7 +120,7 @@ LIST_TESTS_FLAG = '--gtest_list_tests'
SUPPORTS_DEATH_TESTS
=
'HasDeathTest'
in
gtest_test_utils
.
Subprocess
(
[
COMMAND
,
LIST_TESTS_FLAG
])
.
output
# Full names of all tests in g
test_filter_
unittests_.
# Full names of all tests in g
oogletest-filter-
unittests_.
PARAM_TESTS
=
[
'SeqP/ParamTest.TestX/0'
,
'SeqP/ParamTest.TestX/1'
,
...
...
@@ -292,7 +292,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
args
=
None
,
check_exit_0
=
False
):
"""Checks that binary runs correct tests for the given filter and shard.
Runs all shards of g
test_filter_
unittest_ with the given filter, and
Runs all shards of g
oogletest-filter-
unittest_ with the given filter, and
verifies that the right set of tests were run. The union of tests run
on each shard should be identical to tests_to_run, without duplicates.
If check_exit_0, .
...
...
@@ -330,7 +330,7 @@ class GTestFilterUnitTest(gtest_test_utils.TestCase):
def
RunAndVerifyAllowingDisabled
(
self
,
gtest_filter
,
tests_to_run
):
"""Checks that the binary runs correct set of tests for the given filter.
Runs g
test_filter_
unittest_ with the given filter, and enables
Runs g
oogletest-filter-
unittest_ with the given filter, and enables
disabled tests. Verifies that the right set of tests were run.
Args:
...
...
googletest/test/g
test_filter_
unittest_.cc
→
googletest/test/g
oogletest-filter-
unittest_.cc
View file @
a28968d6
File moved
googletest/test/g
test_throw_on_failure_
test.py
→
googletest/test/g
oogletest-throw-on-failure-
test.py
View file @
a28968d6
...
...
@@ -31,7 +31,7 @@
"""Tests Google Test's throw-on-failure mode with exceptions disabled.
This script invokes g
test_throw_on_failure_
test_ (a program written with
This script invokes g
oogletest-throw-on-failure-
test_ (a program written with
Google Test) with different environments and command line flags.
"""
...
...
@@ -46,10 +46,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling the throw-on-failure mode.
THROW_ON_FAILURE
=
'gtest_throw_on_failure'
# Path to the g
test_throw_on_failure_
test_ program, compiled with
# Path to the g
oogletest-throw-on-failure-
test_ program, compiled with
# exceptions disabled.
EXE_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
test_throw_on_failure_
test_'
)
'g
oogletest-throw-on-failure-
test_'
)
# Utilities.
...
...
@@ -81,7 +81,7 @@ class ThrowOnFailureTest(gtest_test_utils.TestCase):
"""Tests the throw-on-failure mode."""
def
RunAndVerify
(
self
,
env_var_value
,
flag_value
,
should_fail
):
"""Runs g
test_throw_on_failure_
test_ and verifies that it does
"""Runs g
oogletest-throw-on-failure-
test_ and verifies that it does
(or does not) exit with a non-zero code.
Args:
...
...
googletest/test/g
test_throw_on_failure_
test_.cc
→
googletest/test/g
oogletest-throw-on-failure-
test_.cc
View file @
a28968d6
...
...
@@ -32,7 +32,7 @@
// Tests Google Test's throw-on-failure mode with exceptions disabled.
//
// This program must be compiled with exceptions disabled. It will be
// invoked by g
test_throw_on_failure_
test.py, and is expected to exit
// invoked by g
oogletest-throw-on-failure-
test.py, and is expected to exit
// with non-zero in the throw-on-failure mode or 0 otherwise.
#include "gtest/gtest.h"
...
...
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