Skip to content

Commit dc8d626

Browse files
committed
add support for running tests on .NET 10
1 parent b5038f5 commit dc8d626

File tree

13 files changed

+55
-7
lines changed

13 files changed

+55
-7
lines changed

.github/workflows/test-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
os: ${{ inputs.os == '' && 'ubuntu-24.04, ubuntu-22.04, windows-latest, macos-latest' || inputs.os }}
6565
extra_options_common: '/p:TestReleasedPackage=true'
6666
verbose: ${{ inputs.verbose == 'true' }}
67-
dotnet_sdk_version: ${{ inputs.dotnet_sdk_version == '' && '8.0.100' || inputs.dotnet_sdk_version }}
67+
dotnet_sdk_version: ${{ inputs.dotnet_sdk_version == '' && '10.0.100' || inputs.dotnet_sdk_version }}
6868
timeout_minutes_test_job: 10
6969
timeout_hang: "[ {'OS':'windows','Timeout':'6min'}, {'OS':'macos','Timeout':'3min'}, {'OS':'','Timeout':'1min'} ]"
7070
timeout_vstest_connection: "[ {'OS':'windows','Timeout':360}, {'OS':'macos','Timeout':180}, {'OS':'','Timeout':60} ]"

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
project: ${{ inputs.project }}
7373
os: ${{ inputs.os == '' && 'ubuntu-24.04, ubuntu-22.04, windows-latest, macos-latest' || inputs.os }}
7474
verbose: ${{ inputs.verbose == 'true' }}
75-
dotnet_sdk_version: ${{ inputs.dotnet_sdk_version == '' && '8.0.100' || inputs.dotnet_sdk_version }}
75+
dotnet_sdk_version: ${{ inputs.dotnet_sdk_version == '' && '10.0.100' || inputs.dotnet_sdk_version }}
7676
timeout_minutes_test_job: 10
7777
timeout_hang: "[ {'OS':'windows','Timeout':'6min'}, {'OS':'macos','Timeout':'3min'}, {'OS':'','Timeout':'1min'} ]"
7878
timeout_vstest_connection: "[ {'OS':'windows','Timeout':360}, {'OS':'macos','Timeout':180}, {'OS':'','Timeout':60} ]"

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi.Core.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SPDX-License-Identifier: MIT
44
-->
55
<Project Sdk="Microsoft.NET.Sdk">
66
<PropertyGroup>
7+
<TargetFrameworks Condition=" '$(EnableTargetFrameworkDotNet100)' == 'true' ">net10.0;$(TargetFrameworks)</TargetFrameworks>
78
<TargetFrameworks Condition=" '$(EnableTargetFrameworkDotNet80)' == 'true' ">net8.0;$(TargetFrameworks)</TargetFrameworks>
89
<TargetFrameworks Condition=" '$(EnableTargetFrameworkNetFx)' == 'true' ">$(TargetFrameworks)</TargetFrameworks>
910
<NoWarn>CS2002;$(NoWarn)</NoWarn>
@@ -37,10 +38,14 @@ SPDX-License-Identifier: MIT
3738
<MSBuild Projects="@(TestProjects)" Targets="Build" Properties="Configuration=Release;TargetFramework=net8.0" Condition="$(TargetFrameworks.Contains('net8.0'))">
3839
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNet80" />
3940
</MSBuild>
41+
<MSBuild Projects="@(TestProjects)" Targets="Build" Properties="Configuration=Release;TargetFramework=net10.0" Condition="$(TargetFrameworks.Contains('net10.0'))">
42+
<Output TaskParameter="TargetOutputs" ItemName="TestAssembliesNet100" />
43+
</MSBuild>
4044

4145
<ItemGroup>
4246
<TestAssemblies Include="@(TestAssembliesNetStandard21)" />
4347
<TestAssemblies Include="@(TestAssembliesNet80)" />
48+
<TestAssemblies Include="@(TestAssembliesNet100)" />
4449
</ItemGroup>
4550

