tut logo

tut Namespace Reference


Classes | Typedefs | Functions | Variables
tut Namespace Reference

Additional ensures for scientific/engineering applications. More...

Classes

struct  bad_ctor
 
struct  callback
 
class  console_reporter
 
class  cppunit_reporter
 
struct  failure
 
struct  group_base
 
struct  no_such_group
 
struct  no_such_test
 
class  restartable_wrapper
 
struct  rethrown
 
struct  seh
 
struct  skipped
 
class  test_group
 
struct  test_group_posix
 
class  test_object
 
struct  test_object_posix
 
struct  test_result
 
struct  test_result_posix
 
class  test_runner
 
class  test_runner_singleton
 
struct  tests_registerer
 
struct  tests_registerer< Test, Group, 0 >
 
struct  tut_error
 
struct  warning
 
class  xml_reporter
 JUnit XML TUT reporter. More...
 

Typedefs

typedef std::set< callback * > callbacks
 
typedef std::vector< std::string > groupnames
 
typedef console_reporter reporter
 

Functions

template<typename T , typename U >
void ensure_close (const char *msg, const T &actual, const T &expected, const U &tolerance)
 
template<typename T , typename Tolerance >
void ensure_close (const T &actual, const T &expected, const Tolerance &tolerance)
 
template<typename T , typename U >
void ensure_close_fraction (const char *msg, const T &actual, const T &expected, const U &fraction)
 
template<typename T >
void ensure_close_fraction (const char *msg, const T &actual, const T &expected, const int &tolerance)
 
template<typename T , typename Tolerance >
void ensure_close_fraction (const T &actual, const T &expected, const Tolerance &fraction)
 
bool tut_main (int argc, const char *const *const argv, std::ostream &os=std::cerr)
 
template<typename T >
std::string type_name (const T &t)
 

Variables

test_runner_singleton runner
 

Detailed Description

Additional ensures for scientific/engineering applications.

Template Unit Tests Framework for C++. http://tut.dozen.ru

Author
Vladimir Dyuzhev, Vladi.nosp@m.mir..nosp@m.Dyuzh.nosp@m.ev@g.nosp@m.mail..nosp@m.com
Joerg yogi2.nosp@m.005@.nosp@m.users.nosp@m..sou.nosp@m.rcefo.nosp@m.rge..nosp@m.net
Date
07/04/2008

Optional restartable wrapper for test_runner.

Allows to restart test runs finished due to abnormal test application termination (such as segmentation fault or math error).

Author
Vladimir Dyuzhev, Vladi.nosp@m.mir..nosp@m.Dyuzh.nosp@m.ev@g.nosp@m.mail..nosp@m.com

Typedef Documentation

typedef std::vector<std::string> tut::groupnames

Typedef for runner::list_groups()

Function Documentation

bool tut::tut_main ( int  argc,
const char *const *const  argv,
std::ostream &  os = std::cerr 
)
inline

Helper function to make test binaries simpler.

Example of basic usage follows.

* namespace tut { test_runner_singleton runner; }
*
* int main(int argc, char **argv)
* {
* if( tut_main(argc, argv) )
* return 0;
* else
* return -1;
* }
*

It is also possible to do some generic initialization before running any tests and cleanup before exiting application. Note that tut_main can throw tut::no_such_group or tut::no_such_test.

* namespace tut { test_runner_singleton runner; }
*
* int main(int argc, char **argv)
* {
* tut::xml_reporter reporter;
* tut::runner.get().insert_callback(&reporter);
*
* MyInit();
* try
* {
* tut_main(argc, argv);
* }
* catch(const tut::tut_error &ex)
* {
* std::cerr << "TUT error: " << ex.what() << std::endl;
* }
* MyCleanup();
* }
*
Examples:
basic/main.cpp.

References tut::test_runner::list_groups(), tut::test_runner::run_test(), and tut::test_runner::run_tests().

Here is the call graph for this function:


All Rights Reserved. Generated on Wed Dec 18 2013 11:19:52 for TUT by doxygen 1.8.5