summaryrefslogtreecommitdiff
path: root/project2/common/check.cpp
blob: 339a4138c2f66409bf16c1cdbc50d06d5d426f0e (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
30
#include "pch.hpp"
#include "check.h"
#include "scriptLoader.h"
#include "scriptStorage.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();
}