Skip to content

Commit a6a05c9

Browse files
committed
fix test
1 parent 7d14632 commit a6a05c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/benchmark_setup_teardown_cb_types_gtest.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ TEST_F(BenchmarkTest, FunctorMove) {
112112

113113
// Test that Setup/Teardown can not take nullptr
114114
TEST_F(BenchmarkTest, NullptrTest) {
115+
#if GTEST_HAS_DEATH_TEST
116+
// Tests only runnable in debug mode (when BM_CHECK is enabled).
117+
#ifndef NDEBUG
118+
#ifndef TEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS
115119
EXPECT_DEATH(bm->Setup(nullptr), "setup != nullptr");
116120
EXPECT_DEATH(bm->Teardown(nullptr), "teardown != nullptr");
121+
#else
122+
GTEST_SKIP() << "Test skipped because BM_CHECK is disabled";
123+
#endif
124+
#endif
125+
#endif
117126
}

0 commit comments

Comments
 (0)