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

#include "lib/test/testoption.hpp"

Description

Support for selecting and configuring testcases via commandline arguments.

A preconfigured wrapper around boost::program_options, with the ability to tolerate unknown options. The commandline to be parsed is taken wrapped into a Cmdline instance; after parsing this commandline vector will contain only the remaining unrecognised parts.

Definition at line 59 of file testoption.hpp.

Public Member Functions

 TestOption (lib::Cmdline &cmdline)
 set up an options parser to use the current commandline. More...
 
const string getTestgroup ()
 
const string getTestID ()
 
bool handleHelpRequest ()
 handles the –help switch by printing a syntax description More...
 
bool shouldDescribe ()
 

Friends

ostream & operator<< (ostream &, const TestOption &)
 for outputting the help messages. More...
 

Private Attributes

boost::program_options::variables_map parameters
 
boost::program_options::options_description syntax
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ TestOption()

TestOption ( lib::Cmdline cmdline)

set up an options parser to use the current commandline.

Recognises the following options

--help
--group <groupID>
--describe

Definition at line 54 of file testoption.cpp.

Member Function Documentation

◆ getTestgroup()

const string getTestgroup ( )
Returns
the Tests-Group as given on cmdline, or Suite::ALLGROUP as default

Definition at line 92 of file testoption.cpp.

Referenced by TestOption_test::doIt(), and main().

+ Here is the caller graph for this function:

◆ getTestID()

const string getTestID ( )
Returns
ID of a single test to run, empty string if not specified

Definition at line 101 of file testoption.cpp.

Referenced by TestOption_test::doIt().

+ Here is the caller graph for this function:

◆ handleHelpRequest()

bool handleHelpRequest ( )

handles the –help switch by printing a syntax description

Returns
false if there was no help request and the Suite should indeed be executed.

Definition at line 122 of file testoption.cpp.

Referenced by main().

+ Here is the caller graph for this function:

◆ shouldDescribe()

bool shouldDescribe ( )
Returns
true if –describe switch was given

Definition at line 112 of file testoption.cpp.

Referenced by main().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  ,
const TestOption  
)
friend

for outputting the help messages.

Forward accumulated help messages from all contained option definitions

Definition at line 134 of file testoption.cpp.

+ Inheritance diagram for TestOption:
+ Collaboration diagram for TestOption:

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