C++ Extensions (cppx) Documentation Internal Version
Main | Namespaces | Classes | NamespaceMembers | ClassMembers | Files

utst Namespace Reference

A simple unit test framework which provides both classes and macros to ease unit testing. A user can add test cases to a test suite and then run all of the test cases or just a specific one. Usually one feeds the arguments from the command line into the runFromCmdLine() member function to allow a user to specify regression test options at run time. An example of using the unit test framework is below:

 #include <iostream>
 #include "utst.h"

 UTST_TEST_CASE( SimpleTestCase )
 {
   UTST_CHECK_EQUAL( 1+1, 2 );
 }

 int main( int argc, char* argv[] )
 {
   utst::TestSuite suite("A Test Suite");
   suite.addTestCase( SimpleTestCase );
   suite.runFromCmdLine( argc, argv );
 }

The available test macros are listed below. These macros can only be used with the UTST_TEST_CASE macro or in theTest() member function of classes which are derrived from TestCase.

There are several command line parameters which allow a user to customize which tests are run and how much output is displayed.

Acceptable command line log level values are listed below:

Compounds

Generated on Mon Aug 15 21:43:10 2005 by Doxygen 1.2.13-20020210 written by Dimitri van Heesch © 1997-2002