40 namespace Test {
namespace FlatZinc {
43 const std::string& expected,
bool allSolutions)
44 :
Base(
"FlatZinc::"+name), _name(name), _source(source), _expected(expected),
45 _allSolutions(allSolutions) {}
49 using namespace Gecode;
61 fg->createBranchers(fg->solveAnnotations(), fznopt.
seed(), fznopt.
decay(),
64 std::ostringstream os;
65 fg->run(os,
p, fznopt, t_total);
71 olog <<
"FlatZinc produced the following output:\n" << os.str() <<
"\n";
76 olog <<
"Could not parse input\n";
Options for running FlatZinc models
Simple class for describing identation.
virtual bool run(void)
Perform test.
FlatZincTest(const std::string &name, const std::string &source, const std::string &expected, bool allSolutions=false)
Construct and register test.
GECODE_FLATZINC_EXPORT FlatZincSpace * parse(const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=NULL, FznRnd *rnd=NULL)
Parse FlatZinc file fileName into fzs and return it.
void start(void)
Start timer.
int p
Number of positive literals for node type.
Output support class for FlatZinc interpreter.
const std::string & toString(void) const
Base class for all tests to be run
bool log
Whether to log the tests.
std::ostringstream olog
Stream used for logging.
Exception class for FlatZinc errors
bool allSolutions(void) const
A space that can be initialized with a FlatZinc model.