torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TestFixture Struct Reference

Convenience test fixture struct to request desired logging level from Boost.Test. More...

Public Member Functions

 TestFixture (void)
 

Detailed Description

Convenience test fixture struct to request desired logging level from Boost.Test.

Definition at line 120 of file UnitTestMain.cpp.

Constructor & Destructor Documentation

TestFixture::TestFixture ( void  )
inline

Definition at line 121 of file UnitTestMain.cpp.

121  {
122  boost::unit_test::log_level log_level =
123  boost::unit_test::log_successful_tests
124  // boost::unit_test::log_test_units
125  // boost::unit_test::log_messages
126  // boost::unit_test::log_warnings
127  // boost::unit_test::log_all_errors
128  // boost::unit_test::log_cpp_exception_errors
129  // boost::unit_test::log_system_errors
130  // boost::unit_test::log_fatal_errors
131  // boost::unit_test::log_nothing
132  ;
133  boost::unit_test::unit_test_log.set_threshold_level(log_level);
134 
135  // initialize the directory tree
136  char**& argv = boost::unit_test::framework::master_test_suite().argv;
137  int argc = boost::unit_test::framework::master_test_suite().argc;
138  torc::common::DirectoryTree directoryTree(argv[0]);
139 
140  // determine whether the user requested regression tests
141  std::string regression("-regression");
142  bool regressionRequested = false;
143  for(int i = 1; i < argc; i++) {
144  if(argv[i] == regression) {
145  regressionRequested = true;
146  break;
147  }
148  }
149 
150  // allow for special debug filtering
151  //DebugFilter debugTestFilter;
152  //boost::unit_test::traverse_test_tree(boost::unit_test::framework::master_test_suite(),
153  // debugTestFilter);
154 
155  // disable all regression tests unless the user requested them
156  if(regressionRequested == false) {
157  std::cout << "NOTE: Disabling all regression tests. Use -regression to enable them."
158  << std::endl;
159  RegressionFilter regressionTestFilter;
160  boost::unit_test::traverse_test_tree(boost::unit_test::framework::master_test_suite(),
161  regressionTestFilter);
162  }
163  }
Test suite visitor to disable regression tests.
std::string string
Encapsulation of filesystem paths that are used by the library.

The documentation for this struct was generated from the following file: