36namespace Test {
namespace FlatZinc {
39 const std::string& expected,
bool allSolutions)
40 :
Base(
"FlatZinc::"+name), _name(name), _source(source), _expected(expected),
41 _allSolutions(allSolutions) {}
60 std::ostringstream os;
61 fg->
run(os,
p, fznopt, t_total);
67 olog <<
"FlatZinc produced the following output:\n" << os.str() <<
"\n";
72 olog <<
"Could not parse input\n";
int p
Number of positive literals for node type.
Exception class for FlatZinc errors
const std::string & toString(void) const
Options for running FlatZinc models
bool allSolutions(void) const
Script mode to run.
A space that can be initialized with a FlatZinc model.
void createBranchers(Printer &p, AST::Node *ann, FlatZincOptions &opt, bool ignoreUnknown, std::ostream &err=std::cerr)
Create branchers corresponding to the solve item annotations.
void shrinkArrays(Printer &p)
Remove all variables not needed for output.
void run(std::ostream &out, const Printer &p, const FlatZincOptions &opt, Gecode::Support::Timer &t_total)
Run the search.
AST::Array * solveAnnotations(void) const
Return the solve item annotations.
Output support class for FlatZinc interpreter.
void start(void)
Start timer.
Base class for all tests to be run
FlatZincTest(const std::string &name, const std::string &source, const std::string &expected, bool allSolutions=false)
Construct and register test.
virtual bool run(void)
Perform test.
bool log
Whether to log the tests.
Simple class for describing identation.
GECODE_FLATZINC_EXPORT FlatZincSpace * parse(const std::string &fileName, Printer &p, std::ostream &err=std::cerr, FlatZincSpace *fzs=NULL, Rnd &rnd=defrnd)
Parse FlatZinc file fileName into fzs and return it.
Gecode toplevel namespace
std::ostringstream olog
Stream used for logging.