Skip to content

Commit 00e91b7

Browse files
committed
Add message to failing CI test.
1 parent e22c7d4 commit 00e91b7

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

tests/BenchmarkDotNet.Tests/RuntimeVersionDetectionTests.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,11 @@ public void CurrentRuntimeIsProperlyRecognized()
116116

117117
#if NETFRAMEWORK
118118
if (OsDetector.IsWindows())
119-
Assert.True(runtime is ClrRuntime);
119+
Assert.True(runtime is ClrRuntime, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
120120
else
121-
Assert.True(runtime is MonoRuntime);
122-
#elif NETCOREAPP2_1
123-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.NetCoreApp21);
124-
#elif NETCOREAPP2_2
125-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.NetCoreApp22);
126-
#elif NETCOREAPP3_0
127-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.NetCoreApp30);
128-
#elif NETCOREAPP3_1
129-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.NetCoreApp31);
130-
#elif NETCOREAPP5_0
131-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.NetCoreApp50);
132-
#elif NET8_0
133-
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.Net80);
121+
Assert.True(runtime is MonoRuntime, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
122+
#else
123+
Assert.True(runtime is CoreRuntime coreRuntime && coreRuntime.RuntimeMoniker == RuntimeMoniker.Net80, $"Actual runtime: {runtime}, tfm: {runtime.MsBuildMoniker}, moniker: {runtime.RuntimeMoniker}");
134124
#endif
135125
}
136126
}

0 commit comments

Comments
 (0)