Generated on for Gecode by doxygen 1.18.0

Base class for all tests to be run More...

#include <test/test.hh>

Public Member Functions

 Base (std::string s)
 Create and register a standard test with name s.
 Base (std::string s, TestTags t)
 Create and register test with name s and tags t.
const std::string & name (void) const
 Return name of test.
TestTags tags (void) const
 Return tags for test.
Base * next (void) const
 Return next test.
void next (Base *n)
 Set next test.
virtual bool run (void)=0
 Run test.
bool fixpoint (void)
 Throw a coin whether to compute a fixpoint.
virtual ~Base (void)
 Destructor.

Static Public Member Functions

static void sort (void)
 Sort tests alphabetically.
static Base * tests (void)
 Return all tests.
static bool fixpoint (Gecode::Support::RandomGenerator &rand)
 Throw a coin whether to compute a fixpoint.

(Note that these are not member symbols.)

int run_registered_tests (int argc, char *argv[])
 Run the tests in the process-wide registry.

Mapping scalar values to strings

Gecode::Support::RandomGenerator _rand
 Random number generator.
static std::string str (bool b)
 Map bool to string.
static std::string str (int i)
 Map integer to string.
static std::string str (const Gecode::IntArgs &i)
 Map integer array to string.

Detailed Description

Base class for all tests to be run

Definition at line 186 of file test.hh.

Constructor & Destructor Documentation

◆ Base() [1/2]

Test::Base::Base ( std::string s)

Create and register a standard test with name s.

◆ Base() [2/2]

Test::Base::Base ( std::string s,
TestTags t )

Create and register test with name s and tags t.

The supplied tags determine membership independently of the name.

◆ ~Base()

virtual Test::Base::~Base ( void )
virtual

Destructor.

Member Function Documentation

◆ sort()

void Test::Base::sort ( void )
static

Sort tests alphabetically.

◆ name()

const std::string & Test::Base::name ( void ) const
inline

Return name of test.

Definition at line 91 of file test.hpp.

◆ tags()

TestTags Test::Base::tags ( void ) const
inline

Return tags for test.

Definition at line 95 of file test.hpp.

◆ tests()

Base * Test::Base::tests ( void )
inlinestatic

Return all tests.

Definition at line 99 of file test.hpp.

◆ next() [1/2]

Base * Test::Base::next ( void ) const
inline

Return next test.

Definition at line 103 of file test.hpp.

◆ next() [2/2]

void Test::Base::next ( Base * n)
inline

Set next test.

Definition at line 107 of file test.hpp.

◆ run()

◆ fixpoint() [1/2]

bool Test::Base::fixpoint ( void )
inline

Throw a coin whether to compute a fixpoint.

Definition at line 111 of file test.hpp.

◆ fixpoint() [2/2]

bool Test::Base::fixpoint ( Gecode::Support::RandomGenerator & rand)
inlinestatic

Throw a coin whether to compute a fixpoint.

Definition at line 116 of file test.hpp.

◆ str() [1/3]

std::string Test::Base::str ( bool b)
inlinestatic

Map bool to string.

Definition at line 121 of file test.hpp.

◆ str() [2/3]

std::string Test::Base::str ( int i)
inlinestatic

Map integer to string.

Definition at line 131 of file test.hpp.

◆ str() [3/3]

std::string Test::Base::str ( const Gecode::IntArgs & i)
inlinestatic

Map integer array to string.

Definition at line 138 of file test.hpp.

◆ run_registered_tests()

int run_registered_tests ( int argc,
char * argv[] )
related

Run the tests in the process-wide registry.

Tests register during construction. They must remain alive until every runner call has returned; destruction does not remove a test from the process-wide registry. Runner calls must not overlap. Option parsing exits the process after printing help or reporting a malformed option.

Use -help to list options and -list to list registered tests. Failure reports provide a -replay state and exact -test name. Replay runs that test once on one thread, starting from the failing iteration's state. -log prints the buffered log on failure and requires one thread.

Repeated -tag options select the union of their tags. With no -tag, all tests are eligible, including tests without tags; -tag all selects tests with at least one known tag. Name and tag filters must both match. -list and -list-with-tags list every registered test, ignoring -test, -tag, and -start.

Member Data Documentation

◆ _rand

Gecode::Support::RandomGenerator Test::Base::_rand
mutable

Random number generator.

Definition at line 238 of file test.hh.


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