Generated on for Gecode by doxygen 1.17.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.

Definition at line 125 of file test.cpp.

◆ 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.

Definition at line 128 of file test.cpp.

◆ ~Base()

Test::Base::~Base ( void )
virtualdefault

Destructor.

Member Function Documentation

◆ sort()

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

Sort tests alphabetically.

Definition at line 146 of file test.cpp.

◆ 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()

virtual bool Test::Base::run ( void )
pure virtual

Run test.

Implemented in Test::AFC, Test::Array::EmptyVector, Test::Array::SharedArrayIterator, Test::Array::VarArgsIterator, Test::Array::VarArrayIterator, Test::Array::ViewArrayIterator, Test::Assign::BoolTest, Test::Assign::FloatTest, Test::Assign::IntTest, Test::Assign::SetTest, Test::Branch::BoolTest, Test::Branch::FilteredRndTies, Test::Branch::FloatTest, Test::Branch::IntTest, Test::Branch::SetTest, Test::Fault::BranchActionHeapFailures, Test::Fault::BranchChbHeapFailures, Test::Fault::CloneAdvisorCopy, Test::Fault::CloneBrancherCopy, Test::Fault::CloneDerivedSpaceCopy, Test::Fault::CloneDerivedSpaceUpdate, Test::Fault::CloneDisposalArray, Test::Fault::CloneHeapFailures, Test::Fault::CloneLocalObjectCopy, Test::Fault::ClonePropagatorCopy, Test::Fault::DisposeNoticeArray, Test::Fault::DisposeNoticeArrayResize, Test::Fault::HeapAllocation, Test::Fault::HeapReallocation, Test::Fault::IntSetHeapFailures, Test::Fault::MiniModelBoolMiscHeapFailure, Test::Fault::MiniModelDefaultNodes, Test::Fault::MiniModelFloatHeapFailures, Test::Fault::MiniModelHeapFailures, Test::Fault::MiniModelLinearSumHeapFailures, Test::Fault::MiniModelSetHeapFailures, Test::FlatZinc::Blackbox::NativeDllParallelCalls, Test::FlatZinc::Blackbox::NativeProtocol, Test::FlatZinc::FlatZincErrorTest, Test::FlatZinc::FlatZincTest, Test::Float::Arithmetic::DirectedRounding, Test::Float::Arithmetic::MedianRoundingMode, Test::Float::Arithmetic::MultZeroEndpoint, Test::Float::Arithmetic::PositiveNRootBounds, Test::Float::Arithmetic::PowConsistency, Test::Float::Arithmetic::RoundingScope, Test::Float::Basic::Median, Test::Float::Basic::OptimizeCut, Test::Float::Test, Test::Groups::Kill, Test::Instance::Case, Test::Int::Arithmetic::NumberTheoryAlgebraic, Test::Int::Arithmetic::NumberTheoryIdentities, Test::Int::Arithmetic::NumberTheoryLifecycle, Test::Int::Arithmetic::NumberTheoryLimits, Test::Int::Arithmetic::NumberTheorySparseBounds, Test::Int::Arithmetic::ProductBoundsLarge, Test::Int::Arithmetic::ProductCompactionZero, Test::Int::Arithmetic::ProductInverseBounds, Test::Int::Arithmetic::ProductModAlgebraic, Test::Int::Arithmetic::ProductModInvalidModulus, Test::Int::Arithmetic::ProductModNonzero, Test::Int::Arithmetic::ProductModVarAlgebraic, Test::Int::Arithmetic::ProductModVarBounds, Test::Int::Arithmetic::ProductModVarSparseModulus, Test::Int::Arithmetic::ProductPowerAlias, Test::Int::Arithmetic::ProductSimplifySign, Test::Int::BinPacking::CliqueMBPT, Test::Int::BinPacking::PropagationLevels, Test::Int::Cumulative::KnapsackAugmentedOverload, Test::Int::Cumulatives::ProfileContribution, Test::Int::Distinct::Pathological, Test::Int::Extensional::DenseCompressedTupleSetWideGap, Test::Int::Extensional::OpenRegularBackward, Test::Int::Extensional::OpenRegularClone, Test::Int::Extensional::OpenRegularDomainWake, Test::Int::Extensional::OpenRegularIncremental, Test::Int::Extensional::OpenRegularLengthWake, Test::Int::Extensional::OpenRegularMaxLength, Test::Int::Extensional::SparseTupleSetDisabledFailure, Test::Int::Extensional::SparseTupleSetWideDelta, Test::Int::Extensional::TupleSetAutoDefaultDispatch, Test::Int::Extensional::TupleSetDFARepresentation, Test::Int::Extensional::TupleSetDisabledClone, Test::Int::Extensional::TupleSetSingleRepresentation, Test::Int::Extensional::TupleSetSupportOffsetBoundary, Test::Int::Extensional::TupleSetTerminalFinalizationFailure, Test::Int::InterDistance::Posting, Test::Int::MinDistance::Arguments, Test::Int::MinDistance::Propagation, Test::Int::OpenList::Aliases, Test::Int::OpenList::BoolList, Test::Int::OpenList::BranchOrder, Test::Int::OpenList::CallbackLength, Test::Int::OpenList::Dispose, Test::Int::OpenList::DistinctWaves, Test::Int::OpenList::ExtremumBounds, Test::Int::OpenList::Factory, Test::Int::OpenList::FailedGet, Test::Int::OpenList::FixedStatistics, Test::Int::OpenList::Group, Test::Int::OpenList::GrowableIntSet, Test::Int::OpenList::ImpossibleWindow, Test::Int::OpenList::IncrementalConstraints, Test::Int::OpenList::NoGoods, Test::Int::OpenList::NoGPI, Test::Int::OpenList::OpenListMaterialize, Test::Int::OpenList::PatternEnumeration, Test::Int::OpenList::PatternGrowth, Test::Int::OpenList::PatternInput, Test::Int::OpenList::SelectorChoice, Test::Int::OpenList::Selectors, Test::Int::OpenList::Transition, Test::Int::OpenList::ValueCommit, Test::Int::OpenList::ValueReplay, Test::Int::OpenList::Views, Test::Int::OpenTest, Test::Int::Test, Test::LDSB::LDSB< T >, Test::LDSB::LDSBLatin, Test::LDSB::LDSBSet< T >, Test::NoGoods::NoGoods< Model, ValBranch >, Test::NoGPI, Test::Region, Test::Search::BAB< Model >, Test::Search::DFS< Model >, Test::Search::ExhaustedAtLimit, Test::Search::Heuristic< E >, Test::Search::HeuristicPortfolio, Test::Search::LDS< Model >, Test::Search::PBS< Model, Engine >, Test::Search::PBSBuilderStop, Test::Search::PBSConstructionFailure, Test::Search::PBSRestartCutoff, Test::Search::PBSRestartCutoffDeleted, Test::Search::RBS< Model, Engine >, Test::Search::RBSFailedFirstSlave, Test::Search::RBSFailedMaster, Test::Search::RBSIncompleteNoGoods, Test::Search::RBSRootFailure, Test::Search::RelaxFailed, Test::Search::SEBPBS< Model >, Test::Search::WorkerControlAPI, Test::Search::WorkerControlConcurrentResize, Test::Search::WorkerControlPBSPause, Test::Search::WorkerControlSequentialPause, 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]

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.

Definition at line 603 of file test.cpp.

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: