38#ifndef GECODE_TEST_TEST_HH
39#define GECODE_TEST_TEST_HH
51#if !defined(GECODE_STATIC_LIBS) && \
52 (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
53#ifdef GECODE_BUILD_TEST
54#define GECODE_TEST_EXPORT __declspec( dllexport )
56#define GECODE_TEST_EXPORT __declspec( dllimport )
58#elif defined(GECODE_GCC_HAS_CLASS_VISIBILITY)
59#define GECODE_TEST_EXPORT __attribute__ ((visibility("default")))
61#define GECODE_TEST_EXPORT
125 bool empty(
void)
const;
154 std::vector<std::pair<MatchType, const char*> >
testpat;
169 void parse(
int argc,
char* argv[]);
197 static unsigned int _n_tests;
207 static void sort(
void);
209 const std::string&
name(
void)
const;
219 virtual bool run(
void) = 0;
230 static std::string
str(
bool b);
232 static std::string
str(
int i);
Passing integer arguments.
Gecode::Support::RandomGenerator _rand
Random number generator.
Base(std::string s)
Create and register a standard test with name s.
static Base * tests(void)
Return all tests.
virtual ~Base(void)
Destructor.
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 void sort(void)
Sort tests alphabetically.
static std::string str(bool b)
Map bool to string.
TestTags tags(void) const
Return tags for test.
bool list_tags
Whether to list known tags.
std::vector< std::pair< MatchType, const char * > > testpat
Patterns to test against.
bool is_test_name_matching(const std::string &test_name) const
Test whether a test name should be executed.
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.
bool is_test_tags_matching(TestTags tags) const
True iff test tags should be executed according to the requested tags. With no tag request,...
static const unsigned int deffixprob
Default fixpoint probability.
bool replay
Replay one named test from its reported random state.
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.
TestTags testtags
Tags to test against.
bool list_with_tags
Whether to include tags when listing tests.
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.
int run_registered_tests(int argc, char *argv[])
TestTag
Tags for test selection.
@ check
Basic integrity tests.
@ standard
Standard test suite.
@ sweep
Really heavy sweep tests.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const Dictionary &d)
Print statistics summary.
#define GECODE_TEST_EXPORT