38 #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ 39 #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ 41 #include "gtest/internal/gtest-death-test-internal.h" 53 #if GTEST_HAS_DEATH_TEST 170 # define ASSERT_EXIT(statement, predicate, regex) \ 171 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) 175 # define EXPECT_EXIT(statement, predicate, regex) \ 176 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) 181 # define ASSERT_DEATH(statement, regex) \ 182 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) 186 # define EXPECT_DEATH(statement, regex) \ 187 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) 195 explicit ExitedWithCode(
int exit_code);
196 bool operator()(
int exit_status)
const;
199 void operator=(
const ExitedWithCode & other);
201 const int exit_code_;
204 # if !GTEST_OS_WINDOWS 210 explicit KilledBySignal(
int signum);
211 bool operator()(
int exit_status)
const;
215 # endif // !GTEST_OS_WINDOWS 262 # define EXPECT_DEBUG_DEATH(statement, regex) \ 263 GTEST_EXECUTE_STATEMENT_(statement, regex) 265 # define ASSERT_DEBUG_DEATH(statement, regex) \ 266 GTEST_EXECUTE_STATEMENT_(statement, regex) 270 # define EXPECT_DEBUG_DEATH(statement, regex) \ 271 EXPECT_DEATH(statement, regex) 273 # define ASSERT_DEBUG_DEATH(statement, regex) \ 274 ASSERT_DEATH(statement, regex) 276 # endif // NDEBUG for EXPECT_DEBUG_DEATH 277 #endif // GTEST_HAS_DEATH_TEST 284 #if GTEST_HAS_DEATH_TEST 285 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ 286 EXPECT_DEATH(statement, regex) 287 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ 288 ASSERT_DEATH(statement, regex) 290 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ 291 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) 292 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ 293 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) 298 #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
GTEST_DECLARE_string_(death_test_style)