Base class for all tests to be run
More...
#include <test/test.hh>
|
| | 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.
|
|
(Note that these are not member symbols.)
|
| int | run_registered_tests (int argc, char *argv[]) |
| | Run the tests in the process-wide registry.
|
Base class for all tests to be run
Definition at line 186 of file test.hh.
◆ 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 |
◆ 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 |
◆ run()
| virtual bool Test::Base::run |
( |
void | | ) |
|
|
pure virtual |
Run test.
Implemented in Test::Assign::BoolTest, Test::Assign::FloatTest, Test::Assign::IntTest, Test::Assign::SetTest, Test::Branch::BoolTest, Test::Branch::FloatTest, Test::Branch::IntTest, Test::Branch::SetTest, Test::FlatZinc::FlatZincErrorTest, Test::FlatZinc::FlatZincTest, Test::Float::Test, Test::Int::OpenTest, Test::Int::Test, and Test::Set::SetTest.
◆ 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]
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]
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.
◆ _rand
Random number generator.
Definition at line 238 of file test.hh.
The documentation for this class was generated from the following files: