summaryrefslogtreecommitdiffstats
path: root/googletest/include
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-12-05 20:53:48 (GMT)
committerMark Barolak <mbar@google.com>2019-12-06 16:34:34 (GMT)
commit9ed99c6c837ae1cbfcabd36959fc802ebb5ae07f (patch)
treecddb4102527327f12f96f36cef8631848e53512a /googletest/include
parent2002f267f05be6f41a3d458954414ba2bfa3ff1d (diff)
downloadgoogletest-9ed99c6c837ae1cbfcabd36959fc802ebb5ae07f.zip
googletest-9ed99c6c837ae1cbfcabd36959fc802ebb5ae07f.tar.gz
googletest-9ed99c6c837ae1cbfcabd36959fc802ebb5ae07f.tar.bz2
Googletest export
Change googletest to notice failures during SetUpTestSuite() and TearDownTestSuite(). Previously, errors that occurred during those functions were logged but otherwise ignored. After this change, such failures will cause the test to fail and a brief summary will be printed at the bottom of the test log. See https://github.com/google/googletest/issues/2330. PiperOrigin-RevId: 284033342
Diffstat (limited to 'googletest/include')
-rw-r--r--googletest/include/gtest/gtest.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index 8eda6ea..eb44c4c 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -412,8 +412,6 @@ class GTEST_API_ Test {
// test in test case Foo. Hence a sub-class can define its own
// SetUpTestSuite() method to shadow the one defined in the super
// class.
- // Failures that happen during SetUpTestSuite are logged but otherwise
- // ignored.
static void SetUpTestSuite() {}
// Tears down the stuff shared by all tests in this test suite.
@@ -422,8 +420,6 @@ class GTEST_API_ Test {
// test in test case Foo. Hence a sub-class can define its own
// TearDownTestSuite() method to shadow the one defined in the super
// class.
- // Failures that happen during TearDownTestSuite are logged but otherwise
- // ignored.
static void TearDownTestSuite() {}
// Legacy API is deprecated but still available
@@ -889,7 +885,9 @@ class GTEST_API_ TestSuite {
bool Passed() const { return !Failed(); }
// Returns true if and only if the test suite failed.
- bool Failed() const { return failed_test_count() > 0; }
+ bool Failed() const {
+ return failed_test_count() > 0 || ad_hoc_test_result().Failed();
+ }
// Returns the elapsed time, in milliseconds.
TimeInMillis elapsed_time() const { return elapsed_time_; }