Mercurial > fife-parpg
annotate ext/UnitTest++/src/XmlTestReporter.cpp @ 89:fa33cda75471
* Reverting back to 2543 as requested by sleek
author | mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 19 Jul 2008 11:38:52 +0000 |
parents | 0d325e9d5953 |
children |
rev | line source |
---|---|
37
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
1 #include "XmlTestReporter.h" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
2 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
3 #include <iostream> |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
4 #include <sstream> |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
5 #include <string> |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
6 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
7 using std::string; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
8 using std::ostringstream; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
9 using std::ostream; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
10 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
11 namespace { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
12 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
13 void ReplaceChar(string& str, char const c, string const& replacement) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
14 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
15 for (size_t pos = str.find(c); pos != string::npos; pos = str.find(c, pos + 1)) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
16 str.replace(pos, 1, replacement); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
17 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
18 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
19 string XmlEscape(string const& value) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
20 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
21 string escaped = value; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
22 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
23 ReplaceChar(escaped, '&', "&"); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
24 ReplaceChar(escaped, '<', "<"); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
25 ReplaceChar(escaped, '>', ">"); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
26 ReplaceChar(escaped, '\'', "'"); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
27 ReplaceChar(escaped, '\"', """); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
28 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
29 return escaped; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
30 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
31 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
32 string BuildFailureMessage(string const& file, int const line, string const& message) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
33 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
34 ostringstream failureMessage; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
35 failureMessage << file << "(" << line << ") : " << message; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
36 return failureMessage.str(); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
37 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
38 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
39 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
40 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
41 namespace UnitTest { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
42 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
43 XmlTestReporter::XmlTestReporter(ostream& ostream) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
44 : m_ostream(ostream) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
45 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
46 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
47 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
48 void XmlTestReporter::ReportSummary(int const totalTestCount, int const failedTestCount, |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
49 int const failureCount, float const secondsElapsed) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
50 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
51 AddXmlElement(m_ostream, NULL); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
52 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
53 BeginResults(m_ostream, totalTestCount, failedTestCount, failureCount, secondsElapsed); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
54 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
55 DeferredTestResultList const& results = GetResults(); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
56 for (DeferredTestResultList::const_iterator i = results.begin(); i != results.end(); ++i) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
57 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
58 BeginTest(m_ostream, *i); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
59 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
60 if (i->failed) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
61 AddFailure(m_ostream, *i); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
62 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
63 EndTest(m_ostream, *i); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
64 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
65 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
66 EndResults(m_ostream); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
67 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
68 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
69 void XmlTestReporter::AddXmlElement(ostream& os, char const* encoding) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
70 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
71 os << "<?xml version=\"1.0\""; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
72 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
73 if (encoding != NULL) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
74 os << " encoding=\"" << encoding << "\""; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
75 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
76 os << "?>"; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
77 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
78 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
79 void XmlTestReporter::BeginResults(std::ostream& os, int const totalTestCount, int const failedTestCount, |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
80 int const failureCount, float const secondsElapsed) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
81 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
82 os << "<unittest-results" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
83 << " tests=\"" << totalTestCount << "\"" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
84 << " failedtests=\"" << failedTestCount << "\"" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
85 << " failures=\"" << failureCount << "\"" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
86 << " time=\"" << secondsElapsed << "\"" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
87 << ">"; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
88 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
89 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
90 void XmlTestReporter::EndResults(std::ostream& os) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
91 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
92 os << "</unittest-results>"; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
93 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
94 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
95 void XmlTestReporter::BeginTest(std::ostream& os, DeferredTestResult const& result) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
96 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
97 os << "<test" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
98 << " suite=\"" << result.suiteName << "\"" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
99 << " name=\"" << result.testName << "\"" |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
100 << " time=\"" << result.timeElapsed << "\""; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
101 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
102 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
103 void XmlTestReporter::EndTest(std::ostream& os, DeferredTestResult const& result) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
104 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
105 if (result.failed) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
106 os << "</test>"; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
107 else |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
108 os << "/>"; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
109 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
110 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
111 void XmlTestReporter::AddFailure(std::ostream& os, DeferredTestResult const& result) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
112 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
113 os << ">"; // close <test> element |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
114 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
115 for (DeferredTestResult::FailureVec::const_iterator it = result.failures.begin(); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
116 it != result.failures.end(); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
117 ++it) |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
118 { |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
119 string const escapedMessage = XmlEscape(it->second); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
120 string const message = BuildFailureMessage(result.failureFile, it->first, escapedMessage); |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
121 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
122 os << "<failure" << " message=\"" << message << "\"" << "/>"; |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
123 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
124 } |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
125 |
0d325e9d5953
added unittest++ files into ext. Not hooked into build scripts yet
jasoka@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff
changeset
|
126 } |