const std::string& value);
std::string UIntToString(const unsigned int value);
void GroupFinish(const std::size_t groupPosition);
- void PrintfErrorMessage(const char* type,
- const std::string& message,
- bool verbosity);
- void PrintfIgnoredMessage(const char* type,
- const std::string& message,
- bool verbosity);
+ void PrintfErrorMessage(const char* type, const std::string& message);
+ void PrintfIgnoredMessage(const char* type, const std::string& message);
void FlushOutput();
std::string EscapeSpecialCharacters(std::string s);
Statistic m_stats;
std::string m_outputBuffer;
std::string m_resultBuffer;
+ bool m_verbosity;
};
} // namespace Test
}
XmlCollector::XmlCollector()
- : m_filename(DEFAULT_XML_FILE_NAME)
+ : m_filename(DEFAULT_XML_FILE_NAME), m_verbosity(true)
{
}
std::string XmlCollector::CollectorSpecificHelp() const
{
- return CollectorFileHelp(DEFAULT_XML_FILE_NAME);
+ return CollectorFileHelp(DEFAULT_XML_FILE_NAME) + COLLECTOR_NO_VERBOSE_HELP;
}
void XmlCollector::Start()
bool XmlCollector::ParseCollectorSpecificArg(const std::string& arg)
{
- return ParseCollectorFileArg(arg, m_filename);
+ return ParseCollectorFileArg(arg, m_filename) || ParseCollectorNoVerboseArg(arg, m_verbosity);
}
void XmlCollector::CollectResult(const std::string& id,
break;
case FailStatus::FAILED:
m_resultBuffer.append(" status=\"FAILED\">\n");
- PrintfErrorMessage("FAILED", EscapeSpecialCharacters(reason), true);
+ PrintfErrorMessage("FAILED", EscapeSpecialCharacters(reason));
m_resultBuffer.append("\t\t</testcase>\n");
break;
case FailStatus::IGNORED:
m_resultBuffer.append(" status=\"Ignored\">\n");
- PrintfIgnoredMessage("Ignored", EscapeSpecialCharacters(
- reason), true);
+ PrintfIgnoredMessage("Ignored", EscapeSpecialCharacters(reason));
m_resultBuffer.append("\t\t</testcase>\n");
break;
default:
}
}
-void XmlCollector::PrintfErrorMessage(const char* type,
- const std::string& message,
- bool verbosity)
+void XmlCollector::PrintfErrorMessage(const char* type, const std::string& message)
{
- if (verbosity) {
- m_resultBuffer.append("\t\t\t<failure type=\"");
- m_resultBuffer.append(EscapeSpecialCharacters(type));
+ m_resultBuffer.append("\t\t\t<failure type=\"");
+ m_resultBuffer.append(EscapeSpecialCharacters(type));
+ if (m_verbosity) {
m_resultBuffer.append("\" message=\"");
m_resultBuffer.append(EscapeSpecialCharacters(message));
- m_resultBuffer.append("\"/>\n");
- } else {
- m_resultBuffer.append("\t\t\t<failure type=\"");
- m_resultBuffer.append(EscapeSpecialCharacters(type));
- m_resultBuffer.append("\"/>\n");
}
+ m_resultBuffer.append("\"/>\n");
}
-void XmlCollector::PrintfIgnoredMessage(const char* type,
- const std::string& message,
- bool verbosity)
+void XmlCollector::PrintfIgnoredMessage(const char* type, const std::string& message)
{
- if (verbosity) {
- m_resultBuffer.append("\t\t\t<skipped type=\"");
- m_resultBuffer.append(EscapeSpecialCharacters(type));
+ m_resultBuffer.append("\t\t\t<skipped type=\"");
+ m_resultBuffer.append(EscapeSpecialCharacters(type));
+ if (m_verbosity) {
m_resultBuffer.append("\" message=\"");
m_resultBuffer.append(EscapeSpecialCharacters(message));
- m_resultBuffer.append("\"/>\n");
- } else {
- m_resultBuffer.append("\t\t\t<skipped type=\"");
- m_resultBuffer.append(EscapeSpecialCharacters(type));
- m_resultBuffer.append("\"/>\n");
}
+ m_resultBuffer.append("\"/>\n");
}
std::string XmlCollector::EscapeSpecialCharacters(std::string s)