Makes gtest report failures in ad hoc test assertions executed before RUN_ALL_TESTS().

This commit is contained in:
zhanyong.wan
2010-06-16 22:47:13 +00:00
parent 985a30360c
commit 682c89f755
4 changed files with 21 additions and 7 deletions

View File

@@ -35,6 +35,10 @@
#include <stdio.h>
#include <gtest/gtest.h>
#define GTEST_IMPLEMENTATION_ 1 // Required for the next #include.
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
namespace testing {
GTEST_DECLARE_string_(filter);
}
@@ -123,6 +127,7 @@ int RunAllTests(MyEnvironment* env, FailureType failure) {
env->Reset();
env->set_failure_in_set_up(failure);
test_was_run = false;
testing::internal::GetUnitTestImpl()->ClearAdHocTestResult();
return RUN_ALL_TESTS();
}