Browse Subversion Repository
Contents of /unittest/allTest.cpp
Parent Directory
| Revision Log
Revision 191 -
( show annotations)
( download)
( as text)
Fri Jan 4 02:49:36 2008 UTC
(16 years, 4 months ago)
by satofumi
File MIME type: text/x-c++src
File size: 911 byte(s)
using namespace beego
| 1 |
#include <string> |
| 2 |
#include <cppunit/TestResult.h> |
| 3 |
#include <cppunit/TestResultCollector.h> |
| 4 |
#include <cppunit/TextTestProgressListener.h> |
| 5 |
#include <cppunit/BriefTestProgressListener.h> |
| 6 |
#include <cppunit/ui/text/TestRunner.h> |
| 7 |
#include <cppunit/CompilerOutputter.h> |
| 8 |
#include <cppunit/extensions/HelperMacros.h> |
| 9 |
#include <stdexcept> |
| 10 |
#include <iostream> |
| 11 |
|
| 12 |
using namespace std; |
| 13 |
|
| 14 |
int main(void) { |
| 15 |
CPPUNIT_NS::TestResult controller; |
| 16 |
|
| 17 |
CPPUNIT_NS::TestResultCollector result; |
| 18 |
controller.addListener(&result); |
| 19 |
|
| 20 |
//CPPUNIT_NS::TextTestProgressListener progress; |
| 21 |
CPPUNIT_NS::BriefTestProgressListener progress; |
| 22 |
controller.addListener(&progress); |
| 23 |
|
| 24 |
CPPUNIT_NS::TestRunner runner; |
| 25 |
runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest()); |
| 26 |
|
| 27 |
runner.run(controller, ""); |
| 28 |
|
| 29 |
CPPUNIT_NS::CompilerOutputter outputter(&result, std::cerr); |
| 30 |
outputter.write(); |
| 31 |
|
| 32 |
return result.wasSuccessful() ? 0 : 1; |
| 33 |
} |
|