diff options
| author | Eric Sommerlade <eric@sommerla.de> | 2000-10-11 17:56:09 +0000 |
|---|---|---|
| committer | Eric Sommerlade <eric@sommerla.de> | 2000-10-11 17:56:09 +0000 |
| commit | 773f887465f1338b8959d658518ddf67b783ca90 (patch) | |
| tree | 5c2721834c3b1a02b17840c5d09c34d8243947a3 /examples/hierarchy/main.cpp | |
| parent | 067d58bdf82882a81c24a0ad59fd170b1485694d (diff) | |
| download | cppunit-773f887465f1338b8959d658518ddf67b783ca90.tar.gz | |
Added main function and Makefile
Diffstat (limited to 'examples/hierarchy/main.cpp')
| -rw-r--r-- | examples/hierarchy/main.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/hierarchy/main.cpp b/examples/hierarchy/main.cpp new file mode 100644 index 0000000..9c66aa5 --- /dev/null +++ b/examples/hierarchy/main.cpp @@ -0,0 +1,43 @@ +#include "cppunit/TestRegistry.h" +#include "cppunit/TextTestResult.h" +#include "cppunit/Test.h" + +#include "BoardGame.h" +#include "Chess.h" + +#include "BoardGameTest.h" +#include "ChessTest.h" + + +#include <vector> +#include <iostream> + + +BoardGameTest<BoardGame> bgt(); +ChessTest<Chess> ct(); + + +using namespace CppUnit; + + + + +int +main(int argc, char** argv) +{ + TextTestResult res; + + vector<Test*> tests=TestRegistry::getRegistry().getAllTests(); + + for(vector<Test*>::iterator it=tests.begin(); + it!=tests.end(); ++it) { + + cout << "Running " << (*it)->toString() << endl; + + (*it)->run(&res); + + } + cout << res << endl; + + return 0; +} |
