-
toole1 authored
git-svn-id: https://subversion.cs.illinois.edu/svn/cs225@4325 6fbd10e7-183d-0410-a318-cb416676e4f2
toole1 authoredgit-svn-id: https://subversion.cs.illinois.edu/svn/cs225@4325 6fbd10e7-183d-0410-a318-cb416676e4f2
monad_shared.h 1.48 KiB
#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