Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef MONAD_SHARED
#define MONAD_SHARED
#include "util.h"
#include "pipestream.h"
namespace monad_shared
{
namespace version
{
extern const char * official_name;
extern const char * version_name;
extern const char * date;
}
void printInfo();
struct unit_test
{
typedef std::string return_type;
typedef return_type (*function)(unit_test & this_test);
static const char * pass_string;
std::string errormsg;
std::string output;
function func;
const char * name;
util::pipestream * checkstream;
long timeout;
long time;
int32_t points;
int32_t valgrind_flags;
int8_t mp_part;
bool is_valgrind;
unit_test(int8_t MPpart_,
const char * name_,
unit_test::function func_,
int32_t points_,
long timeout_,
bool is_valgrind_)
: errormsg("message not set / proxy crashed"),
func(func_),
name(name_),
checkstream(NULL),
timeout(timeout_),
time(-1),
points(points_),
valgrind_flags(-1),
mp_part(MPpart_),
is_valgrind(is_valgrind_) { }
bool passed() const
{
return errormsg == pass_string;
}
};
namespace output
{
void set_error_message();
void header(const std::string & title);
void total_score(int32_t score);
void warning(const std::string & message);
void testname(const unit_test & curr_test, int32_t max_testname_len, int32_t max_points_len);
void detailed_info(const unit_test & curr_test);
} // namespace output
}
#endif // MONAD_SHARED