Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 51 of file testoption.hpp.

Public Member Functions

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

Friends

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

Private Attributes

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

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 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 46 of file testoption.cpp.

References Suite::ALLGROUP, TestOption::parameters, and TestOption::syntax.

Member Function Documentation

◆ getTestgroup()

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

Definition at line 86 of file testoption.cpp.

References TestOption::parameters.

Referenced by 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 95 of file testoption.cpp.

References TestOption::parameters.

◆ 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 125 of file testoption.cpp.

References TestOption::parameters.

Referenced by main().

+ Here is the caller graph for this function:

◆ shouldDescribe()

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

Definition at line 115 of file testoption.cpp.

References TestOption::parameters.

Referenced by main().

+ Here is the caller graph for this function:

◆ optSeed()

optional< uint64_t > optSeed ( )

Definition at line 105 of file testoption.cpp.

References TestOption::parameters.

Referenced by main().

+ Here is the caller graph for this function:

Member Data Documentation

◆ syntax

boost::program_options::options_description syntax
private

Definition at line 64 of file testoption.hpp.

Referenced by TestOption::TestOption().

◆ parameters

boost::program_options::variables_map parameters
private

Friends And Related Symbol 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 136 of file testoption.cpp.

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

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