summaryrefslogtreecommitdiff
path: root/project2/common/check.cpp
blob: c284c8d4a5183633fc4e5835afbc70d9560beb52 (plain)
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
#include <pch.hpp>
#include "check.h"
#include "scriptLoader.h"

DECLARE_LOADER("check", Check);
StaticMessageException(NoTestsToPerform, "No tests to perform");

Check::Check(ScriptNodePtr p) :
	SourceObject(p),
	message(p, "message", "Check failed"),
	group(p, "group", "default"),
	present(p, "present", "")
{
	p->script->loader.addLoadTarget(p, Storer::into<ElementLoader>(&test));
}

Check::~Check()
{
}

bool
Check::performCheck() const
{
	if (!test) {
		throw NoTestsToPerform();
	}
	return test->passes();
}