Exemple #1
0
 virtual void addFailure(const CppUnit::TestFailure& failure)
 {
   cout << endl << "Failure: " << failure.failedTest()->getName() << endl
     << "  " << failure.sourceLine().fileName() << "(" << failure.sourceLine().lineNumber() << ") ";
   CppUnit::Exception* e = failure.thrownException();
   if (e != NULL && QString::fromStdString(e->message().details()).trimmed() != "")
   {
     cout << "  " << e->message().details();
   }
   cout.flush();
   _success = false;
 }
Exemple #2
0
	void addFailure(const CppUnit::TestFailure& failure)
	{
		CppUnit::XmlElement* failElt = new CppUnit::XmlElement("Failure");
		m_testElt->addElement(failElt);

		failElt->addElement(new CppUnit::XmlElement("FailureType",
			failure.isError() ? "Error" : "Assertion"));

		if (failure.sourceLine().isValid())
		{
			CppUnit::XmlElement* locElt = new CppUnit::XmlElement("Location");
			failElt->addElement(locElt);

			locElt->addElement(new CppUnit::XmlElement("File", failure.sourceLine().fileName()));
			locElt->addElement(new CppUnit::XmlElement("Line", failure.sourceLine().lineNumber()));
		}

		CppUnit::XmlElement* exElt = new CppUnit::XmlElement("Exception");
		failElt->addElement(exElt);

		exElt->addElement(new CppUnit::XmlElement("Message", failure.thrownException()->what()));
	}