void TextOutputter::printFailureLocation( SourceLine sourceLine ) { if ( !sourceLine.isValid() ) return; m_stream << "line: " << sourceLine.lineNumber() << ' ' << sourceLine.fileName(); }
void XmlOutputter::addFailureLocation( TestFailure *failure, XmlElement *testElement ) { XmlElement *locationNode = new XmlElement( "Location" ); testElement->addElement( locationNode ); SourceLine sourceLine = failure->sourceLine(); locationNode->addElement( new XmlElement( "File", sourceLine.fileName() ) ); locationNode->addElement( new XmlElement( "Line", sourceLine.lineNumber() ) ); }
void StdioOutputter::printFailureLocation( SourceLine sourceLine ) { if ( !sourceLine.isValid() ) return; std::printf("line: %d %s", sourceLine.lineNumber(), sourceLine.fileName().c_str()); }
bool CompilerOutputter::processLocationFormatCommand( char command, const SourceLine &sourceLine ) { switch ( command ) { case 'p': m_stream << sourceLine.fileName(); return true; case 'l': m_stream << sourceLine.lineNumber(); return true; case 'f': m_stream << extractBaseName( sourceLine.fileName() ); return true; } return false; }