Runs the test and updates the test result.
| 3990 | |
| 3991 | // Runs the test and updates the test result. |
| 3992 | void Test::Run() { |
| 3993 | if (!HasSameFixtureClass()) return; |
| 3994 | |
| 3995 | internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); |
| 3996 | impl->os_stack_trace_getter()->UponLeavingGTest(); |
| 3997 | internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()"); |
| 3998 | // We will run the test only if SetUp() was successful and didn't call |
| 3999 | // GTEST_SKIP(). |
| 4000 | if (!HasFatalFailure() && !IsSkipped()) { |
| 4001 | impl->os_stack_trace_getter()->UponLeavingGTest(); |
| 4002 | internal::HandleExceptionsInMethodIfSupported( |
| 4003 | this, &Test::TestBody, "the test body"); |
| 4004 | } |
| 4005 | |
| 4006 | // However, we want to clean up as much as possible. Hence we will |
| 4007 | // always call TearDown(), even if SetUp() or the test body has |
| 4008 | // failed. |
| 4009 | impl->os_stack_trace_getter()->UponLeavingGTest(); |
| 4010 | internal::HandleExceptionsInMethodIfSupported( |
| 4011 | this, &Test::TearDown, "TearDown()"); |
| 4012 | } |
| 4013 | |
| 4014 | // Returns true iff the current test has a fatal failure. |
| 4015 | bool Test::HasFatalFailure() { |
no test coverage detected