summaryrefslogtreecommitdiff
path: root/include/gtest/gtest-spi.h
diff options
context:
space:
mode:
authorshiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-09-26 16:08:30 +0000
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-09-26 16:08:30 +0000
commitf0e809a3c9946e99595d4faeb0a16bdc2ca9ffd5 (patch)
tree68f49941b72ce8f866c4f762cb3043504804800f /include/gtest/gtest-spi.h
parentdc8c9fa9f38a6a8fc2b78d8096e8d3f1c969cb7c (diff)
downloadgoogletest-f0e809a3c9946e99595d4faeb0a16bdc2ca9ffd5.tar.gz
Lots of changes:
* changes the XML report format to match JUnit/Ant's. * improves file path handling. * allows the user to disable RTTI using the GTEST_HAS_RTTI macro. * makes the code compile with -Wswitch-enum. git-svn-id: http://googletest.googlecode.com/svn/trunk@98 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'include/gtest/gtest-spi.h')
-rw-r--r--include/gtest/gtest-spi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/gtest/gtest-spi.h b/include/gtest/gtest-spi.h
index 75d0dcf..5315b97 100644
--- a/include/gtest/gtest-spi.h
+++ b/include/gtest/gtest-spi.h
@@ -55,6 +55,7 @@ class TestPartResult {
: type_(type),
file_name_(file_name),
line_number_(line_number),
+ summary_(ExtractSummary(message)),
message_(message) {
}
@@ -69,6 +70,9 @@ class TestPartResult {
// or -1 if it's unknown.
int line_number() const { return line_number_; }
+ // Gets the summary of the failure message.
+ const char* summary() const { return summary_.c_str(); }
+
// Gets the message associated with the test part.
const char* message() const { return message_.c_str(); }
@@ -86,12 +90,17 @@ class TestPartResult {
private:
TestPartResultType type_;
+ // Gets the summary of the failure message by omitting the stack
+ // trace in it.
+ static internal::String ExtractSummary(const char* message);
+
// The name of the source file where the test part took place, or
// NULL if the source file is unknown.
internal::String file_name_;
// The line in the source file where the test part took place, or -1
// if the line number is unknown.
int line_number_;
+ internal::String summary_; // The test failure summary.
internal::String message_; // The test failure message.
};