summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjgm@google.com <jgm@google.com@861a406c-534a-0410-8894-cb66d6ee9925>2012-01-17 15:11:32 +0000
committerjgm@google.com <jgm@google.com@861a406c-534a-0410-8894-cb66d6ee9925>2012-01-17 15:11:32 +0000
commit4dcb99d7acb0a551b7122f68a4d15d993f748c9d (patch)
tree1d5652c238bd324c2c3181c451f74b1fed8405da /src
parent580d3fc0ae4e4332a89f05039fef9f04ccf60d44 (diff)
downloadgtest-4dcb99d7acb0a551b7122f68a4d15d993f748c9d.tar.gz
gtest-4dcb99d7acb0a551b7122f68a4d15d993f748c9d.tar.bz2
gtest-4dcb99d7acb0a551b7122f68a4d15d993f748c9d.tar.xz
Adds file and line information to the "message", which is used as the summary
of a failure. git-svn-id: http://googletest.googlecode.com/svn/trunk@609 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'src')
-rw-r--r--src/gtest-internal-inl.h2
-rw-r--r--src/gtest.cc15
2 files changed, 9 insertions, 8 deletions
diff --git a/src/gtest-internal-inl.h b/src/gtest-internal-inl.h
index 4e9805d..350ade0 100644
--- a/src/gtest-internal-inl.h
+++ b/src/gtest-internal-inl.h
@@ -620,7 +620,7 @@ class GTEST_API_ UnitTestImpl {
// For example, if Foo() calls Bar(), which in turn calls
// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
- String CurrentOsStackTraceExceptTop(int skip_count);
+ String CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
// Finds and returns a TestCase with the given name. If one doesn't
// exist, creates one and returns it.
diff --git a/src/gtest.cc b/src/gtest.cc
index f2e84af..56af646 100644
--- a/src/gtest.cc
+++ b/src/gtest.cc
@@ -3271,16 +3271,17 @@ void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
for (int i = 0; i < result.total_part_count(); ++i) {
const TestPartResult& part = result.GetTestPartResult(i);
if (part.failed()) {
- if (++failures == 1)
+ if (++failures == 1) {
*stream << ">\n";
- *stream << " <failure message=\""
- << EscapeXmlAttribute(part.summary()).c_str()
- << "\" type=\"\">";
+ }
const string location = internal::FormatCompilerIndependentFileLocation(
part.file_name(), part.line_number());
- const string message = location + "\n" + part.message();
- OutputXmlCDataSection(stream,
- RemoveInvalidXmlCharacters(message).c_str());
+ const string summary = location + "\n" + part.summary();
+ *stream << " <failure message=\""
+ << EscapeXmlAttribute(summary.c_str())
+ << "\" type=\"\">";
+ const string detail = location + "\n" + part.message();
+ OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
*stream << "</failure>\n";
}
}