Adds sample4_unittest to scons (by Vlad Losev); adds logic for getting the thread count on Mac (by Vlad Losev); adds HasFailure() and HasNonfatalFailure() (by Zhanyong Wan).

This commit is contained in:
zhanyong.wan
2009-04-07 21:03:22 +00:00
parent 0da92aaf7f
commit c12f63214e
8 changed files with 189 additions and 4 deletions

View File

@@ -1852,7 +1852,7 @@ int TestResult::failed_part_count() const {
}
// Returns true iff the test part fatally failed.
static bool TestPartFatallyFailed(const TestPartResult & result) {
static bool TestPartFatallyFailed(const TestPartResult& result) {
return result.fatally_failed();
}
@@ -1861,6 +1861,16 @@ bool TestResult::HasFatalFailure() const {
return test_part_results_.CountIf(TestPartFatallyFailed) > 0;
}
// Returns true iff the test part non-fatally failed.
static bool TestPartNonfatallyFailed(const TestPartResult& result) {
return result.nonfatally_failed();
}
// Returns true iff the test has a non-fatal failure.
bool TestResult::HasNonfatalFailure() const {
return test_part_results_.CountIf(TestPartNonfatallyFailed) > 0;
}
// Gets the number of all test parts. This is the sum of the number
// of successful test parts and the number of failed test parts.
int TestResult::total_part_count() const {
@@ -2059,6 +2069,12 @@ bool Test::HasFatalFailure() {
return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
}
// Returns true iff the current test has a non-fatal failure.
bool Test::HasNonfatalFailure() {
return internal::GetUnitTestImpl()->current_test_result()->
HasNonfatalFailure();
}
// class TestInfo
// Constructs a TestInfo object. It assumes ownership of the test factory