C++ Utilities
4.9.1
Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
|
The TestApplication class simplifies writing test applications that require opening test files. More...
#include <testutils.h>
Public Member Functions | |
TestApplication (int argc, char **argv) | |
Constructs a TestApplication instance. More... | |
~TestApplication () | |
Destroys the TestApplication. More... | |
operator bool () const | |
Returns whether the TestApplication instance is valid. More... | |
std::string | testFilePath (const std::string &name) const |
Returns the full path of the test file with the specified name. More... | |
bool | unitsSpecified () const |
Returns whether particular units have been specified. More... | |
const std::vector< const char * > & | units () const |
Returns the specified test units. More... | |
Static Public Member Functions | |
static const TestApplication * | instance () |
Returns the current TestApplication instance. More... | |
The TestApplication class simplifies writing test applications that require opening test files.
Definition at line 20 of file testutils.h.
TestUtilities::TestApplication::TestApplication | ( | int | argc, |
char ** | argv | ||
) |
Constructs a TestApplication instance.
Throws | std::runtime_error if an instance has already been created. |
Definition at line 44 of file testutils.cpp.
TestUtilities::TestApplication::~TestApplication | ( | ) |
Destroys the TestApplication.
Definition at line 140 of file testutils.cpp.
|
inlinestatic |
Returns the current TestApplication instance.
Definition at line 64 of file testutils.h.
|
inline |
Returns whether the TestApplication instance is valid.
An instance is considered invalid if an error occured when parsing the command line arguments.
Definition at line 56 of file testutils.h.
string TestUtilities::TestApplication::testFilePath | ( | const std::string & | name | ) | const |
Returns the full path of the test file with the specified name.
Definition at line 148 of file testutils.cpp.
|
inline |
Returns the specified test units.
Definition at line 81 of file testutils.h.
|
inline |
Returns whether particular units have been specified.
Definition at line 72 of file testutils.h.