Ejemplo n.º 1
0
_EXPORT
void
BTestListener::addFailure( const CppUnit::TestFailure &failure ) {
   	fOkay = false;
   	cout << "  - ";
   	cout << (failure.isError() ? "ERROR" : "FAILURE");
   	cout << " -- ";
   	cout << (failure.thrownException() != NULL
   	           ? failure.thrownException()->what()
   	             : "(unknown error)");
   	cout << endl;
}
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
    /// Clear FAILURE and ERROR markers.
    void addFailure( const CppUnit::TestFailure &failure )
    {
#if RUNMPI == true
        CppUnit::stdCOut() << std::endl << "!!! "
                           << failure.failedTest()->getName()
                           << ( failure.isError() ? "- ERROR" : "- FAIL" )
                           << " on MPI rank " << MPICommons::myRank()
                           << std::endl;
        CppUnit::stdCOut().flush();
#else
        const int padding_length = 60 - failure.failedTest()->getName().length();
        const std::string padding(padding_length, '-');
        CppUnit::stdCOut() << "   <" << padding << ( failure.isError() ? "- ERROR" : "- FAIL" );
        CppUnit::stdCOut().flush();
#endif
    }
Ejemplo n.º 4
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()));
	}
Ejemplo n.º 5
0
    void addFailure(const CppUnit::TestFailure &failure) {
        CppUnit::BriefTestProgressListener::addFailure(failure);

        CppUnit::Exception *exception = failure.thrownException();
        std::cout << std::endl << std::endl;

        CppUnit::SourceLine sourceLine = exception->sourceLine();
        if (sourceLine.isValid()) {
            std::cout << "File: " << sourceLine.fileName() << std::endl
                      << "Line: " << sourceLine.lineNumber() << std::endl;
        }

        std::cout << "Message: " << exception->what();
    }
Ejemplo n.º 6
0
 virtual void addFailure(const CppUnit::TestFailure& failure)
 {
     m_result = failure.isError() ? RESULT_ERROR : RESULT_FAIL;
 }
Ejemplo n.º 7
0
 MOCKPP_TESTMETHOD_DECL void addFailure( const CppUnit::TestFailure &failure )
  {
    MOCKPP_STD_NS::cerr << ( failure.isError() ? "E" : "F" ) << MOCKPP_STD_NS::endl;
    MOCKPP_STD_NS::cerr.flush();
  }