#include <boost/test/unit_test.hpp>
#include <boost/test/utils/runtime/cla/named_parameter.hpp>
#include <boost/test/utils/runtime/cla/parser.hpp>
#include <iostream>
#include <boost/cstdlib.hpp>
#include <fstream>
#include "CBoostTestTreeLister.h"
#include "CBoostTestTreeDebugLister.h"
Go to the source code of this file.
|
static std::string | init_func_name ("init_unit_test") |
|
bool | load_test_lib () |
| Load the Boost UTF dll containing the tests, locate the initialization method (either the default "init_unit_test" or the one supplied via parameter –init) and in case the initialization method is found, call it. More...
|
|
std::unique_ptr< std::ofstream > | GetListOutputStream (const cla::parser &P, const std::string &arg) |
| Generates an object of type ofstream so as to write to file. More...
|
|
TBoostTestTreeListerPtr | GetTestTreeLister (const std::string &arg, const std::string dll, std::ostream *out=nullptr) |
|
std::ostream & | WriteError (std::ostream &out, const std::string &dll, const std::string &error=std::string()) |
| Method utilized to format and write any exceptions to the output stream. More...
|
|
int | ListTests (const cla::parser &P) |
| Method handling the enumeration of the tests. More...
|
|
int | main (int argc, char *argv[]) |
| Entry point of the program. More...
|
|
#define BOOST_TEST_DYN_LINK |
typedef bool(* init_func_ptr) () |
std::unique_ptr<std::ofstream> GetListOutputStream |
( |
const cla::parser & |
P, |
|
|
const std::string & |
arg |
|
) |
| |
Generates an object of type ofstream so as to write to file.
- Parameters
-
[in] | P | Reference to the object handling the command line parsing |
[in] | arg | Full filepath where to write the XML file to |
Definition at line 230 of file console_test_runner.cpp.
TBoostTestTreeListerPtr GetTestTreeLister |
( |
const std::string & |
arg, |
|
|
const std::string |
dll, |
|
|
std::ostream * |
out = nullptr |
|
) |
| |
static std::string init_func_name |
( |
"init_unit_test" |
| ) |
|
|
static |
int ListTests |
( |
const cla::parser & |
P | ) |
|
Method handling the enumeration of the tests.
- Parameters
-
[in] | P | Reference to the object handling the command line parsing |
- Returns
- Returns either boost::exit_success or boost::exit_failure
Load library before enumerating test suite to ensure correct registration. Execute initialization function since it may be the case that client code registers custom tests
Definition at line 299 of file console_test_runner.cpp.
Load the Boost UTF dll containing the tests, locate the initialization method (either the default "init_unit_test" or the one supplied via parameter –init) and in case the initialization method is found, call it.
- Returns
- returns true in case the initialization method has not been located (so that the enumeration can proceed anyway) In case the initialization method has been found, the method is called and whatever status that method return returns is returned by load_test_lib
- Note
- It has been decided to suppress that the raise of an exception in case the initialization method is not method. At any rate the user will know that his manually registered tests has not been listed because they will not appear in the XML file.
Definition at line 196 of file console_test_runner.cpp.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Entry point of the program.
- Parameters
-
[in] | argc | argument count |
[in] | argv | argument vector |
- Returns
- Indicates execution failure or success
Definition at line 471 of file console_test_runner.cpp.
std::ostream& WriteError |
( |
std::ostream & |
out, |
|
|
const std::string & |
dll, |
|
|
const std::string & |
error = std::string() |
|
) |
| |
Method utilized to format and write any exceptions to the output stream.
- Parameters
-
[in] | out | reference to the output stream where to write the exception to |
[in] | dll | library path containing the Boost UTF tests |
[in] | error | exception detail |
Definition at line 278 of file console_test_runner.cpp.
dyn_lib::handle test_lib_handle |
std::string test_lib_name |
|
static |