Makes gtest report failures in ad hoc test assertions executed before RUN_ALL_TESTS().
This commit is contained in:
		@@ -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();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user