ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/testsuite/testsuite.dpr
(Generate patch)

Comparing:
ibx/trunk/fbintf/testsuite/testsuite.dpr (file contents), Revision 56 by tony, Mon Mar 6 10:20:02 2017 UTC vs.
ibx/branches/udr/testsuite/testsuite.dpr (file contents), Revision 381 by tony, Sat Jan 15 00:06:22 2022 UTC

# Line 5 | Line 5 | program testsuite;
5   {$R *.res}
6  
7   uses
8 <  SysUtils, IB,
8 >  System.SysUtils,
9 >  FBTestApp in 'FBTestApp.pas',
10    Test1 in 'Test1.pas',
11 <  test2 in 'test2.pas',
11 >  Test2 in 'Test2.pas',
12    Test3 in 'Test3.pas',
13    Test4 in 'Test4.pas',
14    Test5 in 'Test5.pas',
# Line 22 | Line 23 | uses
23    Test14 in 'Test14.pas',
24    Test15 in 'Test15.pas',
25    Test16 in 'Test16.pas',
26 <  TestManager in 'TestManager.pas';
27 <
28 < procedure WriteHelp;
29 < begin
30 <  { add your help code here }
31 <  writeln(OutFile,'Usage: ', ParamStr(0), ' -h');
32 < 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 <
26 >  Test17 in 'Test17.pas',
27 >  Test18 in 'Test18.pas',
28 >  Test19 in 'Test19.pas',
29 >  Test20 in 'Test20.pas',
30 >  Test21 in 'Test21.pas',
31 >  Test22 in 'Test22.pas',
32 >  TestApplication in 'testApp\TestApplication.pas';
33  
34   var
35 <  ErrorMsg: AnsiString;
36 <  FTestID: integer;
37 <  aValue: string;
38 < begin
39 <  try
40 <
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;
35 >  Application: TTestApplication;
36 > begin
37 >  Application := TTestApplication.Create(nil);
38 >  Application.Title:='Firebird API Test Suite';
39 >  Application.Run;
40 >  Application.Free;
41   end.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines