Skip to content

Commit 857a29a

Browse files
committed
Add unit tests for new TIntegerRange adv records
Created a new DUnit test project for the Structures category, for compilation with Delphi XE only. This is TestCatStructsXE.dpr/.dproj Added unit tests for TIntegerRange to the a new TestUStructCatSnippets unit. Generated a new UStructCatSnippets unit from CodeSnip that includes TIntegerRange.
1 parent 87fb75a commit 857a29a

File tree

5 files changed

+1328
-0
lines changed

5 files changed

+1328
-0
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
program TestCatStructsXE;
2+
{
3+
4+
Delphi DUnit Test Project
5+
-------------------------
6+
This project contains the DUnit test framework and the GUI/Console test runners.
7+
Add "CONSOLE_TESTRUNNER" to the conditional defines entry in the project options
8+
to use the console test runner. Otherwise the GUI test runner will be used by
9+
default.
10+
11+
}
12+
13+
{$IFDEF CONSOLE_TESTRUNNER}
14+
{$APPTYPE CONSOLE}
15+
{$ENDIF}
16+
17+
uses
18+
Forms,
19+
TestFramework,
20+
GUITestRunner,
21+
TextTestRunner,
22+
TestUStructCatSnippets in 'TestUStructCatSnippets.pas',
23+
UStructCatSnippets in 'UStructCatSnippets.pas';
24+
25+
{$R *.RES}
26+
27+
begin
28+
Application.Initialize;
29+
if IsConsole then
30+
with TextTestRunner.RunRegisteredTests do
31+
Free
32+
else
33+
GUITestRunner.RunRegisteredTests;
34+
end.
35+
+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<ProjectGuid>{CEAD8332-8CBB-45F7-BC9C-CF3ED093133E}</ProjectGuid>
4+
<MainSource>TestCatStructsXE.dpr</MainSource>
5+
<ProjectVersion>12.3</ProjectVersion>
6+
<Base>True</Base>
7+
<Config Condition="'$(Config)'==''">Debug</Config>
8+
<Platform>Win32</Platform>
9+
<AppType>Application</AppType>
10+
<FrameworkType>VCL</FrameworkType>
11+
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
12+
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
14+
<Base>true</Base>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
17+
<Cfg_1>true</Cfg_1>
18+
<CfgParent>Base</CfgParent>
19+
<Base>true</Base>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
22+
<Cfg_2>true</Cfg_2>
23+
<CfgParent>Base</CfgParent>
24+
<Base>true</Base>
25+
</PropertyGroup>
26+
<PropertyGroup Condition="'$(Base)'!=''">
27+
<DCC_UnitSearchPath>$(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
28+
<DCC_ImageBase>00400000</DCC_ImageBase>
29+
<DCC_ExeOutput>_build\Exe</DCC_ExeOutput>
30+
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
31+
<DCC_Define>_CONSOLE_TESTRUNNER;$(DCC_Define)</DCC_Define>
32+
<DCC_DcuOutput>_build\Bin\Cat-Structs</DCC_DcuOutput>
33+
<DCC_N>false</DCC_N>
34+
<DCC_S>false</DCC_S>
35+
<DCC_K>false</DCC_K>
36+
<DCC_E>false</DCC_E>
37+
<DCC_F>false</DCC_F>
38+
</PropertyGroup>
39+
<PropertyGroup Condition="'$(Cfg_1)'!=''">
40+
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
41+
<DCC_Optimize>false</DCC_Optimize>
42+
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
43+
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Cfg_2)'!=''">
45+
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
46+
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
47+
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
48+
<DCC_DebugInformation>false</DCC_DebugInformation>
49+
</PropertyGroup>
50+
<ItemGroup>
51+
<DelphiCompile Include="TestCatStructsXE.dpr">
52+
<MainSource>MainSource</MainSource>
53+
</DelphiCompile>
54+
<DCCReference Include="TestUStructCatSnippets.pas"/>
55+
<DCCReference Include="UStructCatSnippets.pas"/>
56+
<BuildConfiguration Include="Release">
57+
<Key>Cfg_2</Key>
58+
<CfgParent>Base</CfgParent>
59+
</BuildConfiguration>
60+
<BuildConfiguration Include="Base">
61+
<Key>Base</Key>
62+
</BuildConfiguration>
63+
<BuildConfiguration Include="Debug">
64+
<Key>Cfg_1</Key>
65+
<CfgParent>Base</CfgParent>
66+
</BuildConfiguration>
67+
</ItemGroup>
68+
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
69+
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
70+
<ProjectExtensions>
71+
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
72+
<Borland.ProjectType/>
73+
<BorlandProject>
74+
<Delphi.Personality>
75+
<VersionInfo>
76+
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
77+
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
78+
<VersionInfo Name="MajorVer">1</VersionInfo>
79+
<VersionInfo Name="MinorVer">0</VersionInfo>
80+
<VersionInfo Name="Release">0</VersionInfo>
81+
<VersionInfo Name="Build">0</VersionInfo>
82+
<VersionInfo Name="Debug">False</VersionInfo>
83+
<VersionInfo Name="PreRelease">False</VersionInfo>
84+
<VersionInfo Name="Special">False</VersionInfo>
85+
<VersionInfo Name="Private">False</VersionInfo>
86+
<VersionInfo Name="DLL">False</VersionInfo>
87+
<VersionInfo Name="Locale">2057</VersionInfo>
88+
<VersionInfo Name="CodePage">1252</VersionInfo>
89+
</VersionInfo>
90+
<VersionInfoKeys>
91+
<VersionInfoKeys Name="CompanyName"/>
92+
<VersionInfoKeys Name="FileDescription"/>
93+
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
94+
<VersionInfoKeys Name="InternalName"/>
95+
<VersionInfoKeys Name="LegalCopyright"/>
96+
<VersionInfoKeys Name="LegalTrademarks"/>
97+
<VersionInfoKeys Name="OriginalFilename"/>
98+
<VersionInfoKeys Name="ProductName"/>
99+
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
100+
<VersionInfoKeys Name="Comments"/>
101+
</VersionInfoKeys>
102+
<Source>
103+
<Source Name="MainSource">TestCatStructsXE.dpr</Source>
104+
</Source>
105+
</Delphi.Personality>
106+
<Platforms>
107+
<Platform value="Win32">True</Platform>
108+
</Platforms>
109+
<UnitTesting>
110+
<TestFramework>DUnit / Delphi Win32</TestFramework>
111+
<TestRunner>GUI</TestRunner>
112+
<SourceProjectName>C:\Code\Repos\delphidabbler\code-snippets\tests\Cat-Hex\TestHexCat.dproj</SourceProjectName>
113+
<TestProjectName/>
114+
</UnitTesting>
115+
</BorlandProject>
116+
<ProjectFileVersion>12</ProjectFileVersion>
117+
</ProjectExtensions>
118+
</Project>
89.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)