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
|
#include <pch.hpp>
#include "check.h"
#include "scriptLoader.h"
#include "scriptStorage.h"
#include <factory.impl.h>
NAMEDFACTORY("check", Check, CheckFactory);
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<TestFactory>(&test));
}
Check::~Check()
{
}
bool
Check::performCheck(ExecContext * ec) const
{
if (!test) {
throw NoTestsToPerform();
}
return test->passes(ec);
}
INSTANTIATEFACTORY(Check, const ScriptNode *);
|