4651
<PropertyGroup>

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/ApiListWriter.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,15 @@ string[] ExpectedReferencedAssemblies
562562
}
563563
);
564564
#endif
565+
#if NET10_0_OR_GREATER
566+
yield return (
567+
"Lib",
568+
"net10.0",
569+
new[] {
570+
"System.Runtime, Version=10.0.",
571+
}
572+
);
573+
#endif
565574
#if NETCOREAPP3_1_OR_GREATER || NET8_0_OR_GREATER
566575
yield return (
567576
"LibB",
@@ -591,6 +600,17 @@ string[] ExpectedReferencedAssemblies
591600
"System.Xml.ReaderWriter, Version=8.0.",
592601
}
593602
);
603+
#endif
604+
#if NET10_0_OR_GREATER
605+
yield return (
606+
"LibReferencedAssemblies1",
607+
"net10.0",
608+
new[] {
609+
"System.Runtime, Version=10.0.",
610+
"System.Threading, Version=10.0.",
611+
"System.Xml.ReaderWriter, Version=10.0.",
612+
}
613+
);
594614
#endif
595615
}
596616

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/AssemblyLoader.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ [Values] bool loadIntoReflectionOnlyContext
9595
#if NET8_0_OR_GREATER
9696
[TestCase(true, "net8.0")]
9797
[TestCase(false, "net8.0")]
98+
#endif
99+
#if NET10_0_OR_GREATER
100+
[TestCase(true, "net10.0")]
101+
[TestCase(false, "net10.0")]
98102
#endif
99103
public void UsingAssembly(bool loadIntoReflectionOnlyContext, string targetFrameworkMoniker)
100104
{
@@ -200,6 +204,10 @@ public void UsingAssembly_ArgumentNull_ActionWithLoadedAssembly(bool loadIntoRef
200204
#if NET8_0_OR_GREATER
201205
[TestCase(true, "net8.0")]
202206
[TestCase(false, "net8.0")]
207+
#endif
208+
#if NET10_0_OR_GREATER
209+
[TestCase(true, "net10.0")]
210+
[TestCase(false, "net10.0")]
203211
#endif
204212
public void UsingAssembly_FromStream(bool loadIntoReflectionOnlyContext, string targetFrameworkMoniker)
205213
{
@@ -261,6 +269,10 @@ public void UsingAssembly_FromStream(bool loadIntoReflectionOnlyContext, string
261269
#if NET8_0_OR_GREATER
262270
[TestCase(true, "net8.0")]
263271
[TestCase(false, "net8.0")]
272+
#endif
273+
#if NET10_0_OR_GREATER
274+
[TestCase(true, "net10.0")]
275+
[TestCase(false, "net10.0")]
264276
#endif
265277
public void UsingAssembly_ResolveDependency_ProjectReference(bool loadIntoReflectionOnlyContext, string targetFrameworkMoniker)
266278
{
@@ -318,6 +330,10 @@ public void UsingAssembly_ResolveDependency_ProjectReference(bool loadIntoReflec
318330
#if NET8_0_OR_GREATER
319331
[TestCase(true, "net8.0")]
320332
[TestCase(false, "net8.0")]
333+
#endif
334+
#if NET10_0_OR_GREATER
335+
[TestCase(true, "net10.0")]
336+
[TestCase(false, "net10.0")]
321337
#endif
322338
public void UsingAssembly_FromStream_ResolveDependency_ProjectReference(bool loadIntoReflectionOnlyContext, string targetFrameworkMoniker)
323339
{
@@ -379,6 +395,10 @@ public void UsingAssembly_FromStream_ResolveDependency_ProjectReference(bool loa
379395
#if NET8_0_OR_GREATER
380396
[TestCase(true, "net8.0")]
381397
[TestCase(false, "net8.0")]
398+
#endif
399+
#if NET10_0_OR_GREATER
400+
[TestCase(true, "net10.0")]
401+
[TestCase(false, "net10.0")]
382402
#endif
383403
public void UsingAssembly_ResolveDependency_PackageReference(bool loadIntoReflectionOnlyContext, string targetFrameworkMoniker)
384404
{

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/FrameworkMonikers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Smdn.Reflection.ReverseGenerating.ListApi;
88

99
[TestFixture]
1010
class FrameworkMonikersTests {
11-
// TODO: .NET 10 / net10.0(?)
11+
[TestCase(".NETCoreApp,Version=v10.0", "net10.0")]
1212
[TestCase(".NETCoreApp,Version=v9.0", "net9.0")]
1313
[TestCase(".NETCoreApp,Version=v8.0", "net8.0")]
1414
[TestCase(".NETCoreApp,Version=v7.0", "net7.0")]

tests/Smdn.Reflection.ReverseGenerating.ListApi/Smdn.Reflection.ReverseGenerating.ListApi.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SPDX-License-Identifier: MIT
44
-->
55
<Project Sdk="Microsoft.NET.Sdk">
66
<PropertyGroup>
7+
<TargetFrameworks Condition=" '$(EnableTargetFrameworkDotNet100)' == 'true' ">net10.0;$(TargetFrameworks)</TargetFrameworks>
78
<TargetFrameworks Condition=" '$(EnableTargetFrameworkDotNet80)' == 'true' ">net8.0;$(TargetFrameworks)</TargetFrameworks>
89
<TargetFrameworks Condition=" '$(EnableTargetFrameworkNetFx)' == 'true' ">$(TargetFrameworks)<!-- ;net472 --></TargetFrameworks>
910
<NoWarn>CS2002;$(NoWarn)</NoWarn>

tests/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ SPDX-License-Identifier: MIT
44
-->
55
<Project Sdk="Microsoft.NET.Sdk">
66
<PropertyGroup>
7+
<TargetFrameworks Condition=" '$(EnableTargetFrameworkDotNet100)' == 'true' ">net10.0;$(TargetFrameworks)</TargetFrameworks>
78
<TargetFrameworks Condition=" '$(EnableTargetFrameworkDotNet80)' == 'true' ">net8.0;$(TargetFrameworks)</TargetFrameworks>
89
<TargetFrameworks Condition=" '$(EnableTargetFrameworkNetFx)' == 'true' ">$(TargetFrameworks);net47</TargetFrameworks>
910
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

tests/TargetFrameworks.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SPDX-License-Identifier: MIT
66
<PropertyGroup>
77
<!-- enable target framework net* (.NET >= 5.0) by default -->
88
<EnableTargetFrameworkDotNet>true</EnableTargetFrameworkDotNet>
9+
<EnableTargetFrameworkDotNet100>true</EnableTargetFrameworkDotNet100>
910
<EnableTargetFrameworkDotNet80>true</EnableTargetFrameworkDotNet80>
1011
<!-- enable target framework net* (.NET Framework/Mono) by default -->
1112
<EnableTargetFrameworkNetFx>true</EnableTargetFrameworkNetFx>

tests/test-assm/LibA/LibA.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>
3+
<TargetFrameworks>net10.0;net8.0;netstandard2.1</TargetFrameworks>
44
</PropertyGroup>
55
</Project>

0 commit comments

Comments
 (0)