5 |
|
{$R *.res} |
6 |
|
|
7 |
|
uses |
8 |
< |
SysUtils, IB, |
8 |
> |
SysUtils, |
9 |
|
Test1 in 'Test1.pas', |
10 |
– |
test2 in 'test2.pas', |
10 |
|
Test3 in 'Test3.pas', |
11 |
|
Test4 in 'Test4.pas', |
12 |
|
Test5 in 'Test5.pas', |
21 |
|
Test14 in 'Test14.pas', |
22 |
|
Test15 in 'Test15.pas', |
23 |
|
Test16 in 'Test16.pas', |
24 |
< |
TestManager in 'TestManager.pas'; |
25 |
< |
|
26 |
< |
procedure WriteHelp; |
27 |
< |
begin |
28 |
< |
{ add your help code here } |
30 |
< |
writeln(OutFile,'Usage: ', ParamStr(0), ' -h'); |
31 |
< |
end; |
32 |
< |
|
33 |
< |
function GetCmdLineValue(const Switch: string; var aValue: string): boolean; |
34 |
< |
var i: integer; |
35 |
< |
begin |
36 |
< |
Result := FindCmdLineSwitch(Switch,false); |
37 |
< |
if Result then |
38 |
< |
begin |
39 |
< |
for i := 0 to ParamCount do |
40 |
< |
if (ParamStr(i) = '-' + Switch) and (i <= ParamCount) then |
41 |
< |
begin |
42 |
< |
aValue := ParamStr(i+1); |
43 |
< |
exit; |
44 |
< |
end; |
45 |
< |
Result := false; |
46 |
< |
end; |
47 |
< |
end; |
48 |
< |
|
24 |
> |
Test17 in 'Test17.pas', |
25 |
> |
Test18 in 'Test18.pas', |
26 |
> |
Test2 in 'Test2.pas', |
27 |
> |
TestApplication in 'testApp\TestApplication.pas', |
28 |
> |
FBTestApp in 'FBTestApp.pas'; |
29 |
|
|
30 |
|
var |
31 |
< |
ErrorMsg: AnsiString; |
32 |
< |
FTestID: integer; |
33 |
< |
aValue: string; |
34 |
< |
begin |
35 |
< |
try |
36 |
< |
|
57 |
< |
FTestID := 0; |
58 |
< |
AssignFile(OutFile,''); |
59 |
< |
ReWrite(outFile); |
60 |
< |
|
61 |
< |
|
62 |
< |
// parse parameters |
63 |
< |
if FindCmdLineSwitch('h') or FindCmdLineSwitch('help') then |
64 |
< |
begin |
65 |
< |
WriteHelp; |
66 |
< |
Exit; |
67 |
< |
end; |
68 |
< |
|
69 |
< |
if GetCmdLineValue('t',aValue) then |
70 |
< |
FTestID := StrToInt(aValue); |
71 |
< |
|
72 |
< |
if TestMgr <> nil then |
73 |
< |
begin |
74 |
< |
if GetCmdLineValue('u',aValue) or GetCmdLineValue('user',aValue) then |
75 |
< |
TestMgr.SetUserName(aValue); |
76 |
< |
|
77 |
< |
if GetCmdLineValue('p',aValue) or GetCmdLineValue('passwd',aValue) then |
78 |
< |
TestMgr.SetPassword(aValue); |
79 |
< |
|
80 |
< |
if GetCmdLineValue('e',aValue) or GetCmdLineValue('employeedb',aValue) then |
81 |
< |
TestMgr.SetEmployeeDatabaseName(aValue); |
82 |
< |
|
83 |
< |
if GetCmdLineValue('n',aValue) or GetCmdLineValue('newdbname',aValue) then |
84 |
< |
TestMgr.SetNewDatabaseName(aValue); |
85 |
< |
|
86 |
< |
if GetCmdLineValue('s',aValue) or GetCmdLineValue('secondnewdbname',aValue) then |
87 |
< |
TestMgr.SetSecondNewDatabaseName(aValue); |
88 |
< |
|
89 |
< |
if GetCmdLineValue('b',aValue) or GetCmdLineValue('backupfile',aValue) then |
90 |
< |
TestMgr.SetBackupFileName(aValue); |
91 |
< |
|
92 |
< |
if GetCmdLineValue('o',aValue) or GetCmdLineValue('outfile',aValue) then |
93 |
< |
begin |
94 |
< |
system.Assign(outFile,aValue); |
95 |
< |
ReWrite(outFile); |
96 |
< |
end; |
97 |
< |
|
98 |
< |
TestMgr.ShowStatistics := FindCmdLineSwitch('S',false) or FindCmdLineSwitch('stats'); |
99 |
< |
|
100 |
< |
{Ensure consistent date reporting across platforms} |
101 |
< |
{$IF declared(FormatSettings)} |
102 |
< |
FormatSettings.ShortDateFormat := 'd/m/yyyy'; |
103 |
< |
FormatSettings.LongTimeFormat := 'HH:MM:SS'; |
104 |
< |
FormatSettings.DateSeparator := '/'; |
105 |
< |
{$ELSE} |
106 |
< |
ShortDateFormat := 'd/m/yyyy'; |
107 |
< |
LongTimeFormat := 'HH:MM:SS'; |
108 |
< |
DateSeparator := '/'; |
109 |
< |
{$IFEND} |
110 |
< |
|
111 |
< |
writeln(OutFile,'Firebird Client API Test Suite'); |
112 |
< |
writeln(OutFile,'Copyright MWA Software 2016'); |
113 |
< |
writeln(OutFile); |
114 |
< |
writeln(OutFile,'Starting Tests'); |
115 |
< |
writeln(OutFile,'Client API Version = ',FirebirdAPI.GetImplementationVersion); |
116 |
< |
|
117 |
< |
if FTestID = 0 then |
118 |
< |
TestMgr.RunAll |
119 |
< |
else |
120 |
< |
TestMgr.Run(FTestID); |
121 |
< |
TestMgr.Free; |
122 |
< |
end; |
123 |
< |
|
124 |
< |
writeln(OutFile,'Test Suite Ends'); |
125 |
< |
Flush(OutFile); |
126 |
< |
//readln; {uncomment if running from IDE and console window closes before you can view results} |
127 |
< |
|
128 |
< |
except |
129 |
< |
on E: Exception do |
130 |
< |
Writeln(E.ClassName, ': ', E.Message); |
131 |
< |
end; |
31 |
> |
Application: TTestApplication; |
32 |
> |
begin |
33 |
> |
Application := TTestApplication.Create(nil); |
34 |
> |
Application.Title:='Firebird API Test Suite'; |
35 |
> |
Application.Run; |
36 |
> |
Application.Free; |
37 |
|
end. |