![]() |
Lumiera 0.pre.04
»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.
Static Public Attributes | |
| static const string | ALLGROUP = "ALL" |
| "magic" groupID containing all registered testcases | |
| static const int | TEST_OK = 0 |
| static const int | EXCEPTION_THROWN = 5 |
| exit code returned when any individual test threw | |
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. | |
Public Member Functions | |
| Suite (string groupID, opt_uint64 seed) | |
| 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. | |
| void | describe () |
| print to stdout an enumeration of all testcases in this suite, in a format suitable for use with Cehteh's . | |
| int | getExitCode () const |
Private Attributes | |
| string | groupID_ |
| int | exitCode_ |
| Suite | ( | string | groupID, |
| opt_uint64 | optSeed | ||
| ) |
create a suite comprised of all the testcases previously registered with this this group.
Definition at line 158 of file suite.cpp.
References SuiteSeedNucleus::fixedSeed, and Registry::getGroup().
Here is the call graph for this function:| 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 |
Definition at line 251 of file suite.cpp.
References Suite::exitCode_, Registry::getGroup(), Suite::groupID_, and IS_VALID.
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| void describe | ( | ) |
print to stdout an enumeration of all testcases in this suite, in a format suitable for use with Cehteh's .
/test.sh
Definition at line 299 of file suite.cpp.
References Registry::getGroup(), Suite::groupID_, IS_VALID, and lumiera_error().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int getExitCode | ( | ) | const |
Definition at line 176 of file suite.cpp.
References Suite::exitCode_.
Referenced by main().
Here is the caller graph for this function:
|
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 |
Definition at line 131 of file suite.cpp.
References Registry::add2group(), and Suite::ALLGROUP.
Referenced by Launch< TEST >::Launch().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 61 of file suite.hpp.
Referenced by Suite::describe(), and Suite::run().
|
private |
Definition at line 62 of file suite.hpp.
Referenced by Suite::getExitCode(), and Suite::run().
|
static |
"magic" groupID containing all registered testcases
Definition at line 71 of file suite.hpp.
Referenced by TestOption::TestOption(), and Suite::enrol().
|
static |
Definition at line 72 of file suite.hpp.
Referenced by test::anonymous_namespace{suite.cpp}::invokeTestCase().
|
static |
exit code returned when any individual test threw
Definition at line 73 of file suite.hpp.
Referenced by test::anonymous_namespace{suite.cpp}::invokeTestCase().
Collaboration diagram for Suite: