summaryrefslogtreecommitdiff
path: root/src/gtest-internal-inl.h
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-19 21:20:40 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2009-06-19 21:20:40 +0000
commit535de1065311cc5e95e84811dc05f513393fa940 (patch)
treeb22229f7fb18d6fbf3f41322727d1c53c75f39f0 /src/gtest-internal-inl.h
parentc427f5e8ab231012d7663a0ee408f1225bac971a (diff)
downloadgtest-535de1065311cc5e95e84811dc05f513393fa940.tar.gz
gtest-535de1065311cc5e95e84811dc05f513393fa940.tar.bz2
gtest-535de1065311cc5e95e84811dc05f513393fa940.tar.xz
Moves TestResult from gtest-internal-inl.h to gtest.h to prepare for the even listener API work (by Vlad Losev); cleans up the scons script (by Zhanyong Wan).
git-svn-id: http://googletest.googlecode.com/svn/trunk@271 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'src/gtest-internal-inl.h')
-rw-r--r--src/gtest-internal-inl.h96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h
index f909a0a..cbe3dbf 100644
--- a/src/gtest-internal-inl.h
+++ b/src/gtest-internal-inl.h
@@ -472,102 +472,6 @@ class TestPropertyKeyIs {
String key_;
};
-// The result of a single Test. This includes a list of
-// TestPartResults, a list of TestProperties, a count of how many
-// death tests there are in the Test, and how much time it took to run
-// the Test.
-//
-// TestResult is not copyable.
-class TestResult {
- public:
- // Creates an empty TestResult.
- TestResult();
-
- // D'tor. Do not inherit from TestResult.
- ~TestResult();
-
- // Gets the list of TestPartResults.
- const internal::List<TestPartResult> & test_part_results() const {
- return test_part_results_;
- }
-
- // Gets the list of TestProperties.
- const internal::List<internal::TestProperty> & test_properties() const {
- return test_properties_;
- }
-
- // Gets the number of successful test parts.
- int successful_part_count() const;
-
- // Gets the number of failed test parts.
- int failed_part_count() const;
-
- // 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 total_part_count() const;
-
- // Returns true iff the test passed (i.e. no test part failed).
- bool Passed() const { return !Failed(); }
-
- // Returns true iff the test failed.
- bool Failed() const { return failed_part_count() > 0; }
-
- // 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_; }
-
- // Sets the elapsed time.
- void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
-
- // Adds a test part result to the list.
- void AddTestPartResult(const TestPartResult& test_part_result);
-
- // Adds a test property to the list. The property is validated and may add
- // a non-fatal failure if invalid (e.g., if it conflicts with reserved
- // key names). If a property is already recorded for the same key, the
- // value will be updated, rather than storing multiple values for the same
- // key.
- void RecordProperty(const internal::TestProperty& test_property);
-
- // Adds a failure if the key is a reserved attribute of Google Test
- // testcase tags. Returns true if the property is valid.
- // TODO(russr): Validate attribute names are legal and human readable.
- static bool ValidateTestProperty(const internal::TestProperty& test_property);
-
- // Returns the death test count.
- int death_test_count() const { return death_test_count_; }
-
- // 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:
- // Protects mutable state of the property list and of owned properties, whose
- // values may be updated.
- internal::Mutex test_properites_mutex_;
-
- // The list of TestPartResults
- internal::List<TestPartResult> test_part_results_;
- // The list of TestProperties
- internal::List<internal::TestProperty> test_properties_;
- // Running count of death tests.
- int death_test_count_;
- // The elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
-
- // We disallow copying TestResult.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
-}; // class TestResult
-
class TestInfoImpl {
public:
TestInfoImpl(TestInfo* parent, const char* test_case_name,