From 56464295f9890a4e924e6344f75d2d18496c0a7d Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Sat, 7 Mar 2026 16:43:10 +0900
Subject: [PATCH 01/49] chore: update xunit related package version to v3 with
mtp v2
---
.../Runners/UnitTestRunner.cs | 11 ++++++++++-
.../BenchmarkDotNet.Analyzers.Tests.csproj | 15 ++++++---------
.../Fixtures/Serializable/ValueTupleDouble.cs | 2 --
.../Fixtures/Serializable/ValueTupleTriple.cs | 4 +---
...nchmarkDotNet.Exporters.Plotting.Tests.csproj | 9 ++-------
.../ScottPlotExporterTests.cs | 3 +++
...Net.IntegrationTests.ConfigPerAssembly.csproj | 2 +-
...IntegrationTests.DisabledOptimizations.csproj | 4 ++--
....IntegrationTests.EnabledOptimizations.csproj | 4 ++--
...Tests.ManualRunning.MultipleFrameworks.csproj | 12 ++++--------
...kDotNet.IntegrationTests.ManualRunning.csproj | 10 ++--------
.../DotMemoryTests.cs | 1 +
.../DotTraceTests.cs | 1 +
.../MsBuildArgumentTests.cs | 1 +
.../AsyncBenchmarksTests.cs | 4 ----
.../BenchmarkDotNet.IntegrationTests.csproj | 15 ++++++---------
.../CopyToOutputTests.cs | 1 +
.../CustomBuildConfigurationTests.cs | 4 +---
.../GcModeTests.cs | 3 ++-
.../InProcessTest.cs | 1 -
.../MemoryDiagnoserTests.cs | 0
.../ReferencesTests.cs | 1 -
.../Shared/BenchmarkTestExecutor.cs | 1 +
.../TailCallDiagnoserTests.cs | 1 +
.../WasmTests.cs | 2 +-
.../BenchmarkDotNet.Tests.csproj | 16 ++++------------
.../Detectors/Cpu/CpuInfoParserTests_Cim.cs | 6 +++---
.../Detectors/Cpu/LinuxCpuInfoParserTests.cs | 2 +-
.../Shared/Loggers/OutputLogger.cs | 1 +
.../Shared/XUnit/InlineDataEnvSpecific.cs | 1 +
.../XUnit/InlineDataEnvSpecificDiscoverer.cs | 1 +
tests/Directory.Build.props | 4 ++++
32 files changed, 64 insertions(+), 79 deletions(-)
mode change 100755 => 100644 tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj
mode change 100755 => 100644 tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
mode change 100755 => 100644 tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
diff --git a/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs b/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs
index ab3833d129..f06f9b3132 100644
--- a/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs
+++ b/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs
@@ -44,7 +44,16 @@ private DotNetTestSettings GetTestSettingsParameters(FilePath logFile, string tf
EnvironmentVariables =
{
["Platform"] = "" // force the tool to not look for the .dll in platform-specific directory
- }
+ },
+ PathType = DotNetTestPathType.Auto,
+ ArgumentCustomization = args
+ => args.Append("--report-xunit-trx")
+ .AppendSwitchQuoted("--report-xunit-trx-filename", System.IO.Path.GetFileName(logFile.FullPath))
+ .Append("--no-ansi")
+ .AppendSwitch("--output", "Detailed")
+ .AppendSwitch("--show-stdout", "Failed")
+ .Append("--diagnostic")
+ .AppendSwitch("--diagnostic-verbosity", "Trace")
};
return settings;
}
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj b/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj
index 91297cfd14..725fa7ff05 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj
@@ -2,6 +2,7 @@
false
+ Exe
BenchmarkDotNet.Analyzers.Tests
net472;net10.0
true
@@ -12,7 +13,6 @@
-
@@ -21,13 +21,10 @@
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
+
+
@@ -36,4 +33,4 @@
-
\ No newline at end of file
+
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs
index 5642d4c615..4802092df4 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs
@@ -1,5 +1,3 @@
-using Xunit.Abstractions;
-
namespace BenchmarkDotNet.Analyzers.Tests.Fixtures;
public class ValueTupleDouble : IXunitSerializable
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs
index 0b19f5c211..7bc8fe044c 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs
@@ -1,5 +1,3 @@
-using Xunit.Abstractions;
-
namespace BenchmarkDotNet.Analyzers.Tests.Fixtures;
public class ValueTupleTriple : IXunitSerializable
@@ -29,4 +27,4 @@ public static implicit operator ValueTupleTriple((T1, T2, T3) valueT
public override string ToString()
=> Value1 == null || Value2 == null || Value3 == null ? "" : $"{Value1} · {Value2} · {Value3}";
-}
\ No newline at end of file
+}
diff --git a/tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj b/tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj
index d18c1d327c..14ff835dae 100644
--- a/tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj
+++ b/tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj
@@ -2,12 +2,12 @@
net10.0;net472
+ Exe
true
false
-
@@ -15,12 +15,7 @@
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/tests/BenchmarkDotNet.Exporters.Plotting.Tests/ScottPlotExporterTests.cs b/tests/BenchmarkDotNet.Exporters.Plotting.Tests/ScottPlotExporterTests.cs
index bb481d3ea8..1d5118dc69 100644
--- a/tests/BenchmarkDotNet.Exporters.Plotting.Tests/ScottPlotExporterTests.cs
+++ b/tests/BenchmarkDotNet.Exporters.Plotting.Tests/ScottPlotExporterTests.cs
@@ -3,6 +3,9 @@
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Tests.Mocks;
using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+using Xunit;
namespace BenchmarkDotNet.Exporters.Plotting.Tests
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj b/tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj
index 24ce7ba476..462d92aa72 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj
@@ -2,7 +2,7 @@
BenchmarkDotNet.IntegrationTests.ConfigPerAssembly
- net472;net10.0
+ net472;net8.0;net10.0
true
BenchmarkDotNet.IntegrationTests.ConfigPerAssembly
BenchmarkDotNet.IntegrationTests.ConfigPerAssembly
diff --git a/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj b/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj
index 55839c1d79..9ad2394109 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj
@@ -2,14 +2,14 @@
BenchmarkDotNet.IntegrationTests.DisabledOptimizations
- net472;net10.0
+ net472;net8.0;net10.0
true
BenchmarkDotNet.IntegrationTests.DisabledOptimizations
BenchmarkDotNet.IntegrationTests.DisabledOptimizations
true
false
AnyCPU
-
+
false
diff --git a/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj b/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj
index f237f23791..cd2db5690c 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj
@@ -2,14 +2,14 @@
BenchmarkDotNet.IntegrationTests.EnabledOptimizations
- net472;net10.0
+ net472;net8.0;net10.0
true
BenchmarkDotNet.IntegrationTests.EnabledOptimizations
BenchmarkDotNet.IntegrationTests.EnabledOptimizations
true
false
AnyCPU
-
+
true
diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj
index 96d84f4943..1378b38bb9 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj
@@ -1,8 +1,9 @@
-
+
BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks
net462;net48;net8.0;net10.0
+ Exe
$(MSBuildWarningsAsMessages);MSB3277
false
@@ -17,7 +18,6 @@
-
@@ -34,12 +34,8 @@
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj
old mode 100755
new mode 100644
index 72dd42c0f4..db77746136
--- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj
@@ -14,7 +14,6 @@
-
@@ -24,7 +23,7 @@
$(DefineConstants);$(ExtraDefineConstants)
-
+
@@ -43,12 +42,7 @@
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotMemoryTests.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotMemoryTests.cs
index efb02f0aea..0020481687 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotMemoryTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotMemoryTests.cs
@@ -5,6 +5,7 @@
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Portability;
using BenchmarkDotNet.Toolchains.InProcess.Emit;
+using Xunit;
namespace BenchmarkDotNet.IntegrationTests.ManualRunning
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs
index dc11404f9f..4a240100c4 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs
@@ -5,6 +5,7 @@
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Portability;
using BenchmarkDotNet.Toolchains.InProcess.Emit;
+using Xunit;
namespace BenchmarkDotNet.IntegrationTests.ManualRunning
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs
index 6592e76047..434af9df6c 100644
--- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs
@@ -2,6 +2,7 @@
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Environments;
using BenchmarkDotNet.Jobs;
+using Xunit;
namespace BenchmarkDotNet.IntegrationTests.ManualRunning
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs b/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs
index 63ccd02838..b41110a1af 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs
@@ -1,8 +1,4 @@
using BenchmarkDotNet.Attributes;
-using BenchmarkDotNet.Jobs;
-using BenchmarkDotNet.Toolchains;
-using BenchmarkDotNet.Toolchains.InProcess.Emit;
-using BenchmarkDotNet.Toolchains.InProcess.NoEmit;
using System.Threading.Tasks.Sources;
namespace BenchmarkDotNet.IntegrationTests
diff --git a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
index 9fde386d87..7ad4db9121 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
@@ -4,6 +4,7 @@
BenchmarkDotNet.IntegrationTests
net10.0
$(TargetFrameworks);net472
+ Exe
true
BenchmarkDotNet.IntegrationTests
BenchmarkDotNet.IntegrationTests
@@ -20,7 +21,6 @@
-
@@ -35,6 +35,8 @@
+
+
@@ -43,18 +45,13 @@
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
+
diff --git a/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs
index bd8da25d01..3d88695806 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs
@@ -1,5 +1,6 @@
#if NETFRAMEWORK
using BenchmarkDotNet.IntegrationTests.CustomPaths;
+using Xunit;
namespace BenchmarkDotNet.IntegrationTests
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs
index a08fb99903..e165df196b 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs
@@ -1,12 +1,10 @@
-using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Extensions;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Portability;
using BenchmarkDotNet.Tests.XUnit;
-#if !DEBUG
-#endif
+using System.Reflection;
namespace BenchmarkDotNet.IntegrationTests
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs b/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs
index 8d2558ebe3..ccd5f365fe 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs
@@ -1,7 +1,8 @@
-using System.Runtime;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Jobs;
+using System.Runtime;
+
#if NETFRAMEWORK
using BenchmarkDotNet.Environments;
#endif
diff --git a/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs b/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs
index d0cd8ecaed..69a73294b5 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs
@@ -17,7 +17,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
-
namespace BenchmarkDotNet.IntegrationTests
{
public class InProcessTest : BenchmarkTestExecutor
diff --git a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
old mode 100755
new mode 100644
diff --git a/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs
index 9daa2db80a..3adec4f6cb 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs
@@ -1,4 +1,3 @@
-
namespace BenchmarkDotNet.IntegrationTests
{
public class ReferencesTests : BenchmarkTestExecutor
diff --git a/tests/BenchmarkDotNet.IntegrationTests/Shared/BenchmarkTestExecutor.cs b/tests/BenchmarkDotNet.IntegrationTests/Shared/BenchmarkTestExecutor.cs
index e3413c5e4a..795127c130 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/Shared/BenchmarkTestExecutor.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/Shared/BenchmarkTestExecutor.cs
@@ -6,6 +6,7 @@
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Tests.Loggers;
+using Xunit;
namespace BenchmarkDotNet.IntegrationTests
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs
index c224cbd47f..8d34d90724 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs
@@ -11,6 +11,7 @@
using BenchmarkDotNet.Tests.XUnit;
using System.Collections.Generic;
using System.Linq;
+using Xunit;
namespace BenchmarkDotNet.IntegrationTests
{
diff --git a/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs b/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs
index 78ff33566f..a3b63bbe83 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs
@@ -91,4 +91,4 @@ private ManualConfig GetConfig(string runtimeMoniker, string javaScriptEngine, F
.WithOption(ConfigOptions.GenerateMSBuildBinLog, false);
}
}
-}
+}
\ No newline at end of file
diff --git a/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj b/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
old mode 100755
new mode 100644
index 40240b4ec5..5fd5275d39
--- a/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
+++ b/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
@@ -2,7 +2,8 @@
BenchmarkDotNet.Tests
- net10.0;net472
+ net8.0;net10.0;net472
+ Exe
BenchmarkDotNet.Tests
BenchmarkDotNet.Tests
true
@@ -11,7 +12,6 @@
-
@@ -21,13 +21,8 @@
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
@@ -36,9 +31,6 @@
-
-
-
diff --git a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/CpuInfoParserTests_Cim.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/CpuInfoParserTests_Cim.cs
index 1b6a6ada95..1e6ed0d7bc 100644
--- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/CpuInfoParserTests_Cim.cs
+++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/CpuInfoParserTests_Cim.cs
@@ -34,13 +34,13 @@ public void RealTwoProcessorEightCoresTest()
Name:Intel(R) Xeon(R) CPU E5-2630 v3
NumberOfCores:8
NumberOfLogicalProcessors:16
-
-
+
+
MaxClockSpeed:2400
Name:Intel(R) Xeon(R) CPU E5-2630 v3
NumberOfCores:8
NumberOfLogicalProcessors:16
-
+
""";
CpuInfo? actual = CpuInfoParser.ParseCimOutput(cpuInfo);
diff --git a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs
index 393bd2798b..e907ffa9aa 100644
--- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs
+++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs
@@ -138,7 +138,7 @@ public void AmdRyzen9_7950X()
CPU max MHz: 5881.0000
CPU min MHz: 400.0000
BogoMIPS: 8983.23
- Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl
+ Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl
pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb
bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512
cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local user_shstk avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean
diff --git a/tests/BenchmarkDotNet.Tests/Shared/Loggers/OutputLogger.cs b/tests/BenchmarkDotNet.Tests/Shared/Loggers/OutputLogger.cs
index 2a83781f14..e9020d6e24 100644
--- a/tests/BenchmarkDotNet.Tests/Shared/Loggers/OutputLogger.cs
+++ b/tests/BenchmarkDotNet.Tests/Shared/Loggers/OutputLogger.cs
@@ -1,5 +1,6 @@
using BenchmarkDotNet.Loggers;
using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarkDotNet.Tests.Loggers
{
diff --git a/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs
index 65acf07295..79a720b6b1 100644
--- a/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs
+++ b/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs
@@ -1,5 +1,6 @@
using System.Reflection;
using Xunit.Sdk;
+using Xunit.v3;
namespace BenchmarkDotNet.Tests.XUnit;
diff --git a/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecificDiscoverer.cs b/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecificDiscoverer.cs
index dba7caa4c2..a9a73f20a3 100644
--- a/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecificDiscoverer.cs
+++ b/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecificDiscoverer.cs
@@ -1,3 +1,4 @@
+using Xunit;
using Xunit.Sdk;
namespace BenchmarkDotNet.Tests.XUnit;
diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props
index 5ae2fbba84..f884b70545 100644
--- a/tests/Directory.Build.props
+++ b/tests/Directory.Build.props
@@ -10,6 +10,10 @@
$([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory)))
+
+ true
+
+
From a0bcd8222f1ae7ccc5ea226c05bcf626a5f77597 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Sat, 7 Mar 2026 16:58:34 +0900
Subject: [PATCH 02/49] chore: add using Xunit.Sdk statement for
XunitSerializable
---
.../Fixtures/Serializable/ValueTupleDouble.cs | 2 ++
.../Fixtures/Serializable/ValueTupleTriple.cs | 2 ++
2 files changed, 4 insertions(+)
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs
index 4802092df4..56819e9cf2 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs
@@ -1,3 +1,5 @@
+using Xunit.Sdk;
+
namespace BenchmarkDotNet.Analyzers.Tests.Fixtures;
public class ValueTupleDouble : IXunitSerializable
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs
index 7bc8fe044c..82b871d3a3 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs
@@ -1,3 +1,5 @@
+using Xunit.Sdk;
+
namespace BenchmarkDotNet.Analyzers.Tests.Fixtures;
public class ValueTupleTriple : IXunitSerializable
From 7169a3fddd24c33b217979b1a1c837a1b9030ea3 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Sat, 7 Mar 2026 16:59:12 +0900
Subject: [PATCH 03/49] chore: fix xUnit3003 analyzer errors
---
.../BenchmarkDotNet.Tests/Shared/XUnit/FactEnvSpecific.cs | 7 +++++++
.../Shared/XUnit/TheoryEnvSpecific.cs | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/tests/BenchmarkDotNet.Tests/Shared/XUnit/FactEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/Shared/XUnit/FactEnvSpecific.cs
index 6c57f08078..a0e02d4c07 100644
--- a/tests/BenchmarkDotNet.Tests/Shared/XUnit/FactEnvSpecific.cs
+++ b/tests/BenchmarkDotNet.Tests/Shared/XUnit/FactEnvSpecific.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarkDotNet.Tests.XUnit;
@@ -14,4 +16,9 @@ public FactEnvSpecificAttribute(string reason, params EnvRequirement[] requireme
if (skip != null)
Skip = $"{skip} ({reason})";
}
+
+ public FactEnvSpecificAttribute([CallerFilePath] string? sourceFilePath = null, [CallerLineNumber] int sourceLineNumber = -1)
+ : base(sourceFilePath, sourceLineNumber)
+ {
+ }
}
\ No newline at end of file
diff --git a/tests/BenchmarkDotNet.Tests/Shared/XUnit/TheoryEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/Shared/XUnit/TheoryEnvSpecific.cs
index 3303797884..92f039f030 100644
--- a/tests/BenchmarkDotNet.Tests/Shared/XUnit/TheoryEnvSpecific.cs
+++ b/tests/BenchmarkDotNet.Tests/Shared/XUnit/TheoryEnvSpecific.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+using Xunit;
namespace BenchmarkDotNet.Tests.XUnit;
@@ -14,4 +16,9 @@ public TheoryEnvSpecificAttribute(string reason, params EnvRequirement[] require
if (skip != null)
Skip = $"{skip} ({reason})";
}
+
+ public TheoryEnvSpecificAttribute([CallerFilePath] string? sourceFilePath = null, [CallerLineNumber] int sourceLineNumber = -1)
+ : base(sourceFilePath, sourceLineNumber)
+ {
+ }
}
\ No newline at end of file
From 5c2e7f4a3514f01105d32d4cd1dbd96ec66dec39 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Sat, 7 Mar 2026 17:50:12 +0900
Subject: [PATCH 04/49] chore: modify theorydata related incompatible codes
---
.../ArgumentsAttributeAnalyzerTests.cs | 4 +-
...GeneralParameterAttributesAnalyzerTests.cs | 44 +++++++++----------
.../ParamsAllValuesAttributeAnalyzerTests.cs | 12 ++---
.../ParamsAttributeAnalyzerTests.cs | 38 +++++++---------
.../BenchmarkRunner/RunAnalyzerTests.cs | 4 +-
.../Extensions/TheoryDataExtensions.cs | 2 +-
.../AsyncBenchmarksTests.cs | 4 ++
.../AsyncEnumerableBenchmarksTests.cs | 8 ++--
.../CallerThreadTests.cs | 4 +-
.../EngineTests.cs | 4 +-
.../RunAsyncTests.cs | 4 +-
11 files changed, 57 insertions(+), 71 deletions(-)
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs
index 7cad72b679..f4a937bc62 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs
@@ -633,7 +633,7 @@ public async Task Providing_expected_value_type_should_not_trigger_diagnostic(
{
var testCode = /* lang=c#-test */ $$"""
using DifferentNamespace;
-
+
using BenchmarkDotNet.Attributes;
public class BenchmarkClass
@@ -1188,7 +1188,7 @@ public void BenchmarkMethod({{integerValueAndType.Value2}} a)
}
public static IEnumerable DummyAttributeUsage
- => DummyAttributeUsageTheoryData;
+ => DummyAttributeUsageTheoryData.Select(x => x.Data);
public static TheoryData EmptyArgumentsAttributeUsagesWithMismatchingValueCount()
{
diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs
index fc7455faa8..fd544e0731 100644
--- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs
+++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs
@@ -1,4 +1,4 @@
-using BenchmarkDotNet.Analyzers;
+using BenchmarkDotNet.Analyzers;
using BenchmarkDotNet.Analyzers.Attributes;
using BenchmarkDotNet.Analyzers.Tests.Fixtures;
using Microsoft.CodeAnalysis;
@@ -191,7 +191,7 @@ public class BenchmarkClass
}
public static TheoryData UniqueParameterAttributeUsages
- => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
+ => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];
public static TheoryData DuplicateSameParameterAttributeUsages
=> DuplicateSameAttributeUsagesTheoryData;
@@ -353,7 +353,7 @@ public class BenchmarkClass
await RunAsync();
}
- public static TheoryData UniqueParameterAttributeUsages => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)];
+ public static TheoryData UniqueParameterAttributeUsages => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)];
public static TheoryData DuplicateSameParameterAttributeUsages => DuplicateSameAttributeUsagesTheoryData;
@@ -512,21 +512,19 @@ public static IEnumerable
-
+
diff --git a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
index 7ad4db9121..4994ec88aa 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
@@ -46,11 +46,11 @@
-
+
-
+
diff --git a/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj b/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
index 5fd5275d39..359afca60f 100644
--- a/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
+++ b/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj
@@ -20,9 +20,9 @@
-
-
-
+
+
+
From 6f70fcd9bbdebc702eb49a1189ea4afd3522606c Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Wed, 2 Sep 2026 20:57:49 +0900
Subject: [PATCH 43/49] chore: add System.Configuration reference for .NET
Framework
---
.../BenchmarkDotNet.IntegrationTests.csproj | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
index 4994ec88aa..68d24f764c 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
+++ b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj
@@ -58,6 +58,7 @@
+
From dc21f3c444faff5041323e8cccc1a448525c78f1 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Wed, 16 Sep 2026 08:09:06 +0900
Subject: [PATCH 44/49] chore: skip flaky memorydiagnoser tests on
win-arm64-netfx
---
.../MemoryDiagnoserTests.cs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
index 517f8376a7..ab9b2675a2 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
@@ -188,7 +188,15 @@ public ulong TimeConsuming()
public void TieredJitShouldNotInterfereAllocationResults(IToolchain toolchain)
{
if (toolchain.IsInProcess)
+ {
+ // Extra allocation (256 bytes) wheb running on Windows(arm64) + .NET Framework
+ if (OsDetector.IsWindows()
+ && RuntimeInformation.ProcessArchitecture == Architecture.Arm64
+ && Portability.RuntimeInformation.IsFullFramework)
+ Assert.Skip("Flaky test on Windows(arm64) + .NET Framework");
+
ValidateMtpProgressDisabled();
+ }
AssertAllocations(toolchain, typeof(TimeConsumingBenchmark), new Dictionary
{
From 5cd13edf928a99d1542feb27636284bc7df28f9e Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Wed, 16 Sep 2026 10:20:29 +0900
Subject: [PATCH 45/49] chore: cleanup memorydiagnoser tests skip conditions
---
.../MemoryDiagnoserTests.cs | 66 ++++---------------
1 file changed, 13 insertions(+), 53 deletions(-)
diff --git a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
index ab9b2675a2..e7ac27434f 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
@@ -1,4 +1,3 @@
-using BenchmarkDotNet.Analysers;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
@@ -6,12 +5,9 @@
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Engines;
using BenchmarkDotNet.Environments;
-using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Extensions;
using BenchmarkDotNet.IntegrationTests.Xunit;
using BenchmarkDotNet.Jobs;
-using BenchmarkDotNet.Loggers;
-using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Tests.Loggers;
using BenchmarkDotNet.Tests.XUnit;
@@ -20,10 +16,8 @@
using BenchmarkDotNet.Toolchains.Mono;
using BenchmarkDotNet.Toolchains.Wasm;
using BenchmarkDotNet.Toolchains.NativeAot;
-using BenchmarkDotNet.Validators;
using System.Reflection;
using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
namespace BenchmarkDotNet.IntegrationTests
{
@@ -35,7 +29,19 @@ public class MemoryDiagnoserTests
public static IEnumerable GetToolchains()
{
- yield return [InProcessEmitToolchain.Default];
+ if (OsDetector.IsWindows() && Portability.RuntimeInformation.IsFullFramework)
+ {
+ // Skip InProcessEmitToolchain tests on Windows +.NET Framework environment.
+ // Because when running tests with xunit v3, memory allocation tests are flaky.
+ // See following issues.
+ // https://github.com/dotnet/BenchmarkDotNet/issues/2779
+ // https://github.com/dotnet/BenchmarkDotNet/pull/3065#issuecomment-5064984074
+ // https://github.com/dotnet/BenchmarkDotNet/issues/3203
+ }
+ else
+ {
+ yield return [InProcessEmitToolchain.Default];
+ }
if (ContinuousIntegration.IsGitHubDraftPR())
yield break;
@@ -187,42 +193,11 @@ public ulong TimeConsuming()
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void TieredJitShouldNotInterfereAllocationResults(IToolchain toolchain)
{
- if (toolchain.IsInProcess)
- {
- // Extra allocation (256 bytes) wheb running on Windows(arm64) + .NET Framework
- if (OsDetector.IsWindows()
- && RuntimeInformation.ProcessArchitecture == Architecture.Arm64
- && Portability.RuntimeInformation.IsFullFramework)
- Assert.Skip("Flaky test on Windows(arm64) + .NET Framework");
-
- ValidateMtpProgressDisabled();
- }
-
AssertAllocations(toolchain, typeof(TimeConsumingBenchmark), new Dictionary
{
{ nameof(TimeConsumingBenchmark.TimeConsuming), 0 }
},
iterationCount: 10); // 1 iteration is not enough to repro the problem
-
- static void ValidateMtpProgressDisabled()
- {
- if (!OsDetector.IsWindows() || RuntimeInformation.OSArchitecture != Architecture.Arm64)
- return;
-
- // On Windows(arm64) environment following test failed with extra memory allocations (1 or 2 bytes)
- // TieredJitShouldNotInterfereAllocationResults
- var args = Environment.GetCommandLineArgs();
- for (int i = 0; i < args.Length; i++)
- {
- if (args[i] == "--progress=off")
- return;
-
- if (i < args.Length - 1 && args[i] == "--progress" && args[i + 1] == "off")
- return;
- }
-
- throw new NotSupportedException("Measure memory allocation requires setting `--progress off`");
- }
}
public class NoBoxing
@@ -235,12 +210,6 @@ public class NoBoxing
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void EngineShouldNotIntroduceBoxing(IToolchain toolchain)
{
- if (toolchain.IsInProcess && OsDetector.IsWindows() && !Portability.RuntimeInformation.IsNetCore)
- {
- // Randomly failed on Windows(x64)+.NET Framework.
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/pull/3065#issuecomment-5064984074");
- }
-
AssertAllocations(toolchain, typeof(NoBoxing), new Dictionary
{
{ nameof(NoBoxing.ReturnsValueType), 0 }
@@ -263,12 +232,6 @@ public class NonAllocatingAsynchronousBenchmarks
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void AwaitingTasksShouldNotInterfereAllocationResults(IToolchain toolchain)
{
- if (toolchain.IsInProcess && OsDetector.IsWindows() && !Portability.RuntimeInformation.IsNetCore)
- {
- // Randomly failed on Windows(x64/arm64)+.NET Framework.
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/issues/3203");
- }
-
AssertAllocations(toolchain, typeof(NonAllocatingAsynchronousBenchmarks), new Dictionary
{
{ nameof(NonAllocatingAsynchronousBenchmarks.CompletedTask), 0 },
@@ -322,9 +285,6 @@ public byte[] SixtyFourBytesArray()
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void AllocationQuantumIsNotAnIssueForNetCore21Plus(IToolchain toolchain)
{
- if (OsDetector.IsWindows() && toolchain.IsInProcess)
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/issues/2779");
-
long objectAllocationOverhead = IntPtr.Size * 2; // pointer to method table + object header word
long arraySizeOverhead = IntPtr.Size; // array length
AssertAllocations(toolchain, typeof(TimeConsuming), new Dictionary
From 74e5e7c8a538b14f016cffdfebd3fe21315a0f38 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Tue, 22 Sep 2026 19:53:17 +0900
Subject: [PATCH 46/49] chore: enable some disassembler diagnoser tests on
macos
---
.github/workflows/generate-coverage-report.yaml | 6 ++++++
.github/workflows/run-tests-selected.yaml | 6 ++++++
.github/workflows/run-tests.yaml | 4 ++++
.../DisassemblyDiagnoserTests.cs | 12 ------------
4 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/generate-coverage-report.yaml b/.github/workflows/generate-coverage-report.yaml
index 40a43ea345..01b509b9c4 100644
--- a/.github/workflows/generate-coverage-report.yaml
+++ b/.github/workflows/generate-coverage-report.yaml
@@ -37,6 +37,12 @@ jobs:
- name: Setup additional tools for Wasm/NativeAot tests
if: ${{ github.event.inputs.skip_integration_tests == 'false'}}
uses: ./.github/actions/setup-additional-tools
+
+ # createdump's task_for_pid makes authd evaluate system.privilege.taskport, which prompts for a password on these
+ # headless runners and blocks forever; pre-authorizing it lets in-process disassembly dump its own process.
+ - name: Allow task_for_pid without a password prompt
+ if: runner.os == 'macOS'
+ run: sudo security authorizationdb write system.privilege.taskport allow
- name: Install dotnet-coverage
run: dotnet tool install --global dotnet-coverage
diff --git a/.github/workflows/run-tests-selected.yaml b/.github/workflows/run-tests-selected.yaml
index fac15e347c..e873a46ed8 100644
--- a/.github/workflows/run-tests-selected.yaml
+++ b/.github/workflows/run-tests-selected.yaml
@@ -66,6 +66,12 @@ jobs:
- uses: ./.github/actions/add-windowsdefender-exclusions
if: runner.os == 'Windows'
+ # createdump's task_for_pid makes authd evaluate system.privilege.taskport, which prompts for a password on these
+ # headless runners and blocks forever; pre-authorizing it lets in-process disassembly dump its own process.
+ - name: Allow task_for_pid without a password prompt
+ if: runner.os == 'macOS'
+ run: sudo security authorizationdb write system.privilege.taskport allow
+
# Setup
- name: Create `artifacts` directory
run: |
diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml
index 39be091cc2..8c226ecef9 100644
--- a/.github/workflows/run-tests.yaml
+++ b/.github/workflows/run-tests.yaml
@@ -160,6 +160,10 @@ jobs:
- name: Setup additional tools for Wasm/NativeAot tests
if: ${{ github.event.pull_request.draft != true }}
uses: ./.github/actions/setup-additional-tools
+ # createdump's task_for_pid makes authd evaluate system.privilege.taskport, which prompts for a password on these
+ # headless runners and blocks forever; pre-authorizing it lets in-process disassembly dump its own process.
+ - name: Allow task_for_pid without a password prompt
+ run: sudo security authorizationdb write system.privilege.taskport allow
# Build and Test
- name: Run task 'build'
run: ./build.cmd build
diff --git a/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs
index efaa266d74..b6a9ac1129 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs
@@ -97,9 +97,6 @@ public void Recursive()
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void CanDisassembleAllMethodCalls(Jit jit, Platform platform, IToolchain toolchain)
{
- if (OsDetector.IsMacOS() && toolchain.IsInProcess)
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/issues/3076");
-
var disassemblyDiagnoser = new DisassemblyDiagnoser(
new DisassemblyDiagnoserConfig(printSource: true, maxDepth: 3));
@@ -120,9 +117,6 @@ public void CanDisassembleAllMethodCalls(Jit jit, Platform platform, IToolchain
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void CanDisassembleAllMethodCallsUsingFilters(Jit jit, Platform platform, IToolchain toolchain)
{
- if (OsDetector.IsMacOS())
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/issues/3076");
-
var disassemblyDiagnoser = new DisassemblyDiagnoser(
new DisassemblyDiagnoserConfig(printSource: true, maxDepth: 1, filters: ["*WithCalls*"]));
@@ -149,9 +143,6 @@ public void CanDisassembleAllMethodCallsUsingFilters(Jit jit, Platform platform,
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void CanDisassembleGenericTypes(Jit jit, Platform platform, IToolchain toolchain)
{
- if (OsDetector.IsMacOS())
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/issues/3076");
-
var disassemblyDiagnoser = new DisassemblyDiagnoser(
new DisassemblyDiagnoserConfig(printSource: true, maxDepth: 3));
@@ -173,9 +164,6 @@ [Benchmark] public void JustReturn() { }
[Trait(Constants.Category, Constants.BackwardCompatibilityCategory)]
public void CanDisassembleInlinableBenchmarks(Jit jit, Platform platform, IToolchain toolchain)
{
- if (OsDetector.IsMacOS())
- Assert.Skip("https://github.com/dotnet/BenchmarkDotNet/issues/3076");
-
var disassemblyDiagnoser = new DisassemblyDiagnoser(
new DisassemblyDiagnoserConfig(printSource: true, maxDepth: 3));
From 40baecb0fb9886e4a6c3df6e7315ed4c25efaa36 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Tue, 22 Sep 2026 21:11:07 +0900
Subject: [PATCH 47/49] chore: add skip inprocess memorydiagnoser tests because
it's flaky on windows
---
.../BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
index e7ac27434f..16f68293bd 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs
@@ -29,9 +29,9 @@ public class MemoryDiagnoserTests
public static IEnumerable GetToolchains()
{
- if (OsDetector.IsWindows() && Portability.RuntimeInformation.IsFullFramework)
+ if (OsDetector.IsWindows())
{
- // Skip InProcessEmitToolchain tests on Windows +.NET Framework environment.
+ // Skip InProcessEmitToolchain tests on Windows environment.
// Because when running tests with xunit v3, memory allocation tests are flaky.
// See following issues.
// https://github.com/dotnet/BenchmarkDotNet/issues/2779
From 16ed57dbbcc347c696bef849950c7226acecaf46 Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Tue, 22 Sep 2026 22:18:51 +0900
Subject: [PATCH 48/49] chore: skip arm64 test that don't works on .NET
Framework
---
.../Serialization/DisassemblerModelSerializationTests.cs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/BenchmarkDotNet.Tests/Serialization/DisassemblerModelSerializationTests.cs b/tests/BenchmarkDotNet.Tests/Serialization/DisassemblerModelSerializationTests.cs
index 62738eea37..2700607498 100644
--- a/tests/BenchmarkDotNet.Tests/Serialization/DisassemblerModelSerializationTests.cs
+++ b/tests/BenchmarkDotNet.Tests/Serialization/DisassemblerModelSerializationTests.cs
@@ -1,5 +1,6 @@
using AwesomeAssertions;
using BenchmarkDotNet.Disassemblers;
+using BenchmarkDotNet.Portability;
using BenchmarkDotNet.Serialization;
using Gee.External.Capstone;
using Gee.External.Capstone.Arm64;
@@ -107,6 +108,12 @@ public void IntelAsmSerializationTest()
[Fact]
public void Arm64AsmSerializationTest()
{
+ // TODO: Remove this temporary workaround after migrated to AsmArm64
+ if (RuntimeInformation.IsFullFramework)
+ {
+ Assert.Skip("Capstone based arm64 disassembler don't works on .NET Framework.");
+ }
+
// Arrange
byte[] instructionBytes = [0xE1, 0x0B, 0x40, 0xB9]; // ldr w1, [sp, #8]
var disassembleSyntax = DisassembleSyntax.Intel;
From 8fdedecf28a330dd656686b840ec78a30e603e7b Mon Sep 17 00:00:00 2001
From: filzrev <103790468+filzrev@users.noreply.github.com>
Date: Wed, 23 Sep 2026 09:29:14 +0900
Subject: [PATCH 49/49] chore: replace existing InlineDataEnvSpecificAttribute
to xUnit build-in attribute
---
.../CancellationTokenTests.cs | 50 ++++++-----
.../WasmTests.cs | 82 ++++++++++++++-----
.../Shared/XUnit/InlineDataEnvSpecific.cs | 53 ------------
3 files changed, 93 insertions(+), 92 deletions(-)
delete mode 100644 tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs
diff --git a/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs
index 2616ad6bda..f1279835aa 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs
@@ -12,7 +12,6 @@
using BenchmarkDotNet.Tests.Loggers;
using BenchmarkDotNet.Tests.XUnit;
using BenchmarkDotNet.Toolchains;
-using BenchmarkDotNet.Toolchains.DotNetCli;
using BenchmarkDotNet.Toolchains.InProcess.Emit;
using BenchmarkDotNet.Toolchains.InProcess.NoEmit;
using BenchmarkDotNet.Toolchains.Wasm;
@@ -83,7 +82,7 @@ public void BenchmarkWithCancellationTokenProperty_ReceivesToken_InProcessEmit()
}
[Theory]
- [MemberData(nameof(CancellationToolchains), DisableDiscoveryEnumeration = true)]
+ [MemberData(nameof(TestData.Toolchains), MemberType = typeof(TestData), DisableDiscoveryEnumeration = true)]
public void StaticCancellationTokenOnABaseTypeReceivesToken(IToolchain toolchain)
{
var config = ManualConfig.CreateEmpty()
@@ -93,20 +92,8 @@ public void StaticCancellationTokenOnABaseTypeReceivesToken(IToolchain toolchain
CanExecute(config);
}
- public static IEnumerable CancellationToolchains()
- {
- yield return [InProcessNoEmitToolchain.Default];
- yield return [InProcessEmitToolchain.Default];
-
- if (ContinuousIntegration.IsGitHubDraftPR())
- yield break;
-
- yield return [Job.Default.GetToolchain()];
- }
-
- [TheoryEnvSpecific("JSVU does not support ARM on Windows or Linux", EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm, EnvRequirement.NonGitHubDraftPR)]
- [InlineData("v8")]
- [InlineData("node")]
+ [Theory]
+ [MemberData(nameof(TestData.JavaScriptEngines), MemberType = typeof(TestData))]
public void BenchmarkWithCancellationTokenProperty_ReceivesToken_Wasm(string javaScriptEngine)
{
var logger = new OutputLogger(Output);
@@ -165,9 +152,8 @@ public async Task RunWithCancellationTokenIsCancelled_InProcessEmit()
await Assert.ThrowsAnyAsync(async () => await BenchmarkRunner.RunAsync(config, cancellationToken: cts.Token));
}
- [TheoryEnvSpecific(EnvRequirement.NonGitHubDraftPR)]
- [InlineDataEnvSpecific("v8", "JSVU does not support ARM on Windows or Linux", [EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm, EnvRequirement.NonGitHubDraftPR])]
- [InlineData("node")]
+ [Theory(SkipTestWithoutData = true)]
+ [MemberData(nameof(TestData.JavaScriptEngines), MemberType = typeof(TestData))]
public async Task RunWithCancellationTokenIsCancelled_Wasm(string javaScriptEngine)
{
var cts = new CancellationTokenSource();
@@ -252,4 +238,30 @@ public ValueTask HandleAsync(HostSignal signal, DiagnoserActionParameters parame
public void DisplayResults(ILogger logger) { }
}
+
+ public static class TestData
+ {
+ public static IEnumerable> JavaScriptEngines()
+ {
+ if (EnvRequirementChecker.GetSkip(EnvRequirement.NonGitHubDraftPR) != null)
+ yield break;
+
+ // JSVU does not support ARM on Windows or Linux
+ if (EnvRequirementChecker.GetSkip(EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm, EnvRequirement.NonGitHubDraftPR) == null)
+ yield return "v8";
+
+ yield return "node";
+ }
+
+ public static IEnumerable> Toolchains()
+ {
+ yield return new(InProcessNoEmitToolchain.Default);
+ yield return new(InProcessEmitToolchain.Default);
+
+ if (ContinuousIntegration.IsGitHubDraftPR())
+ yield break;
+
+ yield return new(Job.Default.GetToolchain());
+ }
+ }
}
diff --git a/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs b/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs
index a3b63bbe83..e223b3fed7 100644
--- a/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs
+++ b/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs
@@ -19,27 +19,16 @@ namespace BenchmarkDotNet.IntegrationTests
///
public class WasmTests(ITestOutputHelper output) : BenchmarkTestExecutor(output)
{
- private const string V8SkipReason = "JSVU does not support ARM on Windows or Linux";
- // WASM AOT does not build on Windows arm64: the mono-aot-cross toolchain runs but does not emit the
- // *_compiled_methods.txt token file, so WasmApp.Common.targets fails. It works on Linux arm64.
- private const string WasmAotWindowsArmSkipReason = "WASM AOT does not build on Windows arm64";
-
- [TheoryEnvSpecific(EnvRequirement.NonGitHubDraftPR)]
- [InlineDataEnvSpecific([RuntimeMoniker.MonoWasm10_0, "v8"], V8SkipReason, [EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm])]
- [InlineData(RuntimeMoniker.MonoWasm10_0, "node")]
- [InlineDataEnvSpecific([RuntimeMoniker.MonoWasmAot10_0, "v8"], V8SkipReason, [EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm])]
- [InlineDataEnvSpecific([RuntimeMoniker.MonoWasmAot10_0, "node"], WasmAotWindowsArmSkipReason, [EnvRequirement.NonWindowsArm])]
- // CoreWasm is not tested yet because it is still experimental .
- //[InlineDataEnvSpecific([RuntimeMoniker.CoreWasm11_0, "v8"], V8SkipReason, [EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm])]
- //[InlineData(RuntimeMoniker.CoreWasm11_0, "node")]
+ [Theory(SkipTestWithoutData = true)]
+ [MemberData(nameof(TestData.WasmIsSupported), MemberType = typeof(TestData))]
+
public void WasmIsSupported(string runtimeMoniker, string javaScriptEngine)
{
CanExecute(GetConfig(runtimeMoniker, javaScriptEngine));
}
- [TheoryEnvSpecific(EnvRequirement.NonGitHubDraftPR)]
- [InlineDataEnvSpecific(["v8"], V8SkipReason, [EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm])]
- [InlineData("node")]
+ [Theory(SkipTestWithoutData = true)]
+ [MemberData(nameof(TestData.WasmSupportsInProcessDiagnosers), MemberType = typeof(TestData))]
public void WasmSupportsInProcessDiagnosers(string javaScriptEngine)
{
try
@@ -58,9 +47,8 @@ public void WasmSupportsInProcessDiagnosers(string javaScriptEngine)
}
}
- [TheoryEnvSpecific(EnvRequirement.NonGitHubDraftPR)]
- [InlineDataEnvSpecific(["v8", "custom-main-v8.mjs", WasmIpcType.FileStdOut], V8SkipReason, [EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm])]
- [InlineData("node", "custom-main-node.mjs", WasmIpcType.WebSocket)]
+ [Theory(SkipTestWithoutData = true)]
+ [MemberData(nameof(TestData.WasmSupportsCustomMainJs), MemberType = typeof(TestData))]
public void WasmSupportsCustomMainJs(string javaScriptEngine, string customMainJs, WasmIpcType ipcType)
{
var mainJsTemplate = new FileInfo(Path.Combine("wwwroot", customMainJs));
@@ -91,4 +79,58 @@ private ManualConfig GetConfig(string runtimeMoniker, string javaScriptEngine, F
.WithOption(ConfigOptions.GenerateMSBuildBinLog, false);
}
}
-}
\ No newline at end of file
+
+ public static class TestData
+ {
+ public static IEnumerable> WasmIsSupported()
+ {
+ if (EnvRequirementChecker.GetSkip(EnvRequirement.NonGitHubDraftPR) != null)
+ yield break;
+
+ yield return new(RuntimeMoniker.MonoWasm10_0, "node");
+
+ if (IsV8Supported())
+ {
+ yield return new(RuntimeMoniker.MonoWasm10_0, "v8");
+ yield return new(RuntimeMoniker.MonoWasmAot10_0, "v8");
+
+ // CoreWasm is not tested yet because it is still experimental.
+ // yield return new(RuntimeMoniker.CoreWasm11_0, "v8");
+ }
+
+ // WASM AOT does not build on Windows arm64: the mono-aot-cross toolchain runs but does not emit the
+ // *_compiled_methods.txt token file, so WasmApp.Common.targets fails. It works on Linux arm64.
+ if (EnvRequirementChecker.GetSkip(EnvRequirement.NonWindowsArm) == null)
+ yield return new(RuntimeMoniker.MonoWasmAot10_0, "node");
+
+ // CoreWasm is not tested yet because it is still experimental.
+ // yield return new(RuntimeMoniker.CoreWasm11_0, "node");
+ }
+
+ public static IEnumerable> WasmSupportsInProcessDiagnosers()
+ {
+ if (EnvRequirementChecker.GetSkip(EnvRequirement.NonGitHubDraftPR) != null)
+ yield break;
+
+ if (IsV8Supported())
+ yield return new("v8");
+
+ yield return new("node");
+ }
+
+ public static IEnumerable> WasmSupportsCustomMainJs()
+ {
+ if (EnvRequirementChecker.GetSkip(EnvRequirement.NonGitHubDraftPR) != null)
+ yield break;
+
+ if (IsV8Supported())
+ yield return new("v8", "custom-main-v8.mjs", WasmIpcType.FileStdOut);
+
+ yield return new("node", "custom-main-node.mjs", WasmIpcType.WebSocket);
+ }
+
+ // JSVU does not support ARM on Windows or Linux
+ private static bool IsV8Supported()
+ => EnvRequirementChecker.GetSkip([EnvRequirement.NonWindowsArm, EnvRequirement.NonLinuxArm]) == null;
+ }
+}
diff --git a/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs
deleted file mode 100644
index 8f9419f5c0..0000000000
--- a/tests/BenchmarkDotNet.Tests/Shared/XUnit/InlineDataEnvSpecific.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System.Reflection;
-using Xunit;
-using Xunit.Sdk;
-using Xunit.v3;
-
-namespace BenchmarkDotNet.Tests.XUnit;
-
-[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
-public class InlineDataEnvSpecific : DataAttribute
-{
- ///
- /// Gets the data to be passed to the test.
- ///
- // If the user passes null to the constructor, we assume what they meant was a
- // single null value to be passed to the test.
- public object?[] Data { get; }
-
- public InlineDataEnvSpecific(object? data, string reason, params EnvRequirement[] requirements)
- : this([data], reason, requirements) { }
-
- public InlineDataEnvSpecific(object?[] data, string reason, params EnvRequirement[] requirements)
- {
- // If the user passes null to the constructor, we assume what they meant was a
- // single null value to be passed to the test.
- Data = data ?? [null];
- string? skip = EnvRequirementChecker.GetSkip(requirements);
- if (skip != null)
- Skip = $"{skip} ({reason})";
- }
-
- public override ValueTask> GetData(
- MethodInfo testMethod,
- DisposalTracker disposalTracker)
- {
- var traits = new Dictionary>(StringComparer.OrdinalIgnoreCase);
- TestIntrospectionHelper.MergeTraitsInto(traits, Traits);
-
- return new([
- new TheoryDataRow(Data)
- {
- Explicit = ExplicitAsNullable,
- Label = Label,
- Skip = Skip,
- TestDisplayName = TestDisplayName,
- Timeout = TimeoutAsNullable,
- Traits = traits,
- }
- ]);
- }
-
- public override bool SupportsDiscoveryEnumeration()
- => true;
-}