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

@@ -548,6 +548,9 @@ class TestResult {
// Returns true iff the test fatally failed.
bool HasFatalFailure() const;
// Returns true iff the test has a non-fatal failure.
bool HasNonfatalFailure() const;
// Returns the elapsed time, in milliseconds.
TimeInMillis elapsed_time() const { return elapsed_time_; }
@@ -575,6 +578,9 @@ class TestResult {
// Increments the death test count, returning the new count.
int increment_death_test_count() { return ++death_test_count_; }
// Clears the test part results.
void ClearTestPartResults() { test_part_results_.Clear(); }
// Clears the object.
void Clear();
private:
@@ -1300,6 +1306,11 @@ inline UnitTestImpl* GetUnitTestImpl() {
return UnitTest::GetInstance()->impl();
}
// Clears all test part results of the current test.
inline void ClearCurrentTestPartResults() {
GetUnitTestImpl()->current_test_result()->ClearTestPartResults();
}
// Internal helper functions for implementing the simple regular
// expression matcher.
bool IsInSet(char ch, const char* str);