Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/test/suite.hpp"
Enables running a collection of tests.
An internal registration service enrol() is provided for the individual Test - instances to be recognised as testcases. The groupID passed to the constructor selects all testcases declared as belonging to this Group.
Public Member Functions | |
Suite (string groupID, opt_uint64 seed) | |
create a suite comprised of all the testcases previously registered with this this group. More... | |
void | describe () |
print to stdout an enumeration of all testcases in this suite, in a format suitable for use with Cehteh's . More... | |
int | getExitCode () const |
bool | run (Arg cmdline) |
run all testcases contained in this Suite. More... | |
Static Public Member Functions | |
static void | enrol (Launcher *test, string testID, string groups) |
register the given test-launcher, so it can be later accessed either as a member of one of the specified groups, or directly by its testID. More... | |
Static Public Attributes | |
static const string | ALLGROUP = "ALL" |
"magic" groupID containing all registered testcases | |
static const int | EXCEPTION_THROWN = 5 |
exit code returned when any individual test threw | |
static const int | TEST_OK = 0 |
Private Attributes | |
int | exitCode_ |
string | groupID_ |
Suite | ( | string | groupID, |
opt_uint64 | optSeed | ||
) |
create a suite comprised of all the testcases previously registered with this this group.
bool run | ( | Arg | cmdline | ) |
run all testcases contained in this Suite.
The first argument in the commandline, if present, will select one single testcase with a matching ID. In case of invoking a single testcase, the given cmdline will be forwarded to the testcase, after removing the testcaseID from cmdline[0]. Otherwise, every testcase in this suite is invoked with a empty cmdline vector.
cmdline | ref to the vector of commandline tokens |
void describe | ( | ) |
print to stdout an enumeration of all testcases in this suite, in a format suitable for use with Cehteh's .
/test.sh
|
static |
register the given test-launcher, so it can be later accessed either as a member of one of the specified groups, or directly by its testID.
Any test is automatically added to the groupID ALLGROUP
test | the Launcher object used to run this test |
testID | unique ID to refer to this test (will be used as std::map key) |
groups | List of group-IDs selected by whitespace |