forked from himselfv/wakan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WakanTests.dpr
75 lines (64 loc) · 2.27 KB
/
WakanTests.dpr
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
72
73
74
75
program WakanTests;
{
Delphi DUnit Test Project
-------------------------
This project contains the DUnit test framework and the GUI/Console test runners.
Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
to use the console test runner. Otherwise the GUI test runner will be used by
default.
Global conditionals:
HARDCORE
Adds hardcore versions of some tests. Principally they're the same, but with
more load and therefore slower.
May help to catch errors which only occur in heavy load conditions. Set when
running final checks before releasing.
}
{$IFDEF CONSOLE_TESTRUNNER}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Forms,
TestFramework,
GUITestRunner,
TextTestRunner,
TestingCommon,
JWBCore in 'Modules\JWBCore.pas',
JWBSettings in 'Modules\Settings\JWBSettings.pas' {fSettings},
JWBLegacyMarkup in 'Modules\Vocab\JWBLegacyMarkup.pas',
JWBRomaSort in 'Modules\Vocab\JWBRomaSort.pas',
WakanCfg in 'Modules\WakanCfg.pas',
JWBDic,
JWBDictionaries,
TextTableTests in 'Modules\Package\TextTableTests.pas',
JWBWakanTextTests in 'Modules\Editor\JWBWakanTextTests.pas',
JWBComponentsTests in 'Modules\Components\JWBComponentsTests.pas',
RaineRadicalsTests in 'Modules\KanjiList\RaineRadicalsTests.pas',
UpgradeFilesTests in 'Modules\LocalData\UpgradeFilesTests.pas',
JWBDicTests in 'Modules\Dictionary\JWBDicTests.pas',
JWBDicSearchTests in 'Modules\Dictionary\JWBDicSearchTests.pas';
{$R *.RES}
var
ExitBehavior: TRunnerExitBehavior;
begin
Application.Initialize;
//Initialize wakan global environment
//We prefer to load things locally but it's not always possible.
LoadWakanCfg(AppFolder + '\wakan.cfg');
fSettings := TfSettings.Create(nil);
//Load exactly one standard dictionary
dicts.Add(dicts.NewDict(AppFolder+'\edict2.dic'));
dicts.PutInGroup(dicts[0], 1, true);
dicts[0].Load;
if IsConsole then begin
if FindCmdLineSwitch('halt') then
ExitBehavior := rxbHaltOnFailures
else
ExitBehavior := rxbContinue;
with TextTestRunner.RunRegisteredTests(ExitBehavior) do
Free;
if FindCmdLineSwitch('pause') then
readln;
end else
GuiTestRunner.RunRegisteredTests;
end.