diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-06-25 09:41:28 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-06-25 09:41:28 +0000 |
| commit | 212df8f138166ed053d63d6d54e1a1290e395ae5 (patch) | |
| tree | cadc9e6eaca1d184b7a69a8b389214d966c4ffb6 /src/cppunit/TextTestRunner.cpp | |
| parent | d9353259d7f48a5497e72a257f2a549ba719bc0c (diff) | |
| download | cppunit-212df8f138166ed053d63d6d54e1a1290e395ae5.tar.gz | |
Include/cppunit/Portability.
include/cppunit/Portability.h: moved OStringStream alias definition to
Portability/Stream.h. User need to define EVC4 to indicate that
config-evc4.h should be used. (how to we detect this automatically ?).
Notes that this means it might be needed to add #include <string> to some
headers since its no longer included by Portability.h.
* include/cppunit/Portability/Stream.h: define alias OStringStream, stdCOut(),
and OFileStream. If CPPUNIT_NO_STREAM is defined (evc4 config), then provides
our own implementation (based on sprintf and fwrite).
* include/cppunit/config/config-evc4.h: config file for embedded visual c++ 4.
Still need to detect for this platform in Portability.h (currently relying on
EVC4 being defined...)
* *.[cpp/h]: most source files have been impacted with the following change:
#include <iostream> -> #include <cppunit/Portability/Stream.h>
std::ostream -> CPPUNIT_NS::OStream
std::ofstream -> CPPUNIT_NS::OFileStream
std::cout -> CPPUNIT_NS::stdCOut()
std::endl -> "\n"
Also, code using std::cin as been defined out if CPPUNIT_NO_STREAM was defined.
The exact list of impact files can be obtain in CVS using tags:
TG_CPPUNIT_NO_STREAM_BEFORE & TG_CPPUNIT_NO_STREAM_AFTER.
Diffstat (limited to 'src/cppunit/TextTestRunner.cpp')
| -rw-r--r-- | src/cppunit/TextTestRunner.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cppunit/TextTestRunner.cpp b/src/cppunit/TextTestRunner.cpp index 5ca182b..e8087bf 100644 --- a/src/cppunit/TextTestRunner.cpp +++ b/src/cppunit/TextTestRunner.cpp @@ -6,7 +6,7 @@ #include <cppunit/TextTestProgressListener.h> #include <cppunit/TestResult.h> #include <cppunit/ui/text/TextTestRunner.h> -#include <iostream> +#include <cppunit/Portability/Stream.h> #include <stdexcept> @@ -22,7 +22,7 @@ TextTestRunner::TextTestRunner( Outputter *outputter ) , m_eventManager( new TestResult() ) { if ( !m_outputter ) - m_outputter = new TextOutputter( m_result, std::cout ); + m_outputter = new TextOutputter( m_result, stdCOut() ); m_eventManager->addListener( m_result ); } @@ -75,18 +75,21 @@ TextTestRunner::run( std::string testName, void TextTestRunner::wait( bool doWait ) { +#if !defined( CPPUNIT_NO_STREAM ) if ( doWait ) { - std::cout << "<RETURN> to continue" << std::endl; + stdCOut() << "<RETURN> to continue\n"; + stdCOut().flush(); std::cin.get (); } +#endif } void TextTestRunner::printResult( bool doPrintResult ) { - std::cout << std::endl; + stdCOut() << "\n"; if ( doPrintResult ) m_outputter->write(); } |
