THRIFT-5387 Improved and simplified Delphi test setup
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/test/serializer/TestSerializer.Data.pas b/lib/delphi/test/serializer/TestSerializer.Data.pas
index 2420e9a..a90d650 100644
--- a/lib/delphi/test/serializer/TestSerializer.Data.pas
+++ b/lib/delphi/test/serializer/TestSerializer.Data.pas
@@ -284,57 +284,57 @@
// superhuge compact proto test struct
begin
result := TCompactProtoTestStructImpl.Create;
- result.A_byte := TDebugProtoTestConstants.COMPACT_TEST.A_byte;
- result.A_i16 := TDebugProtoTestConstants.COMPACT_TEST.A_i16;
- result.A_i32 := TDebugProtoTestConstants.COMPACT_TEST.A_i32;
- result.A_i64 := TDebugProtoTestConstants.COMPACT_TEST.A_i64;
- result.A_double := TDebugProtoTestConstants.COMPACT_TEST.A_double;
- result.A_string := TDebugProtoTestConstants.COMPACT_TEST.A_string;
- result.A_binary := TDebugProtoTestConstants.COMPACT_TEST.A_binary;
- result.True_field := TDebugProtoTestConstants.COMPACT_TEST.True_field;
- result.False_field := TDebugProtoTestConstants.COMPACT_TEST.False_field;
- result.Empty_struct_field := TDebugProtoTestConstants.COMPACT_TEST.Empty_struct_field;
- result.Byte_list := TDebugProtoTestConstants.COMPACT_TEST.Byte_list;
- result.I16_list := TDebugProtoTestConstants.COMPACT_TEST.I16_list;
- result.I32_list := TDebugProtoTestConstants.COMPACT_TEST.I32_list;
- result.I64_list := TDebugProtoTestConstants.COMPACT_TEST.I64_list;
- result.Double_list := TDebugProtoTestConstants.COMPACT_TEST.Double_list;
- result.String_list := TDebugProtoTestConstants.COMPACT_TEST.String_list;
- result.Binary_list := TDebugProtoTestConstants.COMPACT_TEST.Binary_list;
- result.Boolean_list := TDebugProtoTestConstants.COMPACT_TEST.Boolean_list;
- result.Struct_list := TDebugProtoTestConstants.COMPACT_TEST.Struct_list;
- result.Byte_set := TDebugProtoTestConstants.COMPACT_TEST.Byte_set;
- result.I16_set := TDebugProtoTestConstants.COMPACT_TEST.I16_set;
- result.I32_set := TDebugProtoTestConstants.COMPACT_TEST.I32_set;
- result.I64_set := TDebugProtoTestConstants.COMPACT_TEST.I64_set;
- result.Double_set := TDebugProtoTestConstants.COMPACT_TEST.Double_set;
- result.String_set := TDebugProtoTestConstants.COMPACT_TEST.String_set;
- result.String_set := TDebugProtoTestConstants.COMPACT_TEST.String_set;
- result.String_set := TDebugProtoTestConstants.COMPACT_TEST.String_set;
- result.Binary_set := TDebugProtoTestConstants.COMPACT_TEST.Binary_set;
- result.Boolean_set := TDebugProtoTestConstants.COMPACT_TEST.Boolean_set;
- result.Struct_set := TDebugProtoTestConstants.COMPACT_TEST.Struct_set;
- result.Byte_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_byte_map;
- result.I16_byte_map := TDebugProtoTestConstants.COMPACT_TEST.I16_byte_map;
- result.I32_byte_map := TDebugProtoTestConstants.COMPACT_TEST.I32_byte_map;
- result.I64_byte_map := TDebugProtoTestConstants.COMPACT_TEST.I64_byte_map;
- result.Double_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Double_byte_map;
- result.String_byte_map := TDebugProtoTestConstants.COMPACT_TEST.String_byte_map;
- result.Binary_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Binary_byte_map;
- result.Boolean_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Boolean_byte_map;
- result.Byte_i16_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_i16_map;
- result.Byte_i32_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_i32_map;
- result.Byte_i64_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_i64_map;
- result.Byte_double_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_double_map;
- result.Byte_string_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_string_map;
- result.Byte_binary_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_binary_map;
- result.Byte_boolean_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_boolean_map;
- result.List_byte_map := TDebugProtoTestConstants.COMPACT_TEST.List_byte_map;
- result.Set_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Set_byte_map;
- result.Map_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Map_byte_map;
- result.Byte_map_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_map_map;
- result.Byte_set_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_set_map;
- result.Byte_list_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_list_map;
+ result.A_byte := DebugProtoTest.TConstants.COMPACT_TEST.A_byte;
+ result.A_i16 := DebugProtoTest.TConstants.COMPACT_TEST.A_i16;
+ result.A_i32 := DebugProtoTest.TConstants.COMPACT_TEST.A_i32;
+ result.A_i64 := DebugProtoTest.TConstants.COMPACT_TEST.A_i64;
+ result.A_double := DebugProtoTest.TConstants.COMPACT_TEST.A_double;
+ result.A_string := DebugProtoTest.TConstants.COMPACT_TEST.A_string;
+ result.A_binary := DebugProtoTest.TConstants.COMPACT_TEST.A_binary;
+ result.True_field := DebugProtoTest.TConstants.COMPACT_TEST.True_field;
+ result.False_field := DebugProtoTest.TConstants.COMPACT_TEST.False_field;
+ result.Empty_struct_field := DebugProtoTest.TConstants.COMPACT_TEST.Empty_struct_field;
+ result.Byte_list := DebugProtoTest.TConstants.COMPACT_TEST.Byte_list;
+ result.I16_list := DebugProtoTest.TConstants.COMPACT_TEST.I16_list;
+ result.I32_list := DebugProtoTest.TConstants.COMPACT_TEST.I32_list;
+ result.I64_list := DebugProtoTest.TConstants.COMPACT_TEST.I64_list;
+ result.Double_list := DebugProtoTest.TConstants.COMPACT_TEST.Double_list;
+ result.String_list := DebugProtoTest.TConstants.COMPACT_TEST.String_list;
+ result.Binary_list := DebugProtoTest.TConstants.COMPACT_TEST.Binary_list;
+ result.Boolean_list := DebugProtoTest.TConstants.COMPACT_TEST.Boolean_list;
+ result.Struct_list := DebugProtoTest.TConstants.COMPACT_TEST.Struct_list;
+ result.Byte_set := DebugProtoTest.TConstants.COMPACT_TEST.Byte_set;
+ result.I16_set := DebugProtoTest.TConstants.COMPACT_TEST.I16_set;
+ result.I32_set := DebugProtoTest.TConstants.COMPACT_TEST.I32_set;
+ result.I64_set := DebugProtoTest.TConstants.COMPACT_TEST.I64_set;
+ result.Double_set := DebugProtoTest.TConstants.COMPACT_TEST.Double_set;
+ result.String_set := DebugProtoTest.TConstants.COMPACT_TEST.String_set;
+ result.String_set := DebugProtoTest.TConstants.COMPACT_TEST.String_set;
+ result.String_set := DebugProtoTest.TConstants.COMPACT_TEST.String_set;
+ result.Binary_set := DebugProtoTest.TConstants.COMPACT_TEST.Binary_set;
+ result.Boolean_set := DebugProtoTest.TConstants.COMPACT_TEST.Boolean_set;
+ result.Struct_set := DebugProtoTest.TConstants.COMPACT_TEST.Struct_set;
+ result.Byte_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_byte_map;
+ result.I16_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.I16_byte_map;
+ result.I32_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.I32_byte_map;
+ result.I64_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.I64_byte_map;
+ result.Double_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.Double_byte_map;
+ result.String_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.String_byte_map;
+ result.Binary_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.Binary_byte_map;
+ result.Boolean_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.Boolean_byte_map;
+ result.Byte_i16_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_i16_map;
+ result.Byte_i32_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_i32_map;
+ result.Byte_i64_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_i64_map;
+ result.Byte_double_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_double_map;
+ result.Byte_string_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_string_map;
+ result.Byte_binary_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_binary_map;
+ result.Byte_boolean_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_boolean_map;
+ result.List_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.List_byte_map;
+ result.Set_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.Set_byte_map;
+ result.Map_byte_map := DebugProtoTest.TConstants.COMPACT_TEST.Map_byte_map;
+ result.Byte_map_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_map_map;
+ result.Byte_set_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_set_map;
+ result.Byte_list_map := DebugProtoTest.TConstants.COMPACT_TEST.Byte_list_map;
result.Field500 := 500;
result.Field5000 := 5000;
diff --git a/lib/delphi/test/serializer/TestSerializer.dpr b/lib/delphi/test/serializer/TestSerializer.dpr
index 0620014..971401e 100644
--- a/lib/delphi/test/serializer/TestSerializer.dpr
+++ b/lib/delphi/test/serializer/TestSerializer.dpr
@@ -41,8 +41,9 @@
Thrift.Stream in '..\..\src\Thrift.Stream.pas',
Thrift.WinHTTP in '..\..\src\Thrift.WinHTTP.pas',
Thrift.TypeRegistry in '..\..\src\Thrift.TypeRegistry.pas',
- System_,
- DebugProtoTest,
+ System_ in 'gen-delphi\System_.pas',
+ SysUtils_ in 'gen-delphi\SysUtils_.pas',
+ DebugProtoTest in 'gen-delphi\DebugProtoTest.pas',
TestSerializer.Tests in 'TestSerializer.Tests.pas',
TestSerializer.Data in 'TestSerializer.Data.pas';
diff --git a/lib/delphi/test/serializer/TestSerializer.dproj b/lib/delphi/test/serializer/TestSerializer.dproj
new file mode 100644
index 0000000..5f26264
--- /dev/null
+++ b/lib/delphi/test/serializer/TestSerializer.dproj
@@ -0,0 +1,150 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{9282EDD8-7C12-41B0-8172-61C6BFA6E238}</ProjectGuid>
+ <MainSource>TestSerializer.dpr</MainSource>
+ <Basis>True</Basis>
+ <Config Condition="'$(Config)'==''">Debug</Config>
+ <Platform>Win32</Platform>
+ <AppType>Console</AppType>
+ <FrameworkType>None</FrameworkType>
+ <DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
+ <ProjectVersion>12.3</ProjectVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Basis' or '$(Base)'!=''">
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
+ <Cfg_1>true</Cfg_1>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
+ <Cfg_2>true</Cfg_2>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base)'!=''">
+ <DCC_DcuOutput>dcu\$(Project)\$(Config)\$(Platform)</DCC_DcuOutput>
+ <DCC_ExeOutput>bin\$(Config)\$(Platform)</DCC_ExeOutput>
+ <DCC_E>false</DCC_E>
+ <DCC_ImageBase>00400000</DCC_ImageBase>
+ <DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias)</DCC_UnitAlias>
+ <DCC_F>false</DCC_F>
+ <DCC_S>false</DCC_S>
+ <DCC_N>false</DCC_N>
+ <DCC_K>false</DCC_K>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+ <DCC_DebugInformation>false</DCC_DebugInformation>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+ <DCC_Optimize>false</DCC_Optimize>
+ <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+ </PropertyGroup>
+ <ItemGroup>
+ <DelphiCompile Include="TestSerializer.dpr">
+ <MainSource>MainSource</MainSource>
+ </DelphiCompile>
+ <DCCReference Include="..\..\src\Thrift.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Exception.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Socket.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Transport.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Protocol.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Protocol.JSON.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Protocol.Compact.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Collections.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Configuration.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Server.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Utils.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Serializer.pas"/>
+ <DCCReference Include="..\..\src\Thrift.Stream.pas"/>
+ <DCCReference Include="..\..\src\Thrift.WinHTTP.pas"/>
+ <DCCReference Include="..\..\src\Thrift.TypeRegistry.pas"/>
+ <DCCReference Include="gen-delphi\System_.pas"/>
+ <DCCReference Include="gen-delphi\SysUtils_.pas"/>
+ <DCCReference Include="gen-delphi\DebugProtoTest.pas"/>
+ <DCCReference Include="TestSerializer.Tests.pas"/>
+ <DCCReference Include="TestSerializer.Data.pas"/>
+ <BuildConfiguration Include="Debug">
+ <Key>Cfg_2</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Basis">
+ <Key>Base</Key>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Release">
+ <Key>Cfg_1</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ </ItemGroup>
+ <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+ <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+ <PropertyGroup>
+ <PreBuildEvent><![CDATA[thrift.exe -r -gen delphi ..\keywords\ReservedKeywords.thrift
+thrift.exe -r -gen delphi ..\..\..\..\test\DebugProtoTest.thrift]]></PreBuildEvent>
+ </PropertyGroup>
+ <ProjectExtensions>
+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+ <Borland.ProjectType>VCLApplication</Borland.ProjectType>
+ <BorlandProject>
+ <Delphi.Personality>
+ <Source>
+ <Source Name="MainSource">TestSerializer.dpr</Source>
+ </Source>
+ <VersionInfo>
+ <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+ <VersionInfo Name="MajorVer">1</VersionInfo>
+ <VersionInfo Name="MinorVer">0</VersionInfo>
+ <VersionInfo Name="Release">0</VersionInfo>
+ <VersionInfo Name="Build">0</VersionInfo>
+ <VersionInfo Name="Debug">False</VersionInfo>
+ <VersionInfo Name="PreRelease">False</VersionInfo>
+ <VersionInfo Name="Special">False</VersionInfo>
+ <VersionInfo Name="Private">False</VersionInfo>
+ <VersionInfo Name="DLL">False</VersionInfo>
+ <VersionInfo Name="Locale">1031</VersionInfo>
+ <VersionInfo Name="CodePage">1252</VersionInfo>
+ </VersionInfo>
+ <VersionInfoKeys>
+ <VersionInfoKeys Name="CompanyName"/>
+ <VersionInfoKeys Name="FileDescription"/>
+ <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="InternalName"/>
+ <VersionInfoKeys Name="LegalCopyright"/>
+ <VersionInfoKeys Name="LegalTrademarks"/>
+ <VersionInfoKeys Name="OriginalFilename"/>
+ <VersionInfoKeys Name="ProductName"/>
+ <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="Comments"/>
+ </VersionInfoKeys>
+ </Delphi.Personality>
+ <Platforms>
+ <Platform value="Win32">True</Platform>
+ </Platforms>
+ </BorlandProject>
+ <ProjectFileVersion>12</ProjectFileVersion>
+ </ProjectExtensions>
+ </Project>