Skip to content

Commit 90e40a1

Browse files
committed
chore: update langversion to 14
1 parent de52812 commit 90e40a1

File tree

8 files changed

+29
-7
lines changed

8 files changed

+29
-7
lines changed

build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>

build/BenchmarkDotNet.Build/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ public class InstallWasmToolsWorkload : FrostingTask<BuildContext>, IHelpProvide
8383
{
8484
private const string Name = "install-wasm-tools";
8585

86-
public override void Run(BuildContext context) => context.BuildRunner.InstallWorkload("wasm-tools");
86+
public override void Run(BuildContext context)
87+
{
88+
context.BuildRunner.InstallWorkload("wasm-tools-net8");
89+
context.BuildRunner.InstallWorkload("wasm-tools");
90+
}
8791

8892
public HelpInfo GetHelp()
8993
{

build/common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</PropertyGroup>
4242

4343
<PropertyGroup Condition=" '$(IsVisualBasic)' != 'true' AND '$(IsFsharp)' != 'true' ">
44-
<LangVersion>12.0</LangVersion>
44+
<LangVersion>14.0</LangVersion>
4545
</PropertyGroup>
4646

4747
<PropertyGroup Condition=" '$(VersionPrefix)' == '' ">

build/sdk/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "8.0.410",
3+
"version": "10.0.100",
44
"rollForward": "disable"
55
}
66
}

tests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void BenchmarkCanAllocateMoreThan2Gb()
4747
.Any());
4848

4949
Assert.Contains(".NET Framework", summary.AllRuntimes);
50-
Assert.Contains(".NET 8.0", summary.AllRuntimes);
50+
Assert.Contains(DotNetRuntimeHelper.GetExpectedDotNetCoreRuntimeName(), summary.AllRuntimes);
5151
}
5252
}
5353

tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void SingleBenchmarkCanBeExecutedForMultipleRuntimes()
5151
.Any());
5252

5353
Assert.Contains(".NET Framework", summary.AllRuntimes);
54-
Assert.Contains(".NET 8.0", summary.AllRuntimes);
54+
Assert.Contains(DotNetRuntimeHelper.GetExpectedDotNetCoreRuntimeName(), summary.AllRuntimes);
5555
}
5656
}
5757

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using BenchmarkDotNet.Portability;
2+
using System;
3+
4+
namespace BenchmarkDotNet
5+
{
6+
public static class DotNetRuntimeHelper
7+
{
8+
public static string GetExpectedDotNetCoreRuntimeName()
9+
{
10+
return Environment.GetEnvironmentVariable("DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX") == "2"
11+
? ".NET 10.0"
12+
: ".NET 8.0";
13+
}
14+
}
15+
}

tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ public void CurrentRuntimeIsProperlyRecognized()
120120
else
121121
Assert.True(runtime is MonoRuntime, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
122122
#else
123-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.Net80, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
123+
if (DotNetRuntimeHelper.GetExpectedDotNetCoreRuntimeName() == ".NET 10.0")
124+
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.Net10_0, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
125+
else
126+
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.Net80, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
124127
#endif
125128
}
126129
}

0 commit comments

Comments
 (0)