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" 52 #if GTEST_HAS_DEATH_TEST 168 # define ASSERT_EXIT(statement, predicate, regex) \ 169 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) 173 # define EXPECT_EXIT(statement, predicate, regex) \ 174 GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) 179 # define ASSERT_DEATH(statement, regex) \ 180 ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) 184 # define EXPECT_DEATH(statement, regex) \ 185 EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) 192 explicit ExitedWithCode(
int exit_code);
193 bool operator()(
int exit_status)
const;
196 void operator=(
const ExitedWithCode& other);
198 const int exit_code_;
201 # if !GTEST_OS_WINDOWS 206 explicit KilledBySignal(
int signum);
207 bool operator()(
int exit_status)
const;
211 # endif // !GTEST_OS_WINDOWS 258 # define EXPECT_DEBUG_DEATH(statement, regex) \ 259 GTEST_EXECUTE_STATEMENT_(statement, regex) 261 # define ASSERT_DEBUG_DEATH(statement, regex) \ 262 GTEST_EXECUTE_STATEMENT_(statement, regex) 266 # define EXPECT_DEBUG_DEATH(statement, regex) \ 267 EXPECT_DEATH(statement, regex) 269 # define ASSERT_DEBUG_DEATH(statement, regex) \ 270 ASSERT_DEATH(statement, regex) 272 # endif // NDEBUG for EXPECT_DEBUG_DEATH 273 #endif // GTEST_HAS_DEATH_TEST 280 #if GTEST_HAS_DEATH_TEST 281 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ 282 EXPECT_DEATH(statement, regex) 283 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ 284 ASSERT_DEATH(statement, regex) 286 # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ 287 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) 288 # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ 289 GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) 294 #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
GTEST_DECLARE_string_(death_test_style)