|
Revision 1697, 1.8 kB
(checked in by robert, 10 years ago)
|
|
Ported osgGLUT based src/Demos across to being osgProducer based, and placed
them in the new examples/ directory.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #include <osg/UnitTestFramework> |
|---|
| 2 | #include <osg/ArgumentParser> |
|---|
| 3 | #include <osg/ApplicationUsage> |
|---|
| 4 | |
|---|
| 5 | int main( int argc, char** argv ) |
|---|
| 6 | { |
|---|
| 7 | osg::ArgumentParser arguments(&argc,argv); |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | arguments.getApplicationUsage()->setCommandLineUsage(arguments.getProgramName()+" [options]"); |
|---|
| 11 | arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); |
|---|
| 12 | arguments.getApplicationUsage()->addCommandLineOption("qt","Display qualified tests."); |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | bool printQualifiedTest = false; |
|---|
| 16 | while (arguments.read("qt")) printQualifiedTest = true; |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | if (arguments.read("-h") || arguments.read("--help")) |
|---|
| 20 | { |
|---|
| 21 | std::cout<<arguments.getApplicationUsage()->getCommandLineUsage()<<std::endl; |
|---|
| 22 | arguments.getApplicationUsage()->write(std::cout,arguments.getApplicationUsage()->getCommandLineOptions()); |
|---|
| 23 | return 1; |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | arguments.reportRemainingOptionsAsUnrecognized(); |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | if (arguments.errors()) |
|---|
| 31 | { |
|---|
| 32 | arguments.writeErrorMessages(std::cout); |
|---|
| 33 | return 1; |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | if (printQualifiedTest) |
|---|
| 38 | { |
|---|
| 39 | std::cout<<"***** Qualified Tests ******"<<std::endl; |
|---|
| 40 | |
|---|
| 41 | osgUtx::QualifiedTestPrinter printer; |
|---|
| 42 | osgUtx::TestGraph::instance().root()->accept( printer ); |
|---|
| 43 | std::cout<<endl; |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | std::cout<<"****** Running tests ******"<<std::endl; |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | osgUtx::TestContext ctx; |
|---|
| 50 | osgUtx::TestRunner runner( ctx ); |
|---|
| 51 | runner.specify("root"); |
|---|
| 52 | |
|---|
| 53 | osgUtx::TestGraph::instance().root()->accept( runner ); |
|---|
| 54 | |
|---|
| 55 | return 0; |
|---|
| 56 | } |
|---|