38#ifndef GECODE_TEST_TEST_HH
39#define GECODE_TEST_TEST_HH
64 extern std::ostringstream
olog;
102 std::vector<std::pair<MatchType, const char*> >
testpat;
130 static unsigned int _n_tests;
137 const std::string&
name(
void)
const;
145 virtual bool run(
void) = 0;
156 static std::string
str(
bool b);
158 static std::string
str(
int i);
174int main(
int argc,
char* argv[]);
Passing integer arguments.
int main(int argc, char *argv[])
Main function.
Gecode::Support::RandomGenerator _rand
Random number generator.
Base(std::string s)
Create and register test with name s.
static void sort(void)
Sort tests alphabetically.
virtual ~Base(void)
Destructor.
static Base * tests(void)
Return all tests.
bool fixpoint(void)
Throw a coin whether to compute a fixpoint.
Base * next(void) const
Return next test.
virtual bool run(void)=0
Run test.
const std::string & name(void) const
Return name of test.
static std::string str(bool b)
Map bool to string.
std::vector< std::pair< MatchType, const char * > > testpat
Patterns to test against.
bool is_test_name_matching(const std::string &test_name)
True iff a test name should be executed according to the patterns. With no patterns,...
void parse(int argc, char *argv[])
Parse commandline arguments.
bool log
Whether to log the tests.
unsigned int seed
The random seed to be used.
const char * start_from
Name of first test to start with.
Options(void)
Initialize options with defaults.
static const unsigned int deffixprob
Default fixpoint probability.
bool list
Whether to list all tests.
unsigned int iter
Number of iterations for each test.
bool stop
Whether to stop on an error.
unsigned int threads
Number of threads to use.
unsigned int fixprob
The probability for computing a fixpoint.
static const int defiter
Default number of iterations.
Simple class for describing indentation.
int l
Which indentation level.
ind(int i)
Indent by level i.
LinearCongruentialGenerator< 2147483647, 48271, 44488, 3399 > RandomGenerator
Default values for linear congruential generator.
std::ostringstream olog
Stream used for logging.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const Dictionary &d)
Print statistics summary.