Lumiera  0.pre.03
»edit your freedom«
Suite Class Reference

#include "lib/test/suite.hpp"

Description

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.

Definition at line 66 of file suite.hpp.

Public Member Functions

 Suite (string groupID)
 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_
 

Constructor & Destructor Documentation

◆ Suite()

Suite ( string  groupID)

create a suite comprised of all the testcases previously registered with this this group.

See also
run() running tests in a Suite

Definition at line 145 of file suite.cpp.

Member Function Documentation

◆ run()

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.

Parameters
cmdlineref to the vector of commandline tokens

Definition at line 205 of file suite.cpp.

◆ describe()

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 250 of file suite.cpp.

◆ enrol()

void enrol ( Launcher test,
string  testID,
string  groups 
)
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

Parameters
testthe Launcher object used to run this test
testIDunique ID to refer to this test (will be used as std::map key)
groupsList of group-IDs selected by whitespace

Definition at line 117 of file suite.cpp.

+ Collaboration diagram for Suite:

The documentation for this class was generated from the following files: