test.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef __GECODE_TEST_TEST_HH__
00039 #define __GECODE_TEST_TEST_HH__
00040
00041 #include <gecode/kernel.hh>
00042 #include <gecode/search.hh>
00043
00044 #include <iostream>
00045 #include <sstream>
00046 #include <string>
00047
00049 namespace Test {
00050
00063 extern std::ostringstream olog;
00064
00066 class ind {
00067 public:
00069 int l;
00071 ind(int i) : l(i) {}
00072 };
00073
00074
00076 class Options {
00077 public:
00079 unsigned int seed;
00081 unsigned int iter;
00083 static const int defiter = 5;
00085 unsigned int fixprob;
00087 static const unsigned int deffixprob = 10;
00089 bool stop;
00091 bool log;
00092
00094 Options(void);
00096 void parse(int argc, char* argv[]);
00097 };
00098
00100 extern Options opt;
00101
00103 class Base {
00104 private:
00106 std::string _name;
00108 Base* _next;
00110 static Base* _tests;
00112 static unsigned int _n_tests;
00113 public:
00115 Base(const std::string& s);
00117 static void sort(void);
00119 const std::string& name(void) const;
00121 static Base* tests(void);
00123 Base* next(void) const;
00125 void next(Base* n);
00127 virtual bool run(void) = 0;
00129 static bool fixpoint(void);
00131 virtual ~Base(void);
00132
00134 static Gecode::Support::RandomGenerator rand;
00135 };
00137
00138 }
00139
00144 int main(int argc, char* argv[]);
00145
00150 std::ostream&
00151 operator<<(std::ostream& os, const Test::ind& i);
00152
00153 #include "test/test.hpp"
00154
00155 #endif
00156
00157