main page
modules
namespaces
classes
files
Gecode home
Generated on Mon Aug 27 2012 17:15:50 for Gecode by
doxygen
1.8.1.2
test
test.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Christian Schulte <schulte@gecode.org>
5
*
6
* Contributing authors:
7
* Mikael Lagerkvist <lagerkvist@gecode.org>
8
*
9
* Copyright:
10
* Christian Schulte, 2005
11
* Mikael Lagerkvist, 2005
12
*
13
* Last modified:
14
* $Date: 2010-04-08 20:35:31 +1000 (Thu, 08 Apr 2010) $ by $Author: schulte $
15
* $Revision: 10684 $
16
*
17
* This file is part of Gecode, the generic constraint
18
* development environment:
19
* http://www.gecode.org
20
*
21
* Permission is hereby granted, free of charge, to any person obtaining
22
* a copy of this software and associated documentation files (the
23
* "Software"), to deal in the Software without restriction, including
24
* without limitation the rights to use, copy, modify, merge, publish,
25
* distribute, sublicense, and/or sell copies of the Software, and to
26
* permit persons to whom the Software is furnished to do so, subject to
27
* the following conditions:
28
*
29
* The above copyright notice and this permission notice shall be
30
* included in all copies or substantial portions of the Software.
31
*
32
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39
*
40
*/
41
42
#ifndef __GECODE_TEST_TEST_HH__
43
#define __GECODE_TEST_TEST_HH__
44
45
#include <
gecode/kernel.hh
>
46
#include <
gecode/search.hh
>
47
48
#include <iostream>
49
#include <sstream>
50
#include <string>
51
53
namespace
Test {
54
67
extern
std::ostringstream
olog
;
68
70
class
ind
{
71
public
:
73
int
l
;
75
ind
(
int
i
) :
l
(i) {}
76
};
77
78
80
class
Options
{
81
public
:
83
unsigned
int
seed
;
85
unsigned
int
iter
;
87
static
const
int
defiter
= 5;
89
unsigned
int
fixprob
;
91
static
const
unsigned
int
deffixprob
= 10;
93
bool
stop
;
95
bool
log
;
96
98
Options
(
void
);
100
void
parse
(
int
argc,
char
* argv[]);
101
};
102
104
extern
Options
opt
;
105
107
class
Base
{
108
private
:
110
std::string _name;
112
Base
* _next;
114
static
Base
* _tests;
116
static
unsigned
int
_n_tests;
117
public
:
119
Base
(
const
std::string& s);
121
static
void
sort
(
void
);
123
const
std::string&
name
(
void
)
const
;
125
static
Base
*
tests
(
void
);
127
Base
*
next
(
void
)
const
;
129
void
next
(
Base
* n);
131
virtual
bool
run
(
void
) = 0;
133
static
bool
fixpoint
(
void
);
135
virtual
~Base
(
void
);
136
138
static
Gecode::Support::RandomGenerator
rand
;
139
};
141
142
}
143
148
int
main
(
int
argc,
char
* argv[]);
149
154
std::ostream&
155
operator<<
(std::ostream& os,
const
Test::ind
&
i
);
156
157
#include "
test/test.hpp
"
158
159
#endif
160
161
// STATISTICS: test-core