source: trunk/NewView/unittests/newviewtests.pas@ 35

Last change on this file since 35 was 35, checked in by RBRi, 19 years ago

+ StringUtilsUnit and the unit test
+ some More unit test (now we have 67)

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1program Main;
2
3uses
4 Classes,
5 SysUtils,
6 TestAssert,
7 CmdLineParameterUnitTests,
8 StringUtilsUnitTests,
9 HelpTopicTests;
10
11
12VAR
13 tmpSuites : TList;
14 tmpTests : TList;
15 tmpAllTests : TList;
16 tmpFunction : FUNCTION:TList;
17 tmpTest : PROCEDURE;
18 i,j,tmpTestCount,tmpFailureCount : integer;
19
20BEGIN
21 tmpAllTests := TList.Create;
22 tmpSuites := TList.Create;
23
24 tmpSuites.Add(@getCmdLineParameterUnitTests);
25 tmpSuites.Add(@getStringUtilsUnitTests);
26 tmpSuites.Add(@getHelpTopicTests);
27
28 tmpTestCount := 0;
29 tmpFailureCount := 0;
30 for i := 0 to tmpSuites.Count-1 do
31 begin
32 tmpFunction := tmpSuites.items[i];
33 tmpTests := tmpFunction;
34 for j := 0 to tmpTests.Count-1 do
35 begin
36 tmpTest := tmpTests.items[j];
37 try
38 tmpTest;
39 Write('.');
40
41 except
42 on e:Exception do
43 begin
44 tmpFailureCount := tmpFailureCount + 1;
45 writeln;
46 writeln(e.message);
47 end;
48 end;
49 tmpTestCount := tmpTestCount + 1;
50 if (0 = tmpTestCount MOD 50) then writeln;
51 end;
52 end;
53
54 writeln;
55 write('Running ' + IntToStr(tmpTestCount) + ' tests');
56 if (0 < tmpFailureCount) then write(' ' + IntToStr(tmpFailureCount) + ' failures');
57 writeln;
58
59END.
Note: See TracBrowser for help on using the repository browser.