diff options
author | Gennadiy Civil <gennadiycivil@users.noreply.github.com> | 2018-02-27 15:00:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-27 15:00:29 (GMT) |
commit | d4f77c1e3a340b37f5bed5e1e4de7d741f1d1199 (patch) | |
tree | fd25c57276fa42ec365f1ca05b4853ab459697e4 /googletest/include/gtest/gtest.h | |
parent | 3498a1ac52deb83f30b8170c78bfba9dc6227198 (diff) | |
parent | ac34e6c950925df7165e626becd3f9d64dcd584b (diff) | |
download | googletest-d4f77c1e3a340b37f5bed5e1e4de7d741f1d1199.zip googletest-d4f77c1e3a340b37f5bed5e1e4de7d741f1d1199.tar.gz googletest-d4f77c1e3a340b37f5bed5e1e4de7d741f1d1199.tar.bz2 |
Merge branch 'master' into win-libcxx2refs/pull/1423/head
Diffstat (limited to 'googletest/include/gtest/gtest.h')
-rw-r--r-- | googletest/include/gtest/gtest.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h index 01994e6..26e787d 100644 --- a/googletest/include/gtest/gtest.h +++ b/googletest/include/gtest/gtest.h @@ -138,7 +138,7 @@ GTEST_DECLARE_int32_(stack_trace_depth); // When this flag is specified, a failed assertion will throw an // exception if exceptions are enabled, or exit the program with a -// non-zero code otherwise. +// non-zero code otherwise. For use with an external test framework. GTEST_DECLARE_bool_(throw_on_failure); // When this flag is set with a "host:port" string, on supported @@ -1004,6 +1004,18 @@ class Environment { virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } }; +#if GTEST_HAS_EXCEPTIONS + +// Exception which can be thrown from TestEventListener::OnTestPartResult. +class GTEST_API_ AssertionException + : public internal::GoogleTestFailureException { + public: + explicit AssertionException(const TestPartResult& result) + : GoogleTestFailureException(result) {} +}; + +#endif // GTEST_HAS_EXCEPTIONS + // The interface for tracing execution of tests. The methods are organized in // the order the corresponding events are fired. class TestEventListener { @@ -1032,6 +1044,8 @@ class TestEventListener { virtual void OnTestStart(const TestInfo& test_info) = 0; // Fired after a failed assertion or a SUCCEED() invocation. + // If you want to throw an exception from this function to skip to the next + // TEST, it must be AssertionException defined above, or inherited from it. virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; // Fired after the test ends. |