forked from apache/thrift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THRIFT-5798 Expand netstd compile tests to fully cover all current ta…
…rget environments Client: netstd Patch: Jens Geyer
- Loading branch information
Showing
15 changed files
with
452 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
...cInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.net6/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// 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. | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
|
||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("The Apache Software Foundation")] | ||
[assembly: AssemblyProduct("Thrift")] | ||
[assembly: AssemblyCopyright("The Apache Software Foundation")] | ||
[assembly: AssemblyTrademark("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
|
||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
|
||
[assembly: Guid("dbc2c69a-93f1-45f4-8ecf-36ef13fc3482")] |
90 changes: 90 additions & 0 deletions
90
...le.Tests/Thrift.PublicInterfaces.Compile.net6/Thrift.PublicInterfaces.Compile.net6.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<!-- | ||
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. | ||
--> | ||
|
||
<PropertyGroup> | ||
<ThriftVersion>0.21.0</ThriftVersion> | ||
<ThriftVersionOutput>Thrift version $(ThriftVersion)</ThriftVersionOutput> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<LangVersion>latestMajor</LangVersion> | ||
<Version>$(ThriftVersion).0</Version> | ||
<AssemblyName>Thrift.PublicInterfaces.Compile.Tests</AssemblyName> | ||
<PackageId>Thrift.PublicInterfaces.Compile.Tests</PackageId> | ||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> | ||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> | ||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> | ||
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="../../../Thrift/Thrift.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Formats.Asn1" Version="6.0.1" /> | ||
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.4" /> | ||
<PackageReference Include="System.ServiceModel.Primitives" Version="6.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" /> | ||
</ItemGroup> | ||
|
||
<Target Name="PreBuild" BeforeTargets="_GenerateRestoreProjectSpec;Restore;Compile"> | ||
<CreateProperty Condition="'$(OS)' == 'Windows_NT'" Value=".exe"> | ||
<Output TaskParameter="Value" PropertyName="EXECUTABLE_SUFFIX" /> | ||
</CreateProperty> | ||
<!-- Check on the path --> | ||
<Exec Condition="'$(OS)' == 'Windows_NT'" Command="where thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> | ||
</Exec> | ||
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="which thrift" ConsoleToMSBuild="true" IgnoreExitCode="true"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="PathToThrift" /> | ||
</Exec> | ||
<!-- Check in the current directory --> | ||
<CreateProperty Condition="Exists('thrift$(EXECUTABLE_SUFFIX)')" Value="thrift$(EXECUTABLE_SUFFIX)"> | ||
<Output TaskParameter="Value" PropertyName="PathToThrift" /> | ||
</CreateProperty> | ||
<!-- Check for the root projects output --> | ||
<CreateProperty Condition="Exists('$(ProjectDir)/../../../../../compiler/cpp/thrift$(EXECUTABLE_SUFFIX)')" Value="$(ProjectDir)/../../../../../compiler/cpp/thrift$(EXECUTABLE_SUFFIX)"> | ||
<Output TaskParameter="Value" PropertyName="PathToThrift" /> | ||
</CreateProperty> | ||
<Error Condition="!Exists('$(PathToThrift)')" Text="Thrift executable could not be found." /> | ||
<!-- Make sure the thrift version found is the same as the projects version --> | ||
<Exec Command="$(PathToThrift) -version" ConsoleToMSBuild="true"> | ||
<Output TaskParameter="ConsoleOutput" PropertyName="ThriftBinaryVersion" /> | ||
</Exec> | ||
<Error Condition="$('$(ThriftBinaryVersion)'::StartsWith('$(ThriftVersionOutput)')) == true" Text="Thrift version returned: '$(ThriftBinaryVersion)' is not equal to the projects version '$(ThriftVersionOutput)'." /> | ||
<Message Importance="high" Text="Generating tests with thrift binary: '$(PathToThrift)'" /> | ||
<!-- Generate the thrift test files --> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../CassandraTest.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../optional_required_default.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../name_conflicts.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../../../../../test/ThriftTest.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../../../../../contrib/fb303/if/fb303.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5253.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5320.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5382.thrift" /> | ||
<Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ../Thrift5795.thrift" /> | ||
<!-- special options (see ticket) --> | ||
<Exec Command="$(PathToThrift) -gen netstd:net6 -r ../Thrift5794.thrift" /> | ||
</Target> | ||
|
||
</Project> |
70 changes: 70 additions & 0 deletions
70
...nterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.net8/Impl/Thrift5253/MyService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// 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. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Thrift5253; | ||
|
||
namespace Thrift.PublicInterfaces.Compile.Tests.Impl.Thrift5253 | ||
{ | ||
class MyServiceImpl : MyService.IAsync | ||
{ | ||
public Task<AsyncProcessor> AsyncProcessor_(AsyncProcessor? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new AsyncProcessor() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<BrokenResult> Broken(BrokenArgs? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new BrokenResult() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<Client> Client_(Client? input, CancellationToken cancellationToken = default) | ||
{ | ||
_ = cancellationToken; | ||
return Task.FromResult(new Client() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<IAsync> IAsync_(IAsync? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new IAsync() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<InternalStructs> InternalStructs_(InternalStructs? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new InternalStructs() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task TestAsync(CancellationToken cancellationToken = default) | ||
{ | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task TestXsync(CancellationToken cancellationToken = default) | ||
{ | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task<WorksRslt> Works(WorksArrrgs? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new WorksRslt() { Foo = input?.Foo ?? 0 }); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
...cInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.net8/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// 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. | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
|
||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("The Apache Software Foundation")] | ||
[assembly: AssemblyProduct("Thrift")] | ||
[assembly: AssemblyCopyright("The Apache Software Foundation")] | ||
[assembly: AssemblyTrademark("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
|
||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
|
||
[assembly: Guid("1b468b7a-a53b-46de-90da-5f9ad7707ef4")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...rfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.netstd2/Impl/Thrift5253/MyService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// 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. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Thrift5253; | ||
|
||
namespace Thrift.PublicInterfaces.Compile.Tests.Impl.Thrift5253 | ||
{ | ||
class MyServiceImpl : MyService.IAsync | ||
{ | ||
public Task<AsyncProcessor> AsyncProcessor_(AsyncProcessor? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new AsyncProcessor() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<BrokenResult> Broken(BrokenArgs? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new BrokenResult() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<Client> Client_(Client? input, CancellationToken cancellationToken = default) | ||
{ | ||
_ = cancellationToken; | ||
return Task.FromResult(new Client() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<IAsync> IAsync_(IAsync? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new IAsync() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task<InternalStructs> InternalStructs_(InternalStructs? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new InternalStructs() { Foo = input?.Foo ?? 0 }); | ||
} | ||
|
||
public Task TestAsync(CancellationToken cancellationToken = default) | ||
{ | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task TestXsync(CancellationToken cancellationToken = default) | ||
{ | ||
return Task.CompletedTask; | ||
} | ||
|
||
public Task<WorksRslt> Works(WorksArrrgs? input, CancellationToken cancellationToken = default) | ||
{ | ||
return Task.FromResult(new WorksRslt() { Foo = input?.Foo ?? 0 }); | ||
} | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.