summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-02-11 12:14:00 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-02-11 12:14:00 (GMT)
commit0efa7c32aaf21a29b42b5926cc116007056843be (patch)
tree882f663a5dd0e65694bf6077b71086dd77fd7ff8 /3rdParty/CppUnit/src/TextOutputter.cpp
parent1d20eabbc32274b491b4c2bedf73d19933d97bfd (diff)
downloadswift-contrib-0efa7c32aaf21a29b42b5926cc116007056843be.zip
swift-contrib-0efa7c32aaf21a29b42b5926cc116007056843be.tar.bz2
Moved some modules into separate git modules.
Diffstat (limited to '3rdParty/CppUnit/src/TextOutputter.cpp')
m---------3rdParty/CppUnit0
-rw-r--r--3rdParty/CppUnit/src/TextOutputter.cpp140
2 files changed, 0 insertions, 140 deletions
diff --git a/3rdParty/CppUnit b/3rdParty/CppUnit
new file mode 160000
+Subproject b4c34eb947c6497c6387c55c7581ec875f4e7d4
diff --git a/3rdParty/CppUnit/src/TextOutputter.cpp b/3rdParty/CppUnit/src/TextOutputter.cpp
deleted file mode 100644
index f74214f..0000000
--- a/3rdParty/CppUnit/src/TextOutputter.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-#include <cppunit/Exception.h>
-#include <cppunit/SourceLine.h>
-#include <cppunit/TestFailure.h>
-#include <cppunit/TextOutputter.h>
-#include <cppunit/TestResultCollector.h>
-
-
-CPPUNIT_NS_BEGIN
-
-
-TextOutputter::TextOutputter( TestResultCollector *result,
- OStream &stream )
- : m_result( result )
- , m_stream( stream )
-{
-}
-
-
-TextOutputter::~TextOutputter()
-{
-}
-
-
-void
-TextOutputter::write()
-{
- printHeader();
- m_stream << "\n";
- printFailures();
- m_stream << "\n";
-}
-
-
-void
-TextOutputter::printFailures()
-{
- TestResultCollector::TestFailures::const_iterator itFailure = m_result->failures().begin();
- int failureNumber = 1;
- while ( itFailure != m_result->failures().end() )
- {
- m_stream << "\n";
- printFailure( *itFailure++, failureNumber++ );
- }
-}
-
-
-void
-TextOutputter::printFailure( TestFailure *failure,
- int failureNumber )
-{
- printFailureListMark( failureNumber );
- m_stream << ' ';
- printFailureTestName( failure );
- m_stream << ' ';
- printFailureType( failure );
- m_stream << ' ';
- printFailureLocation( failure->sourceLine() );
- m_stream << "\n";
- printFailureDetail( failure->thrownException() );
- m_stream << "\n";
-}
-
-
-void
-TextOutputter::printFailureListMark( int failureNumber )
-{
- m_stream << failureNumber << ")";
-}
-
-
-void
-TextOutputter::printFailureTestName( TestFailure *failure )
-{
- m_stream << "test: " << failure->failedTestName();
-}
-
-
-void
-TextOutputter::printFailureType( TestFailure *failure )
-{
- m_stream << "("
- << (failure->isError() ? "E" : "F")
- << ")";
-}
-
-
-void
-TextOutputter::printFailureLocation( SourceLine sourceLine )
-{
- if ( !sourceLine.isValid() )
- return;
-
- m_stream << "line: " << sourceLine.lineNumber()
- << ' ' << sourceLine.fileName();
-}
-
-
-void
-TextOutputter::printFailureDetail( Exception *thrownException )
-{
- m_stream << thrownException->message().shortDescription() << "\n";
- m_stream << thrownException->message().details();
-}
-
-
-void
-TextOutputter::printHeader()
-{
- if ( m_result->wasSuccessful() )
- m_stream << "\nOK (" << m_result->runTests () << " tests)\n" ;
- else
- {
- m_stream << "\n";
- printFailureWarning();
- printStatistics();
- }
-}
-
-
-void
-TextOutputter::printFailureWarning()
-{
- m_stream << "!!!FAILURES!!!\n";
-}
-
-
-void
-TextOutputter::printStatistics()
-{
- m_stream << "Test Results:\n";
-
- m_stream << "Run: " << m_result->runTests()
- << " Failures: " << m_result->testFailures()
- << " Errors: " << m_result->testErrors()
- << "\n";
-}
-
-
-CPPUNIT_NS_END
-