summaryrefslogtreecommitdiffstats
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 (GMT)
committershiqian <shiqian@861a406c-534a-0410-8894-cb66d6ee9925>2008-09-26 16:08:30 (GMT)
commit64cdcb69b28fc26e78d95c574187f7dd9830c84c (patch)
tree68f49941b72ce8f866c4f762cb3043504804800f /include/gtest/gtest-spi.h
parente79c3ccb73d68543e8ad98d69179dee74abff7ab (diff)
downloadgoogletest-64cdcb69b28fc26e78d95c574187f7dd9830c84c.zip
googletest-64cdcb69b28fc26e78d95c574187f7dd9830c84c.tar.gz
googletest-64cdcb69b28fc26e78d95c574187f7dd9830c84c.tar.bz2
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.
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.
};