diff --git a/.github/workflows/run-tests-selected.yaml b/.github/workflows/run-tests-selected.yaml index f13bb1d32e..ff6f0aa06d 100644 --- a/.github/workflows/run-tests-selected.yaml +++ b/.github/workflows/run-tests-selected.yaml @@ -34,7 +34,7 @@ on: - net472 filter: type: string - description: Test filter text (It's used for `dotnet test --filter`) Use default value when running all tests + description: Test filter text (It's used for `dotnet test --filter-method`) Use default value when running all tests required: true default: "BenchmarkDotNet" iteration_count: @@ -91,12 +91,13 @@ jobs: run: | $PSNativeCommandUseErrorActionPreference = $true $iterationCount = ${{ inputs.iteration_count }} + + Write-Host ("OSArchitecture" + [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture) foreach($i in 1..$iterationCount) { Write-Output ('##[group]Executing Iteration: {0}/${{ inputs.iteration_count }}' -f $i) - dotnet test -c Release --framework ${{ inputs.framework }} --filter ${{ inputs.filter }} -tl:off --no-build --logger "console;verbosity=normal" - + dotnet test -c Release --framework ${{ inputs.framework }} --no-build --filter-method "${{ inputs.filter }}" --no-ansi Write-Output '##[endgroup]' } diff --git a/BenchmarkDotNet.slnx b/BenchmarkDotNet.slnx index 7fa4bade23..56aaa43b06 100644 --- a/BenchmarkDotNet.slnx +++ b/BenchmarkDotNet.slnx @@ -28,7 +28,9 @@ + + diff --git a/build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj b/build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj index 1992bbf28e..44c9df5cfc 100644 --- a/build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj +++ b/build/BenchmarkDotNet.Build/BenchmarkDotNet.Build.csproj @@ -7,7 +7,7 @@ $(NoWarn);CA2007 - + diff --git a/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs b/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs index e6d5637040..db7f5bc676 100644 --- a/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs +++ b/build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs @@ -3,7 +3,9 @@ using Cake.Common.Diagnostics; using Cake.Common.Tools.DotNet; using Cake.Common.Tools.DotNet.Test; +using Cake.Core; using Cake.Core.IO; +using System.Linq; using System.Runtime.InteropServices; namespace BenchmarkDotNet.Build.Runners; @@ -41,11 +43,15 @@ private DotNetTestSettings GetTestSettingsParameters(FilePath logFile, string tf Framework = tfm, NoBuild = true, NoRestore = true, - Loggers = new[] { "trx", $"trx;LogFileName={logFile.FullPath}", "console;verbosity=detailed" }, EnvironmentVariables = { ["Platform"] = "" // force the tool to not look for the .dll in platform-specific directory - } + }, + PathType = DotNetTestPathType.Auto, + ArgumentCustomization = args + => args.Append("--report-trx") + .AppendSwitchQuoted("--report-trx-filename", System.IO.Path.GetFileName(logFile.FullPath)) + .Append("--no-progress"), }; return settings; } diff --git a/global.json b/global.json new file mode 100644 index 0000000000..3140116df3 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/src/BenchmarkDotNet/Templates/CsProj.txt b/src/BenchmarkDotNet/Templates/CsProj.txt index d7ae3cae05..f247140b21 100644 --- a/src/BenchmarkDotNet/Templates/CsProj.txt +++ b/src/BenchmarkDotNet/Templates/CsProj.txt @@ -27,6 +27,7 @@ true BenchmarkDotNet.Autogenerated.UniqueProgramName + false diff --git a/src/BenchmarkDotNet/Templates/MonoAOTLLVMCsProj.txt b/src/BenchmarkDotNet/Templates/MonoAOTLLVMCsProj.txt index e87eee2527..418b2c537b 100644 --- a/src/BenchmarkDotNet/Templates/MonoAOTLLVMCsProj.txt +++ b/src/BenchmarkDotNet/Templates/MonoAOTLLVMCsProj.txt @@ -1,4 +1,4 @@ - + $CSPROJPATH$ $([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Mono.props')) @@ -21,6 +21,7 @@ true true + false diff --git a/src/BenchmarkDotNet/Templates/R2RCsProj.txt b/src/BenchmarkDotNet/Templates/R2RCsProj.txt index 0a9702ac1c..54f2c2aaa9 100644 --- a/src/BenchmarkDotNet/Templates/R2RCsProj.txt +++ b/src/BenchmarkDotNet/Templates/R2RCsProj.txt @@ -30,6 +30,7 @@ BenchmarkDotNet.Autogenerated.UniqueProgramName false + false diff --git a/src/BenchmarkDotNet/Templates/WasmCsProj.txt b/src/BenchmarkDotNet/Templates/WasmCsProj.txt index 5ab10b2a57..38068cef34 100644 --- a/src/BenchmarkDotNet/Templates/WasmCsProj.txt +++ b/src/BenchmarkDotNet/Templates/WasmCsProj.txt @@ -1,4 +1,4 @@ - + $CSPROJPATH$ $([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Wasm.props')) @@ -26,6 +26,7 @@ $CORECLR_OVERRIDES$ true BenchmarkDotNet.Autogenerated.UniqueProgramName + false diff --git a/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs b/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs index 055daa5b0a..23da1963a0 100644 --- a/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs +++ b/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs @@ -158,6 +158,10 @@ private string GenerateProjectForNuGetBuild(string projectFilePath, BuildPartiti true {GetInstructionSetSettings(buildPartition)} + + false + false + {GetRuntimeSettings(buildPartition.RepresentativeBenchmarkCase.Job.Environment.Gc, buildPartition.Resolver)} diff --git a/tests/.editorconfig b/tests/.editorconfig new file mode 100644 index 0000000000..64a64c01c8 --- /dev/null +++ b/tests/.editorconfig @@ -0,0 +1,7 @@ +root = false + +# C# files +[*.cs] +# xUnit1051: Calls to methods which accept CancellationToken should use TestContext.Current.CancellationToken to allow test cancellation to be more responsive. +dotnet_diagnostic.xUnit1051.severity = suggestion + diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs index d753f56331..cb81e1b05c 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ArgumentsAttributeAnalyzerTests.cs @@ -1110,7 +1110,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 148a134815..40653056cb 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/GeneralParameterAttributesAnalyzerTests.cs @@ -5,6 +5,7 @@ using Xunit; namespace BenchmarkDotNet.Analyzers.Tests.AnalyzerTests.Attributes; + public class GeneralParameterAttributesAnalyzerTests { public class MutuallyExclusiveOnField : AnalyzerTestFixture @@ -158,7 +159,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; @@ -320,7 +321,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; @@ -479,21 +480,19 @@ public static IEnumerable DuplicateAttributeUsageCountsAndNonPublicCla => CombinationsGenerator.CombineArguments(DuplicateParameterAttributeUsageCounts, NonPublicClassMemberAccessModifiers); public static TheoryData UniqueParameterAttributeUsages - => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)]; + => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)]; public static IEnumerable<(string AttributeName, string AttributeUsage)> UniqueParameterAttributes - => UniqueParameterAttributesTheoryData.Select(tdr => ((tdr[0] as string)!, (tdr[1] as string)!)); + => UniqueParameterAttributesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2)); public static IEnumerable NonPublicClassMemberAccessModifiers -#pragma warning disable IDE0028 // Simplify collection initialization - => new NonPublicClassMemberAccessModifiersTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new NonPublicClassMemberAccessModifiersTheoryData().Select(x => x.Data); public static IEnumerable<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> DuplicateSameParameterAttributeUsages - => DuplicateSameAttributeUsagesTheoryData.Select(tdr => ((tdr[0] as string)!, (int) tdr[1], (tdr[2] as int[])!)); + => DuplicateSameAttributeUsagesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2, tdr.Data.Item3)); public static IEnumerable DuplicateParameterAttributeUsageCounts - => DuplicateAttributeUsageCountsTheoryData; + => DuplicateAttributeUsageCountsTheoryData.Select(x => x.Data); } public class PropertyMustBePublic : AnalyzerTestFixture @@ -648,18 +647,16 @@ public static IEnumerable DuplicateAttributeUsageCountsAndNonPublicCla => CombinationsGenerator.CombineArguments(DuplicateParameterAttributeUsageCounts, NonPublicClassMemberAccessModifiers); public static TheoryData UniqueParameterAttributeUsages - => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)]; + => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)]; public static IEnumerable<(string AttributeName, string AttributeUsage)> UniqueParameterAttributes - => UniqueParameterAttributesTheoryData.Select(tdr => ((tdr[0] as string)!, (tdr[1] as string)!)); + => UniqueParameterAttributesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2)); public static IEnumerable NonPublicClassMemberAccessModifiers -#pragma warning disable IDE0028 // Simplify collection initialization - => new NonPublicClassMemberAccessModifiersTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new NonPublicClassMemberAccessModifiersTheoryData().Select(x => x.Data); public static IEnumerable<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> DuplicateSameParameterAttributeUsages - => DuplicateSameAttributeUsagesTheoryData.Select(tdr => ((tdr[0] as string)!, (int) tdr[1], (tdr[2] as int[])!)); + => DuplicateSameAttributeUsagesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2, tdr.Data.Item3)); public static TheoryData DuplicateParameterAttributeUsageCounts => DuplicateAttributeUsageCountsTheoryData; @@ -813,7 +810,7 @@ public class BenchmarkClass } public static TheoryData UniqueParameterAttributeUsages - => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)]; + => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)]; public static TheoryData UniqueParameterAttributes => UniqueParameterAttributesTheoryData; @@ -951,7 +948,7 @@ public class BenchmarkClass } public static TheoryData UniqueParameterAttributeUsages - => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)]; + => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)]; public static TheoryData UniqueParameterAttributes => UniqueParameterAttributesTheoryData; @@ -1113,7 +1110,7 @@ public class BenchmarkClass } public static TheoryData UniqueParameterAttributeUsages - => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)]; + => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)]; public static TheoryData UniqueParameterAttributes => UniqueParameterAttributesTheoryData; @@ -1278,20 +1275,20 @@ public static IEnumerable DuplicateAttributeUsageCountsAndNonPublicPro => CombinationsGenerator.CombineArguments(DuplicateParameterAttributeUsageCounts, NonPublicPropertySetters()); public static TheoryData UniqueParameterAttributeUsages - => [.. UniqueParameterAttributesTheoryData.Select(tdr => (tdr[1] as string)!)]; + => [.. UniqueParameterAttributesTheoryData.Select(tdr => tdr.Data.Item2)]; public static IEnumerable<(string AttributeName, string AttributeUsage)> UniqueParameterAttributes - => UniqueParameterAttributesTheoryData.Select(tdr => ((tdr[0] as string)!, (tdr[1] as string)!)); + => UniqueParameterAttributesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2)); public static IEnumerable<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> DuplicateSameParameterAttributeUsages - => DuplicateSameAttributeUsagesTheoryData.Select(tdr => ((tdr[0] as string)!, (int) tdr[1], (tdr[2] as int[])!)); + => DuplicateSameAttributeUsagesTheoryData.Select(tdr => (tdr.Data.Item1, tdr.Data.Item2, tdr.Data.Item3)); public static TheoryData DuplicateParameterAttributeUsageCounts => DuplicateAttributeUsageCountsTheoryData; public static IEnumerable NonPublicPropertySetters() => new NonPublicPropertySetterAccessModifiersTheoryData() - .Select(m => $"{{ get; {m} set; }}") + .Select(m => $"{{ get; {m.Data} set; }}") .Concat(["{ get; }", "=> 0;"]); public static TheoryData NonPublicPropertySettersTheoryData() @@ -1441,7 +1438,7 @@ public void Run() { } await RunAsync(); } } - + public static TheoryData UniqueParameterAttributesTheoryData => new() { @@ -1486,7 +1483,7 @@ private static IEnumerable GenerateDuplicateAttributeUsageCombinations(Th private static ReadOnlyCollection<(string CurrentUniqueAttributeUsage, int CurrentUniqueAttributeUsagePosition, int[] Counts)> GenerateDuplicateSameAttributeUsageCombinations(TheoryData uniqueAttributeUsages) { var uniqueAttributeUsagesList = uniqueAttributeUsages - .Select(tdr => (tdr[1] as string)!) + .Select(tdr => tdr.Data.Item2) .ToList() .AsReadOnly(); diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAllValuesAttributeAnalyzerTests.cs b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAllValuesAttributeAnalyzerTests.cs index 997954a689..0a690ff056 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAllValuesAttributeAnalyzerTests.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAllValuesAttributeAnalyzerTests.cs @@ -32,9 +32,7 @@ public class BenchmarkClass } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x=>x.Data); public static IEnumerable InvalidTypes => [ @@ -149,9 +147,7 @@ public class BenchmarkClass } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x => x.Data); public static IEnumerable NonEnumStructs => [ @@ -249,9 +245,7 @@ public class BenchmarkClass } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x => x.Data); public static IEnumerable NonEnumOrBoolStructs => [ diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAttributeAnalyzerTests.cs b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAttributeAnalyzerTests.cs index be37acbb62..f410034150 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAttributeAnalyzerTests.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/Attributes/ParamsAttributeAnalyzerTests.cs @@ -32,9 +32,7 @@ public string {{fieldOrPropertyDeclaration}} } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x => x.Data); } public class MustHaveValues : AnalyzerTestFixture @@ -113,12 +111,10 @@ public string {{fieldOrPropertyDeclaration}} } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x => x.Data); public static IEnumerable DummyAttributeUsage - => DummyAttributeUsageTheoryData; + => DummyAttributeUsageTheoryData.Select(x => x.Data); public static IEnumerable ScalarValuesListLength => Enumerable.Range(1, ScalarValues.Count); @@ -130,7 +126,7 @@ private static ReadOnlyCollection ScalarValues .AsReadOnly(); public static IEnumerable ScalarValuesContainerAttributeArgument - => ScalarValuesContainerAttributeArgumentTheoryData(); + => ScalarValuesContainerAttributeArgumentTheoryData().Select(x => x.Data); public static IEnumerable EmptyParamsAttributeUsagesWithLocationMarker() { @@ -838,12 +834,10 @@ public object[] {{fieldOrPropertyDeclaration}} } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x => x.Data); public static IEnumerable DummyAttributeUsage - => DummyAttributeUsageTheoryData; + => DummyAttributeUsageTheoryData.Select(x => x.Data); public static IEnumerable> IntegerValuesAndTypesWithinTargetTypeRange => [ @@ -967,7 +961,7 @@ public static IEnumerable EmptyValuesAttributeArgument() } public static IEnumerable ScalarValuesContainerAttributeArgumentEnumerable - => ScalarValuesContainerAttributeArgumentTheoryData(); + => ScalarValuesContainerAttributeArgumentTheoryData().Select(x => x.Data); public static IEnumerable ArrayValuesContainerAttributeArgumentEnumerableLocal() { @@ -1208,12 +1202,10 @@ public string {{fieldOrPropertyDeclaration}} } public static IEnumerable FieldOrPropertyDeclarations -#pragma warning disable IDE0028 // Simplify collection initialization - => new FieldOrPropertyDeclarationsTheoryData(); -#pragma warning restore IDE0028 // Simplify collection initialization + => new FieldOrPropertyDeclarationsTheoryData().Select(x => x.Data); public static IEnumerable DummyAttributeUsage - => DummyAttributeUsageTheoryData; + => DummyAttributeUsageTheoryData.Select(x => x.Data); public static IEnumerable ScalarValuesListLength => Enumerable.Range(2, ScalarValues.Count); @@ -1224,7 +1216,7 @@ private static ReadOnlyCollection ScalarValues .ToList() .AsReadOnly(); public static IEnumerable ScalarValuesContainerAttributeArgument - => ScalarValuesContainerAttributeArgumentTheoryData(); + => ScalarValuesContainerAttributeArgumentTheoryData().Select(x => x.Data); public static IEnumerable ScalarValuesContainerAttributeArgumentWithLocationMarker() { diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs index df1b62d4b0..e7d881a5b7 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/AnalyzerTests/BenchmarkRunner/RunAnalyzerTests.cs @@ -548,7 +548,7 @@ public void BenchmarkMethod() } public static IEnumerable NonPublicClassAccessModifiersExceptFile - => new NonPublicClassAccessModifiersTheoryData().Where(m => m != "file "); + => new NonPublicClassAccessModifiersTheoryData().Where(m => m.Data != "file ").Select(x => x.Data); } public class TypeArgumentClassMustBeUnsealed : AnalyzerTestFixture diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj b/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj index 92a896bce1..75d50a3656 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj +++ b/tests/BenchmarkDotNet.Analyzers.Tests/BenchmarkDotNet.Analyzers.Tests.csproj @@ -1,35 +1,31 @@ - - - - BenchmarkDotNet.Analyzers.Tests - net472;net8.0;net10.0 - true - true - true - true - $(NoWarn);CS1591 - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - + + + + BenchmarkDotNet.Analyzers.Tests + net472;net8.0;net10.0 + Exe + true + true + true + true + $(NoWarn);CS1591 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Extensions/TheoryDataExtensions.cs b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Extensions/TheoryDataExtensions.cs index 1e62dae0e4..c75ce66d84 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Extensions/TheoryDataExtensions.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Extensions/TheoryDataExtensions.cs @@ -6,5 +6,5 @@ namespace BenchmarkDotNet.Analyzers.Tests.Fixtures; public static class TheoryDataExtensions { public static ReadOnlyCollection AsReadOnly(this TheoryData theoryData) - => (theoryData as IEnumerable).ToList().AsReadOnly(); + => theoryData.Select(x => x.Data).ToList().AsReadOnly(); } \ 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 9a2a69bab4..1685665486 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleDouble.cs @@ -1,4 +1,4 @@ -using Xunit.Abstractions; +using Xunit.Sdk; namespace BenchmarkDotNet.Analyzers.Tests.Fixtures; diff --git a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs index 8fd256378b..66c6596386 100644 --- a/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs +++ b/tests/BenchmarkDotNet.Analyzers.Tests/Fixtures/Serializable/ValueTupleTriple.cs @@ -1,4 +1,4 @@ -using Xunit.Abstractions; +using Xunit.Sdk; namespace BenchmarkDotNet.Analyzers.Tests.Fixtures; 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 ccadec5e07..97deb247d4 100644 --- a/tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj +++ b/tests/BenchmarkDotNet.Exporters.Plotting.Tests/BenchmarkDotNet.Exporters.Plotting.Tests.csproj @@ -2,6 +2,7 @@ net8.0;net472 + Exe true false @@ -14,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 546c615119..1d5118dc69 100644 --- a/tests/BenchmarkDotNet.Exporters.Plotting.Tests/ScottPlotExporterTests.cs +++ b/tests/BenchmarkDotNet.Exporters.Plotting.Tests/ScottPlotExporterTests.cs @@ -3,7 +3,9 @@ using BenchmarkDotNet.Loggers; using BenchmarkDotNet.Tests.Mocks; using System.Diagnostics.CodeAnalysis; -using Xunit.Abstractions; +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 5b849298b3..271267164d 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly/BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj @@ -3,6 +3,7 @@ BenchmarkDotNet.IntegrationTests.ConfigPerAssembly net472;net8.0 + Exe true BenchmarkDotNet.IntegrationTests.ConfigPerAssembly BenchmarkDotNet.IntegrationTests.ConfigPerAssembly @@ -13,6 +14,9 @@ + + + diff --git a/tests/BenchmarkDotNet.IntegrationTests.CustomPaths/BenchmarkDotNet.IntegrationTests.CustomPaths.csproj b/tests/BenchmarkDotNet.IntegrationTests.CustomPaths/BenchmarkDotNet.IntegrationTests.CustomPaths.csproj index ffea2b8a5f..e29da5c4e6 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.CustomPaths/BenchmarkDotNet.IntegrationTests.CustomPaths.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.CustomPaths/BenchmarkDotNet.IntegrationTests.CustomPaths.csproj @@ -3,6 +3,7 @@ BenchmarkDotNet.IntegrationTests.CustomPaths net472 + Exe true BenchmarkDotNet.IntegrationTests.CustomPaths BenchmarkDotNet.IntegrationTests.CustomPaths @@ -13,6 +14,9 @@ + + + diff --git a/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj b/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj index fdb5400397..9a6d74076b 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.DisabledOptimizations/BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj @@ -3,6 +3,7 @@ BenchmarkDotNet.IntegrationTests.DisabledOptimizations net472;net8.0 + Exe true BenchmarkDotNet.IntegrationTests.DisabledOptimizations BenchmarkDotNet.IntegrationTests.DisabledOptimizations @@ -15,6 +16,9 @@ + + + diff --git a/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj b/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj index 7bfa81d814..e5ebdb29f0 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.EnabledOptimizations/BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj @@ -3,6 +3,7 @@ BenchmarkDotNet.IntegrationTests.EnabledOptimizations net472;net8.0 + Exe true BenchmarkDotNet.IntegrationTests.EnabledOptimizations BenchmarkDotNet.IntegrationTests.EnabledOptimizations @@ -15,6 +16,9 @@ + + + diff --git a/tests/BenchmarkDotNet.IntegrationTests.FSharp/BenchmarkDotNet.IntegrationTests.FSharp.fsproj b/tests/BenchmarkDotNet.IntegrationTests.FSharp/BenchmarkDotNet.IntegrationTests.FSharp.fsproj index aa75712391..635862316e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.FSharp/BenchmarkDotNet.IntegrationTests.FSharp.fsproj +++ b/tests/BenchmarkDotNet.IntegrationTests.FSharp/BenchmarkDotNet.IntegrationTests.FSharp.fsproj @@ -2,6 +2,7 @@ net472;net8.0 + Exe false @@ -10,6 +11,9 @@ + + + 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 a0d6ee6938..75bbcd0a1f 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks.csproj @@ -15,14 +15,6 @@ true true - - - - - - - - @@ -36,12 +28,8 @@ - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/MultipleFrameworksTest.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/MultipleFrameworksTest.cs index 72e16f13af..d94a580e6c 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/MultipleFrameworksTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/MultipleFrameworksTest.cs @@ -1,9 +1,8 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Extensions; using BenchmarkDotNet.Jobs; -using Xunit; -using Xunit.Abstractions; +using BenchmarkDotNet.Tests; namespace BenchmarkDotNet.IntegrationTests.ManualRunning { @@ -11,15 +10,11 @@ public class MultipleFrameworksTest : BenchmarkTestExecutor { private const string TfmEnvVarName = "TfmEnvVarName"; - public MultipleFrameworksTest(ITestOutputHelper output) : base(output) - { - } - - [Theory] - [InlineData(RuntimeMoniker.Net461)] - [InlineData(RuntimeMoniker.Net48)] - [InlineData(RuntimeMoniker.NetCoreApp20)] - [InlineData(RuntimeMoniker.Net80)] + [Test] + [TUnit.Core.Arguments(RuntimeMoniker.Net462)] + [TUnit.Core.Arguments(RuntimeMoniker.Net48)] + [TUnit.Core.Arguments(RuntimeMoniker.Net80)] + [TUnit.Core.Arguments(RuntimeMoniker.Net10_0)] public void EachFrameworkIsRebuilt(RuntimeMoniker runtime) { var config = ManualConfig.CreateEmpty().AddJob(Job.Dry.WithRuntime(runtime.GetRuntime()).WithEnvironmentVariable(TfmEnvVarName, runtime.ToString())); diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Properties/AssemblyInfo.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..84dd4b071d --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System.Runtime.InteropServices; + +[assembly: Guid("f8203913-4b95-4fd9-b640-08d58dd563e2")] + +[assembly: NotInParallel] diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/BenchmarkTestExecutor.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/BenchmarkTestExecutor.cs new file mode 100644 index 0000000000..e53d80565c --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/BenchmarkTestExecutor.cs @@ -0,0 +1,92 @@ +using AwesomeAssertions; +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; +using BenchmarkDotNet.Loggers; +using BenchmarkDotNet.Reports; +using BenchmarkDotNet.Running; +using TUnit.Core.Interfaces; + +namespace BenchmarkDotNet.Tests; + +public class BenchmarkTestExecutor +{ + protected ITestOutput Output => TestContext.Current!.Output!; + + /// + /// Runs Benchmarks with the most simple config (SingleRunFastConfig) + /// combined with any benchmark config applied to TBenchmark (via an attribute) + /// By default will verify if every benchmark was successfully executed + /// + /// type that defines Benchmarks + /// Optional custom config to be used instead of the default + /// Optional: disable validation (default = true/enabled) + /// The summary from the benchmark run + public Reports.Summary CanExecute(IConfig? config = null, bool fullValidation = true) + { + return CanExecute(typeof(TBenchmark), config, fullValidation); + } + + /// + /// Runs Benchmarks with the most simple config (SingleRunFastConfig) + /// combined with any benchmark config applied to Type (via an attribute) + /// By default will verify if every benchmark was successfully executed + /// + /// type that defines Benchmarks + /// Optional custom config to be used instead of the default + /// Optional: disable validation (default = true/enabled) + /// The summary from the benchmark run + public Reports.Summary CanExecute(Type type, IConfig? config = null, bool fullValidation = true) + { + // Add logging, so the Benchmark execution is in the TestRunner output (makes Debugging easier) + if (config == null) + config = CreateSimpleConfig(); + + if (!config.GetLoggers().OfType().Any()) + config = config.AddLogger(Output != null ? new OutputLogger(Output) : ConsoleLogger.Default); + if (!config.GetLoggers().OfType().Any()) + config = config.AddLogger(ConsoleLogger.Default); + + if (!config.GetColumnProviders().Any()) + config = config.AddColumnProvider(DefaultColumnProviders.Instance); + + // Make sure we ALWAYS combine the Config (default or passed in) with any Config applied to the Type/Class + var summary = BenchmarkRunner.Run(type, config); + + if (fullValidation) + { + summary.HasCriticalValidationErrors.Should().BeFalse("The \"Summary\" should have NOT \"HasCriticalValidationErrors\""); + summary.Reports.Any().Should().BeTrue("The \"Summary\" should contain at least one \"BenchmarkReport\" in the \"Reports\" collection"); + + summary.CheckPlatformLinkerIssues(); + + summary.Reports.Should().OnlyContain(r => r.BuildResult.IsBuildSuccess, + "The following benchmarks have failed to build: " + + string.Join(", ", summary.Reports.Where(r => !r.BuildResult.IsBuildSuccess).Select(r => r.BenchmarkCase.DisplayInfo))); + + summary.Reports.Should().OnlyContain(r => r.ExecuteResults != null, + "The following benchmarks have failed to execute: " + + string.Join(", ", summary.Reports.Where(r => r.ExecuteResults == null || r.ExecuteResults.Any(er => !er.IsSuccess)).Select(r => r.BenchmarkCase.DisplayInfo))); ; + + summary.Reports.SelectMany(x => x.ExecuteResults).Should().OnlyContain(r => r.IsSuccess, + "All reports should have succeeded to execute"); + } + + return summary; + } + + protected IConfig CreateSimpleConfig(OutputLogger? logger = null, Job? job = null) + { + var baseConfig = job == null ? (IConfig)new SingleRunFastConfig() : new SingleJobConfig(job); + return baseConfig + .AddLogger(logger ?? (Output != null ? new OutputLogger(Output) : ConsoleLogger.Default)) + .AddColumnProvider(DefaultColumnProviders.Instance) + .AddAnalyser(DefaultConfig.Instance.GetAnalysers().ToArray()); + } + + protected static IReadOnlyList GetSingleStandardOutput(Summary summary) + => summary.Reports.Single().ExecuteResults.Single().StandardOutput; + + protected static IReadOnlyList GetCombinedStandardOutput(Summary summary) + => summary.Reports.SelectMany(r => r.ExecuteResults).SelectMany(e => e.StandardOutput).ToArray(); +} \ No newline at end of file diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/Logger/OutputLogger.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/Logger/OutputLogger.cs new file mode 100644 index 0000000000..5350d2d9f9 --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/Logger/OutputLogger.cs @@ -0,0 +1,39 @@ +using BenchmarkDotNet.Loggers; +using System.Runtime.CompilerServices; +using TUnit.Core.Interfaces; + +namespace BenchmarkDotNet.Tests; + +public class OutputLogger : AccumulationLogger +{ + private readonly ITestOutput Output; + private string currentLine = ""; + + public OutputLogger(ITestOutput output) + { + Output = output ?? throw new ArgumentNullException(nameof(Output)); + } + + [MethodImpl(MethodImplOptions.Synchronized)] + public override void Write(LogKind logKind, string text) + { + currentLine += text; + base.Write(logKind, text); + } + + [MethodImpl(MethodImplOptions.Synchronized)] + public override void WriteLine() + { + Output.WriteLine(currentLine); + currentLine = ""; + base.WriteLine(); + } + + [MethodImpl(MethodImplOptions.Synchronized)] + public override void WriteLine(LogKind logKind, string text) + { + Output.WriteLine(currentLine + text); + currentLine = ""; + base.WriteLine(logKind, text); + } +} \ No newline at end of file diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/System.Runtime.CompilerServices/ModuleInitializerAttribute.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/System.Runtime.CompilerServices/ModuleInitializerAttribute.cs new file mode 100644 index 0000000000..28a87b37b9 --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/System.Runtime.CompilerServices/ModuleInitializerAttribute.cs @@ -0,0 +1,11 @@ +#if NETFRAMEWORK +namespace System.Runtime.CompilerServices; + +[AttributeUsage(AttributeTargets.Method, Inherited = false)] +public sealed class ModuleInitializerAttribute : Attribute +{ + public ModuleInitializerAttribute() + { + } +} +#endif diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TUnit/Extensions.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TUnit/Extensions.cs new file mode 100644 index 0000000000..b75c41ad77 --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TUnit/Extensions.cs @@ -0,0 +1,14 @@ +using BenchmarkDotNet.Reports; + +namespace BenchmarkDotNet.Tests; + +public static class Extensions +{ + public static void CheckPlatformLinkerIssues(this Summary summary) + { + if (summary.Reports.Any(r => + !r.BuildResult.IsBuildSuccess && + r.BuildResult.ErrorMessage.Contains("Platform linker not found"))) + throw new MisconfiguredEnvironmentException("Failed to build benchmarks because the platform linker not found"); + } +} diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TUnit/MisconfiguredEnvironmentException.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TUnit/MisconfiguredEnvironmentException.cs new file mode 100644 index 0000000000..0547277b8a --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TUnit/MisconfiguredEnvironmentException.cs @@ -0,0 +1,8 @@ +namespace BenchmarkDotNet.Tests; + +public class MisconfiguredEnvironmentException : Exception +{ + public MisconfiguredEnvironmentException(string message) : base(message) { } + + public string SkipMessage => $"Skip this test because the environment is misconfigured ({Message})"; +} diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TestConfigs.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TestConfigs.cs new file mode 100644 index 0000000000..919bb50477 --- /dev/null +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning.MultipleFrameworks/Shared/TestConfigs.cs @@ -0,0 +1,20 @@ +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Jobs; + +namespace BenchmarkDotNet.Tests; + +public class SingleJobConfig : ManualConfig +{ + public SingleJobConfig(Job job) + { + AddJob(job); + } +} + +public class SingleRunFastConfig : ManualConfig +{ + public SingleRunFastConfig() + { + AddJob(Job.Dry); + } +} \ No newline at end of file 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 18fcf9b171..fcd24ec069 --- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/BenchmarkDotNet.IntegrationTests.ManualRunning.csproj @@ -3,6 +3,9 @@ BenchmarkDotNet.IntegrationTests.ManualRunning net472;net8.0 + + $(MSBuildWarningsAsMessages);MSB3277 + Exe true BenchmarkDotNet.IntegrationTests.ManualRunning BenchmarkDotNet.IntegrationTests.ManualRunning @@ -19,14 +22,14 @@ $(DefineConstants);$(ExtraDefineConstants) - + - - - - - - + + + + + + @@ -40,12 +43,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 4f577ffa0f..0020481687 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotMemoryTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotMemoryTests.cs @@ -6,7 +6,6 @@ using BenchmarkDotNet.Portability; using BenchmarkDotNet.Toolchains.InProcess.Emit; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests.ManualRunning { diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs index 52747e9030..4a240100c4 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/DotTraceTests.cs @@ -6,7 +6,6 @@ using BenchmarkDotNet.Portability; using BenchmarkDotNet.Toolchains.InProcess.Emit; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests.ManualRunning { diff --git a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs index e97e821e33..55f890dc12 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests.ManualRunning/MsBuildArgumentTests.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests.ManualRunning { diff --git a/tests/BenchmarkDotNet.IntegrationTests.Static/BenchmarkDotNet.IntegrationTests.Static.csproj b/tests/BenchmarkDotNet.IntegrationTests.Static/BenchmarkDotNet.IntegrationTests.Static.csproj index 268340278e..63fc36d874 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.Static/BenchmarkDotNet.IntegrationTests.Static.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests.Static/BenchmarkDotNet.IntegrationTests.Static.csproj @@ -3,6 +3,7 @@ BenchmarkDotNet.IntegrationTests.Static net472;net8.0 + Exe true BenchmarkDotNet.IntegrationTests.Static BenchmarkDotNet.IntegrationTests.Static @@ -13,6 +14,9 @@ + + + diff --git a/tests/BenchmarkDotNet.IntegrationTests.VisualBasic/BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj b/tests/BenchmarkDotNet.IntegrationTests.VisualBasic/BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj index 65ac132061..dccd63245b 100644 --- a/tests/BenchmarkDotNet.IntegrationTests.VisualBasic/BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj +++ b/tests/BenchmarkDotNet.IntegrationTests.VisualBasic/BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj @@ -2,9 +2,13 @@ net472;net8.0 + Exe + + + \ No newline at end of file diff --git a/tests/BenchmarkDotNet.IntegrationTests/AllSetupAndCleanupTest.cs b/tests/BenchmarkDotNet.IntegrationTests/AllSetupAndCleanupTest.cs index 68ab54b8e8..54934cd6a2 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/AllSetupAndCleanupTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/AllSetupAndCleanupTest.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Reports; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/AppConfigTests.cs b/tests/BenchmarkDotNet.IntegrationTests/AppConfigTests.cs index 8a597e8a4d..0baf6bf239 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/AppConfigTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/AppConfigTests.cs @@ -1,6 +1,5 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using System.Configuration; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ArgumentsTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ArgumentsTests.cs index 938efe17f1..d012aed52b 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ArgumentsTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ArgumentsTests.cs @@ -1,11 +1,10 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Extensions; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.InProcess.Emit; using System.Numerics; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/AssemblyConfigTests.cs b/tests/BenchmarkDotNet.IntegrationTests/AssemblyConfigTests.cs index 8c1dcaeda8..7d58986483 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/AssemblyConfigTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/AssemblyConfigTests.cs @@ -1,5 +1,4 @@ using BenchmarkDotNet.IntegrationTests.ConfigPerAssembly; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs b/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs index d9ffc9e556..6672aaa70e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/AsyncBenchmarksTests.cs @@ -1,6 +1,5 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using System.Threading.Tasks.Sources; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/AttributesTests.cs b/tests/BenchmarkDotNet.IntegrationTests/AttributesTests.cs index 10e6c78c9d..8130a7ce73 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/AttributesTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/AttributesTests.cs @@ -1,5 +1,4 @@ -using BenchmarkDotNet.Attributes; -using Xunit.Abstractions; +using BenchmarkDotNet.Attributes; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/BaselineRatioColumnTest.cs b/tests/BenchmarkDotNet.IntegrationTests/BaselineRatioColumnTest.cs index e70743f988..83b3c1e98f 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/BaselineRatioColumnTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/BaselineRatioColumnTest.cs @@ -1,10 +1,9 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Exporters; using BenchmarkDotNet.Loggers; using BenchmarkDotNet.Reports; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj index b54a05009a..0e83c1f2a0 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj +++ b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkDotNet.IntegrationTests.csproj @@ -4,6 +4,7 @@ BenchmarkDotNet.IntegrationTests net472;net8.0 net8.0 + Exe true BenchmarkDotNet.IntegrationTests BenchmarkDotNet.IntegrationTests @@ -14,6 +15,9 @@ $(NoWarn);CA2007;CA1825 true + + + Always @@ -29,18 +33,23 @@ - + + - + + + + + + + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkSwitcherTest.cs b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkSwitcherTest.cs index bb08c691d8..ab336fe92e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkSwitcherTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkSwitcherTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; using BenchmarkDotNet.Exporters; @@ -9,7 +9,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkTestExecutor.cs b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkTestExecutor.cs index 4e17eb6982..795127c130 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/BenchmarkTestExecutor.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/BenchmarkTestExecutor.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.IntegrationTests.Xunit; using BenchmarkDotNet.Jobs; @@ -7,7 +7,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Tests.Loggers; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/BuildTimeoutTests.cs b/tests/BenchmarkDotNet.IntegrationTests/BuildTimeoutTests.cs index 70698e6e51..3af68062ee 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/BuildTimeoutTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/BuildTimeoutTests.cs @@ -1,11 +1,10 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Detectors; using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Portability; using BenchmarkDotNet.Toolchains.NativeAot; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/CallerThreadTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CallerThreadTests.cs index 869767c5ee..9073af2e4e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CallerThreadTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CallerThreadTests.cs @@ -14,18 +14,17 @@ using BenchmarkDotNet.Toolchains.InProcess.NoEmit; using BenchmarkDotNet.Toolchains.Results; using BenchmarkDotNet.Validators; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests; public class CallerThreadTests(ITestOutputHelper output) : BenchmarkTestExecutor(output) { - public static TheoryData GetToolchains() => + public static TheoryData GetToolchains() => new( [ new InProcessEmitToolchain(new() { ExecuteOnSeparateThread = false }), new InProcessNoEmitToolchain(new() { ExecuteOnSeparateThread = false }), Job.Default.GetToolchain() - ]; + ]); [Theory] [MemberData(nameof(GetToolchains), DisableDiscoveryEnumeration = true)] diff --git a/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs index 4841703b84..1c108b8b58 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CancellationTokenTests.cs @@ -17,7 +17,6 @@ using BenchmarkDotNet.Toolchains.MonoAotLLVM; using BenchmarkDotNet.Toolchains.MonoWasm; using BenchmarkDotNet.Validators; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests; diff --git a/tests/BenchmarkDotNet.IntegrationTests/CodeGenTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CodeGenTests.cs index 2068376512..ee41633b66 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CodeGenTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CodeGenTests.cs @@ -1,11 +1,10 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Tests.XUnit; using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.InProcess.Emit; using System.Diagnostics; using System.Reflection; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests; diff --git a/tests/BenchmarkDotNet.IntegrationTests/ConflictingNamesTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ConflictingNamesTests.cs index 39436fb6d1..bb1b8eab7e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ConflictingNamesTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ConflictingNamesTests.cs @@ -1,5 +1,4 @@ -using BenchmarkDotNet.Attributes; -using Xunit.Abstractions; +using BenchmarkDotNet.Attributes; namespace BenchmarkDotNet.IntegrationTests; diff --git a/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs index 1d43b59550..3d88695806 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CopyToOutputTests.cs @@ -1,7 +1,6 @@ #if NETFRAMEWORK using BenchmarkDotNet.IntegrationTests.CustomPaths; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs index 8bbf004312..2e4e317692 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CustomBuildConfigurationTests.cs @@ -1,14 +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 -using Xunit; -#endif -using Xunit.Abstractions; +using System.Reflection; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/CustomEngineTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CustomEngineTests.cs index 50cd89be98..c7bf0030fd 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CustomEngineTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CustomEngineTests.cs @@ -1,9 +1,8 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Jobs; using Perfolizer.Mathematics.OutlierDetection; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/CustomTaskAndAwaitableTests.cs b/tests/BenchmarkDotNet.IntegrationTests/CustomTaskAndAwaitableTests.cs index 6a35e18c6b..a26b57665d 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/CustomTaskAndAwaitableTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/CustomTaskAndAwaitableTests.cs @@ -1,9 +1,8 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.InProcess.Emit; using System.Runtime.CompilerServices; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests; diff --git a/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/MockInProcessDiagnoser.cs b/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/MockInProcessDiagnoser.cs index aa262dc62b..6466c6f49f 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/MockInProcessDiagnoser.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/MockInProcessDiagnoser.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Analysers; +using BenchmarkDotNet.Analysers; using BenchmarkDotNet.Diagnosers; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Exporters; diff --git a/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/ProcessMetricsTests.cs b/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/ProcessMetricsTests.cs index 829a48bced..8aa8b6e9ad 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/ProcessMetricsTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/Diagnosers/ProcessMetricsTests.cs @@ -1,4 +1,4 @@ -#if NETFRAMEWORK +#if NETFRAMEWORK using BenchmarkDotNet.Diagnosers; using BenchmarkDotNet.Diagnostics.Windows.Tracing; using BenchmarkDotNet.Engines; diff --git a/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs index dcd3054e66..5e804a3cde 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/DisassemblyDiagnoserTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Diagnosers; @@ -14,7 +14,6 @@ using BenchmarkDotNet.Toolchains.CsProj; using BenchmarkDotNet.Toolchains.InProcess.Emit; using System.Runtime.CompilerServices; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/DryRunTests.cs b/tests/BenchmarkDotNet.IntegrationTests/DryRunTests.cs index 895dc4266a..b2db86e730 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/DryRunTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/DryRunTests.cs @@ -1,6 +1,5 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/EngineTests.cs b/tests/BenchmarkDotNet.IntegrationTests/EngineTests.cs index d04eaa6385..84b5199206 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/EngineTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/EngineTests.cs @@ -7,7 +7,6 @@ using BenchmarkDotNet.Toolchains.InProcess.Emit; using BenchmarkDotNet.Toolchains.InProcess.NoEmit; using System.Diagnostics; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { @@ -73,12 +72,12 @@ public class FooBench public void Foo() => Thread.Sleep(10); } - public static TheoryData GetToolchains() => + public static TheoryData GetToolchains() => new( [ InProcessEmitToolchain.Default, InProcessNoEmitToolchain.Default, Job.Default.GetToolchain() - ]; + ]); // #1120 [Theory] diff --git a/tests/BenchmarkDotNet.IntegrationTests/EnvironmentVariablesTests.cs b/tests/BenchmarkDotNet.IntegrationTests/EnvironmentVariablesTests.cs index d414a580b9..b63820cb74 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/EnvironmentVariablesTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/EnvironmentVariablesTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Jobs; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/EventProcessorTests.cs b/tests/BenchmarkDotNet.IntegrationTests/EventProcessorTests.cs index 08c570eee0..00364868fc 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/EventProcessorTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/EventProcessorTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Characteristics; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; diff --git a/tests/BenchmarkDotNet.IntegrationTests/ExceptionDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ExceptionDiagnoserTests.cs index 61850d54ed..766a049ce5 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ExceptionDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ExceptionDiagnoserTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Diagnosers; diff --git a/tests/BenchmarkDotNet.IntegrationTests/ExceptionHandlingTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ExceptionHandlingTests.cs index 4aa1215007..4c2ab6a442 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ExceptionHandlingTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ExceptionHandlingTests.cs @@ -1,11 +1,10 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Diagnosers; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers; using BenchmarkDotNet.Toolchains.InProcess.Emit; using JetBrains.Annotations; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ExporterIOTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ExporterIOTests.cs index 2a758535e2..d70a3a2356 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ExporterIOTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ExporterIOTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Exporters; using BenchmarkDotNet.Helpers; @@ -7,7 +7,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Tests.XUnit; using System.Collections.Immutable; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ExtraAttributesForEntryMethodTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ExtraAttributesForEntryMethodTests.cs index cdf6177346..4dc3be0b51 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ExtraAttributesForEntryMethodTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ExtraAttributesForEntryMethodTests.cs @@ -1,6 +1,5 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/FSharpTests.cs b/tests/BenchmarkDotNet.IntegrationTests/FSharpTests.cs index 812ae3f73b..2499ca9e12 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/FSharpTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/FSharpTests.cs @@ -1,4 +1,3 @@ -using Xunit.Abstractions; using static FSharpBenchmarks; namespace BenchmarkDotNet.IntegrationTests diff --git a/tests/BenchmarkDotNet.IntegrationTests/FailingProcessSpawnTests.cs b/tests/BenchmarkDotNet.IntegrationTests/FailingProcessSpawnTests.cs index 57fbbcca6b..dbd26546af 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/FailingProcessSpawnTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/FailingProcessSpawnTests.cs @@ -1,8 +1,7 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Portability; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs b/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs index 97ff8e2968..ccd5f365fe 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/GcModeTests.cs @@ -1,8 +1,8 @@ -using System.Runtime; -using Xunit.Abstractions; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; +using System.Runtime; + #if NETFRAMEWORK using BenchmarkDotNet.Environments; #endif diff --git a/tests/BenchmarkDotNet.IntegrationTests/GlobalSetupAttributeInvalidMethodTest.cs b/tests/BenchmarkDotNet.IntegrationTests/GlobalSetupAttributeInvalidMethodTest.cs index 34616e715d..e0ebc4e38e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/GlobalSetupAttributeInvalidMethodTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/GlobalSetupAttributeInvalidMethodTest.cs @@ -1,5 +1,4 @@ -using BenchmarkDotNet.Attributes; -using Xunit.Abstractions; +using BenchmarkDotNet.Attributes; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/InProcess.EmitTests/NaiveRunnableEmitDiff.cs b/tests/BenchmarkDotNet.IntegrationTests/InProcess.EmitTests/NaiveRunnableEmitDiff.cs index 4ac20d2c8d..df101375b9 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/InProcess.EmitTests/NaiveRunnableEmitDiff.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/InProcess.EmitTests/NaiveRunnableEmitDiff.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes.CompilerServices; +using BenchmarkDotNet.Attributes.CompilerServices; using BenchmarkDotNet.Loggers; using Mono.Cecil; using Mono.Cecil.Cil; diff --git a/tests/BenchmarkDotNet.IntegrationTests/InProcessDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/InProcessDiagnoserTests.cs index 4b66eb6b12..41f407ebbc 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/InProcessDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/InProcessDiagnoserTests.cs @@ -6,7 +6,6 @@ using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Toolchains.InProcess.Emit; using BenchmarkDotNet.Toolchains.InProcess.NoEmit; -using Xunit.Abstractions; using RunMode = BenchmarkDotNet.Diagnosers.RunMode; namespace BenchmarkDotNet.IntegrationTests; diff --git a/tests/BenchmarkDotNet.IntegrationTests/InProcessEmitTest.cs b/tests/BenchmarkDotNet.IntegrationTests/InProcessEmitTest.cs index 8048687ad0..ea613ae0bb 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/InProcessEmitTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/InProcessEmitTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Engines; @@ -12,7 +12,6 @@ using BenchmarkDotNet.Toolchains.InProcess.Emit; using BenchmarkDotNet.Toolchains.Roslyn; using JetBrains.Annotations; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs b/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs index 41e1605c6c..3b33f7745c 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/InProcessTest.cs @@ -16,8 +16,6 @@ using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; -using Xunit.Abstractions; - namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/JitOptimizationsTests.cs b/tests/BenchmarkDotNet.IntegrationTests/JitOptimizationsTests.cs index 1b543918d5..735407181f 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/JitOptimizationsTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/JitOptimizationsTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Validators; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/JitRuntimeValidationTest.cs b/tests/BenchmarkDotNet.IntegrationTests/JitRuntimeValidationTest.cs index f0cef0001f..d893323a86 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/JitRuntimeValidationTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/JitRuntimeValidationTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; @@ -6,7 +6,6 @@ using BenchmarkDotNet.Portability; using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/LanguageVersionTests.cs b/tests/BenchmarkDotNet.IntegrationTests/LanguageVersionTests.cs index 59b43ffe12..81c836969c 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/LanguageVersionTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/LanguageVersionTests.cs @@ -1,5 +1,4 @@ -using BenchmarkDotNet.Attributes; -using Xunit.Abstractions; +using BenchmarkDotNet.Attributes; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cs b/tests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cs index 5afb8d316d..a67018d097 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/LargeAddressAwareTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; @@ -7,7 +7,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs old mode 100755 new mode 100644 index 732f1066bf..706f4d276f --- a/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/MemoryDiagnoserTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Detectors; @@ -21,7 +21,6 @@ using BenchmarkDotNet.Toolchains.NativeAot; using System.Reflection; using System.Runtime.CompilerServices; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/MonoTests.cs b/tests/BenchmarkDotNet.IntegrationTests/MonoTests.cs index 4970bed93e..9fd45f8d3c 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/MonoTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/MonoTests.cs @@ -1,11 +1,10 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Portability; using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs b/tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs index 0fc6c25c17..a6a6a002dc 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/MultipleRuntimesTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; @@ -9,7 +9,6 @@ using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; using BenchmarkDotNet.Toolchains; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/NativeAotTests.cs b/tests/BenchmarkDotNet.IntegrationTests/NativeAotTests.cs index 6c10af2044..98c5c4820e 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/NativeAotTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/NativeAotTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Detectors; using BenchmarkDotNet.Environments; @@ -8,7 +8,6 @@ using BenchmarkDotNet.Portability; using BenchmarkDotNet.Tests.XUnit; using BenchmarkDotNet.Toolchains.NativeAot; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ParamSourceTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ParamSourceTests.cs index 459920ff43..02cd25d208 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ParamSourceTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ParamSourceTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Code; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; @@ -6,7 +6,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.InProcess.Emit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ParamsTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ParamsTests.cs index 99b8964ff4..5db376879d 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ParamsTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ParamsTests.cs @@ -1,5 +1,4 @@ -using BenchmarkDotNet.Attributes; -using Xunit.Abstractions; +using BenchmarkDotNet.Attributes; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/PathTooLongTests.cs b/tests/BenchmarkDotNet.IntegrationTests/PathTooLongTests.cs index 96969b56d1..bea5d32031 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/PathTooLongTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/PathTooLongTests.cs @@ -1,6 +1,5 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Tests.XUnit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/PowerManagementApplierTests.cs b/tests/BenchmarkDotNet.IntegrationTests/PowerManagementApplierTests.cs index 666f0b1309..aca93e1977 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/PowerManagementApplierTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/PowerManagementApplierTests.cs @@ -4,7 +4,6 @@ using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; using System.Globalization; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/PriorityTests.cs b/tests/BenchmarkDotNet.IntegrationTests/PriorityTests.cs index 8ce7444615..093d39db6f 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/PriorityTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/PriorityTests.cs @@ -1,5 +1,4 @@ -using BenchmarkDotNet.Attributes; -using Xunit.Abstractions; +using BenchmarkDotNet.Attributes; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ProcessPropertiesTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ProcessPropertiesTests.cs index e2a3bd7437..5726236171 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ProcessPropertiesTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ProcessPropertiesTests.cs @@ -5,7 +5,6 @@ using BenchmarkDotNet.Tests.Loggers; using BenchmarkDotNet.Tests.XUnit; using System.Diagnostics; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ProcessorArchitectureTest.cs b/tests/BenchmarkDotNet.IntegrationTests/ProcessorArchitectureTest.cs index a460b2b249..8a5a07a801 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ProcessorArchitectureTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ProcessorArchitectureTest.cs @@ -1,10 +1,9 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Portability; using BenchmarkDotNet.Tests.Loggers; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/Properties/AssemblyInfo.cs b/tests/BenchmarkDotNet.IntegrationTests/Properties/AssemblyInfo.cs index d781c3ff05..b1e42e7c4c 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/Properties/AssemblyInfo.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; [assembly: Guid("74362bb1-9f64-4be5-b079-b4ac19dae5db")] diff --git a/tests/BenchmarkDotNet.IntegrationTests/R2RTests.cs b/tests/BenchmarkDotNet.IntegrationTests/R2RTests.cs index bda49acdd5..1bac90e0e1 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/R2RTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/R2RTests.cs @@ -6,7 +6,6 @@ using BenchmarkDotNet.Tests.XUnit; using BenchmarkDotNet.Toolchains.DotNetCli; using BenchmarkDotNet.Toolchains.R2R; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs index 491ceea4f6..3adec4f6cb 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ReferencesTests.cs @@ -1,5 +1,3 @@ -using Xunit.Abstractions; - namespace BenchmarkDotNet.IntegrationTests { public class ReferencesTests : BenchmarkTestExecutor diff --git a/tests/BenchmarkDotNet.IntegrationTests/RoslynToolchainTest.cs b/tests/BenchmarkDotNet.IntegrationTests/RoslynToolchainTest.cs index 0ce8a89033..9b8683ac25 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/RoslynToolchainTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/RoslynToolchainTest.cs @@ -3,7 +3,6 @@ using BenchmarkDotNet.Tests.XUnit; using BenchmarkDotNet.Toolchains.Roslyn; using System.Globalization; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/RunAsyncTests.cs b/tests/BenchmarkDotNet.IntegrationTests/RunAsyncTests.cs index 54a260491e..62a21b6707 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/RunAsyncTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/RunAsyncTests.cs @@ -1,23 +1,22 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.InProcess.Emit; using BenchmarkDotNet.Toolchains.InProcess.NoEmit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests; public class RunAsyncTests(ITestOutputHelper output) : BenchmarkTestExecutor(output) { - public static TheoryData GetToolchains() => + public static TheoryData GetToolchains() => new( [ new InProcessEmitToolchain(new() { ExecuteOnSeparateThread = false }), new InProcessEmitToolchain(new() { ExecuteOnSeparateThread = true }), new InProcessNoEmitToolchain(new() { ExecuteOnSeparateThread = false }), new InProcessNoEmitToolchain(new() { ExecuteOnSeparateThread = true }), Job.Default.GetToolchain() - ]; + ]); [Theory] [MemberData(nameof(GetToolchains), DisableDiscoveryEnumeration = true)] diff --git a/tests/BenchmarkDotNet.IntegrationTests/RunStrategyTests.cs b/tests/BenchmarkDotNet.IntegrationTests/RunStrategyTests.cs index 1ee8323c64..7dda79deac 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/RunStrategyTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/RunStrategyTests.cs @@ -1,10 +1,9 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Tests.Loggers; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/SetupAndCleanupTests.cs b/tests/BenchmarkDotNet.IntegrationTests/SetupAndCleanupTests.cs index f202c080aa..1c64b63ffd 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/SetupAndCleanupTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/SetupAndCleanupTests.cs @@ -1,7 +1,6 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Jobs; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/StandardErrorTests.cs b/tests/BenchmarkDotNet.IntegrationTests/StandardErrorTests.cs index 91ce6dabe6..fbd8b2dca9 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/StandardErrorTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/StandardErrorTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Tests.Loggers; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/StatResultExtenderTests.cs b/tests/BenchmarkDotNet.IntegrationTests/StatResultExtenderTests.cs index 7517201fe5..5ceb3e30cb 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/StatResultExtenderTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/StatResultExtenderTests.cs @@ -1,10 +1,9 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Tests.Loggers; using Perfolizer.Horology; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs index 7bcf755ecd..0bd846416a 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/TailCallDiagnoserTests.cs @@ -12,7 +12,6 @@ using System.Collections.Generic; using System.Linq; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs b/tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs index 920d089b94..066ec3399f 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ThreadingDiagnoserTests.cs @@ -18,7 +18,6 @@ using BenchmarkDotNet.IntegrationTests.Xunit; using BenchmarkDotNet.Portability; using Xunit; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ToolchainTest.cs b/tests/BenchmarkDotNet.IntegrationTests/ToolchainTest.cs index 67788c378f..ec10b6ba8b 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ToolchainTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ToolchainTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Loggers; @@ -7,7 +7,6 @@ using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.Parameters; using BenchmarkDotNet.Toolchains.Results; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ValidatorsTest.cs b/tests/BenchmarkDotNet.IntegrationTests/ValidatorsTest.cs index d591bdbed8..3aa3083d55 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ValidatorsTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ValidatorsTest.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Exporters; using BenchmarkDotNet.Exporters.Csv; @@ -7,7 +7,6 @@ using BenchmarkDotNet.Exporters.Xml; using BenchmarkDotNet.Loggers; using BenchmarkDotNet.Validators; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/ValuesReturnedByBenchmarkTest.cs b/tests/BenchmarkDotNet.IntegrationTests/ValuesReturnedByBenchmarkTest.cs index 2659d92b44..6c35a91748 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/ValuesReturnedByBenchmarkTest.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/ValuesReturnedByBenchmarkTest.cs @@ -1,11 +1,10 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.InProcess.Emit; using System.Collections.Immutable; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { diff --git a/tests/BenchmarkDotNet.IntegrationTests/WakeLockTests.cs b/tests/BenchmarkDotNet.IntegrationTests/WakeLockTests.cs index d2d5ce6cf6..f9cc6fef84 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/WakeLockTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/WakeLockTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Helpers; using BenchmarkDotNet.Running; @@ -6,7 +6,6 @@ using BenchmarkDotNet.Tests.XUnit; using System.Diagnostics; using System.Runtime.Versioning; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests; diff --git a/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs b/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs index a5d1798bfb..3cce2158d2 100644 --- a/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs +++ b/tests/BenchmarkDotNet.IntegrationTests/WasmTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Environments; using BenchmarkDotNet.IntegrationTests.Diagnosers; @@ -9,7 +9,6 @@ using BenchmarkDotNet.Toolchains.DotNetCli; using BenchmarkDotNet.Toolchains.MonoAotLLVM; using BenchmarkDotNet.Toolchains.MonoWasm; -using Xunit.Abstractions; namespace BenchmarkDotNet.IntegrationTests { @@ -99,4 +98,4 @@ public void Check() } } } -} +} \ No newline at end of file diff --git a/tests/BenchmarkDotNet.Tests/Analysers/OutliersAnalyserTests.cs b/tests/BenchmarkDotNet.Tests/Analysers/OutliersAnalyserTests.cs index 7d76b49dc4..511297f45e 100644 --- a/tests/BenchmarkDotNet.Tests/Analysers/OutliersAnalyserTests.cs +++ b/tests/BenchmarkDotNet.Tests/Analysers/OutliersAnalyserTests.cs @@ -2,7 +2,6 @@ using BenchmarkDotNet.Helpers; using BenchmarkDotNet.Mathematics; using Perfolizer.Horology; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Analysers { diff --git a/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj b/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj old mode 100755 new mode 100644 index ab52a99e1f..79027728ba --- a/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj +++ b/tests/BenchmarkDotNet.Tests/BenchmarkDotNet.Tests.csproj @@ -3,6 +3,7 @@ BenchmarkDotNet.Tests net8.0;net10.0;net472 + Exe BenchmarkDotNet.Tests BenchmarkDotNet.Tests true @@ -16,13 +17,8 @@ - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + diff --git a/tests/BenchmarkDotNet.Tests/Columns/RatioColumnTest.cs b/tests/BenchmarkDotNet.Tests/Columns/RatioColumnTest.cs index c9aaac1c52..a02960ff73 100644 --- a/tests/BenchmarkDotNet.Tests/Columns/RatioColumnTest.cs +++ b/tests/BenchmarkDotNet.Tests/Columns/RatioColumnTest.cs @@ -1,7 +1,6 @@ using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Reports; using BenchmarkDotNet.Tests.Mocks; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Columns { diff --git a/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs b/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs index a6998db18b..6460648c2d 100644 --- a/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs +++ b/tests/BenchmarkDotNet.Tests/ConfigParserTests.cs @@ -1,4 +1,4 @@ -using AwesomeAssertions; +using AwesomeAssertions; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.ConsoleArguments; @@ -21,7 +21,6 @@ using BenchmarkDotNet.Toolchains.NativeAot; using Perfolizer.Horology; using System.Reflection; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests { diff --git a/tests/BenchmarkDotNet.Tests/Configs/CategoriesTests.cs b/tests/BenchmarkDotNet.Tests/Configs/CategoriesTests.cs index 0f06425276..485b0e6942 100644 --- a/tests/BenchmarkDotNet.Tests/Configs/CategoriesTests.cs +++ b/tests/BenchmarkDotNet.Tests/Configs/CategoriesTests.cs @@ -2,7 +2,6 @@ using BenchmarkDotNet.Configs; using BenchmarkDotNet.Running; using System.Reflection; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Configs { diff --git a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs index eacb726fd6..0d919f3841 100644 --- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs +++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/LinuxCpuInfoParserTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Detectors.Cpu.Linux; using Perfolizer.Models; -using Xunit.Abstractions; using static Perfolizer.Horology.Frequency; namespace BenchmarkDotNet.Tests.Detectors.Cpu; @@ -139,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/Detectors/Cpu/PowershellWmiCpuInfoParserTests.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/PowershellWmiCpuInfoParserTests.cs index fd9d1cc5cf..cb7313ffc9 100644 --- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/PowershellWmiCpuInfoParserTests.cs +++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/PowershellWmiCpuInfoParserTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Detectors.Cpu.Windows; using Perfolizer.Models; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Detectors.Cpu; @@ -36,13 +35,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 = PowershellWmiCpuInfoParser.Parse(cpuInfo); diff --git a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/SysctlCpuInfoParserTests.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/SysctlCpuInfoParserTests.cs index 2b2a4b32af..5d3795bbfd 100644 --- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/SysctlCpuInfoParserTests.cs +++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/SysctlCpuInfoParserTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Detectors.Cpu.macOS; using Perfolizer.Models; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Detectors.Cpu; diff --git a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/TestHelper.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/TestHelper.cs index 229a996641..7d56657417 100644 --- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/TestHelper.cs +++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/TestHelper.cs @@ -1,8 +1,7 @@ -using JetBrains.Annotations; +using JetBrains.Annotations; using Perfolizer.Helpers; using Perfolizer.Models; using System.Reflection; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Detectors.Cpu; diff --git a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/WmicCpuInfoParserTests.cs b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/WmicCpuInfoParserTests.cs index 5a053da2cd..49f6832e8c 100644 --- a/tests/BenchmarkDotNet.Tests/Detectors/Cpu/WmicCpuInfoParserTests.cs +++ b/tests/BenchmarkDotNet.Tests/Detectors/Cpu/WmicCpuInfoParserTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Detectors.Cpu.Windows; using Perfolizer.Models; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Detectors.Cpu; diff --git a/tests/BenchmarkDotNet.Tests/Engine/EngineActualStageTests.cs b/tests/BenchmarkDotNet.Tests/Engine/EngineActualStageTests.cs index bba6098896..f6289bdabe 100644 --- a/tests/BenchmarkDotNet.Tests/Engine/EngineActualStageTests.cs +++ b/tests/BenchmarkDotNet.Tests/Engine/EngineActualStageTests.cs @@ -2,7 +2,6 @@ using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Tests.Mocks; using Perfolizer.Horology; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Engine { diff --git a/tests/BenchmarkDotNet.Tests/Engine/EnginePilotStageTests.cs b/tests/BenchmarkDotNet.Tests/Engine/EnginePilotStageTests.cs index f5a200a5b5..09bbc4578a 100644 --- a/tests/BenchmarkDotNet.Tests/Engine/EnginePilotStageTests.cs +++ b/tests/BenchmarkDotNet.Tests/Engine/EnginePilotStageTests.cs @@ -2,7 +2,6 @@ using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Tests.Mocks; using Perfolizer.Horology; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Engine { diff --git a/tests/BenchmarkDotNet.Tests/Engine/EngineWarmupStageTests.cs b/tests/BenchmarkDotNet.Tests/Engine/EngineWarmupStageTests.cs index 4e07cebe4c..445811e5bf 100644 --- a/tests/BenchmarkDotNet.Tests/Engine/EngineWarmupStageTests.cs +++ b/tests/BenchmarkDotNet.Tests/Engine/EngineWarmupStageTests.cs @@ -5,7 +5,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Tests.Mocks; using Perfolizer.Horology; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Engine { diff --git a/tests/BenchmarkDotNet.Tests/Loggers/OutputLogger.cs b/tests/BenchmarkDotNet.Tests/Loggers/OutputLogger.cs index dd1fb48a08..e9020d6e24 100644 --- a/tests/BenchmarkDotNet.Tests/Loggers/OutputLogger.cs +++ b/tests/BenchmarkDotNet.Tests/Loggers/OutputLogger.cs @@ -1,6 +1,6 @@ -using BenchmarkDotNet.Loggers; +using BenchmarkDotNet.Loggers; using System.Runtime.CompilerServices; -using Xunit.Abstractions; +using Xunit; namespace BenchmarkDotNet.Tests.Loggers { diff --git a/tests/BenchmarkDotNet.Tests/Mathematics/StatisticsTests.cs b/tests/BenchmarkDotNet.Tests/Mathematics/StatisticsTests.cs index 65b971d3ab..5824f75b7c 100644 --- a/tests/BenchmarkDotNet.Tests/Mathematics/StatisticsTests.cs +++ b/tests/BenchmarkDotNet.Tests/Mathematics/StatisticsTests.cs @@ -2,7 +2,6 @@ using BenchmarkDotNet.Tests.Common; using JetBrains.Annotations; using Pragmastat.Exceptions; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Mathematics; diff --git a/tests/BenchmarkDotNet.Tests/Mocks/MockEngine.cs b/tests/BenchmarkDotNet.Tests/Mocks/MockEngine.cs index 4098ccd79f..59dcb72633 100644 --- a/tests/BenchmarkDotNet.Tests/Mocks/MockEngine.cs +++ b/tests/BenchmarkDotNet.Tests/Mocks/MockEngine.cs @@ -1,10 +1,9 @@ -using BenchmarkDotNet.Characteristics; +using BenchmarkDotNet.Characteristics; using BenchmarkDotNet.Engines; using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Reports; using BenchmarkDotNet.Running; using Perfolizer.Horology; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Mocks { diff --git a/tests/BenchmarkDotNet.Tests/Mocks/MockRunner.cs b/tests/BenchmarkDotNet.Tests/Mocks/MockRunner.cs index 9353bfe005..b5d9788ef2 100644 --- a/tests/BenchmarkDotNet.Tests/Mocks/MockRunner.cs +++ b/tests/BenchmarkDotNet.Tests/Mocks/MockRunner.cs @@ -7,7 +7,6 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Tests.Helpers; using BenchmarkDotNet.Tests.Mocks.Toolchain; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Mocks { diff --git a/tests/BenchmarkDotNet.Tests/Perfonar/PerfonarTests.cs b/tests/BenchmarkDotNet.Tests/Perfonar/PerfonarTests.cs index b78d29fd8c..81d35e488d 100644 --- a/tests/BenchmarkDotNet.Tests/Perfonar/PerfonarTests.cs +++ b/tests/BenchmarkDotNet.Tests/Perfonar/PerfonarTests.cs @@ -9,7 +9,6 @@ using Perfolizer.Models; using Perfolizer.Perfonar.Base; using Perfolizer.Perfonar.Tables; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Perfonar; diff --git a/tests/BenchmarkDotNet.Tests/Reports/ColumnTests.cs b/tests/BenchmarkDotNet.Tests/Reports/ColumnTests.cs index b95df5322d..29c80c4669 100644 --- a/tests/BenchmarkDotNet.Tests/Reports/ColumnTests.cs +++ b/tests/BenchmarkDotNet.Tests/Reports/ColumnTests.cs @@ -5,7 +5,6 @@ using BenchmarkDotNet.Reports; using BenchmarkDotNet.Tests.Helpers; using BenchmarkDotNet.Tests.Mocks; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Reports { diff --git a/tests/BenchmarkDotNet.Tests/Reports/DefaultColumnProvidersTests.cs b/tests/BenchmarkDotNet.Tests/Reports/DefaultColumnProvidersTests.cs index 454dc99960..3b516fe4f6 100644 --- a/tests/BenchmarkDotNet.Tests/Reports/DefaultColumnProvidersTests.cs +++ b/tests/BenchmarkDotNet.Tests/Reports/DefaultColumnProvidersTests.cs @@ -6,7 +6,6 @@ using BenchmarkDotNet.Reports; using BenchmarkDotNet.Tests.Helpers; using BenchmarkDotNet.Tests.Mocks; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Reports { diff --git a/tests/BenchmarkDotNet.Tests/Reports/DisplayPrecisionManagerTests.cs b/tests/BenchmarkDotNet.Tests/Reports/DisplayPrecisionManagerTests.cs index f70f8c075d..20bb87fa88 100644 --- a/tests/BenchmarkDotNet.Tests/Reports/DisplayPrecisionManagerTests.cs +++ b/tests/BenchmarkDotNet.Tests/Reports/DisplayPrecisionManagerTests.cs @@ -1,6 +1,5 @@ using BenchmarkDotNet.Reports; using JetBrains.Annotations; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Reports { diff --git a/tests/BenchmarkDotNet.Tests/Reports/RatioPrecisionTests.cs b/tests/BenchmarkDotNet.Tests/Reports/RatioPrecisionTests.cs index 4beeedf5cc..01a346aeb4 100644 --- a/tests/BenchmarkDotNet.Tests/Reports/RatioPrecisionTests.cs +++ b/tests/BenchmarkDotNet.Tests/Reports/RatioPrecisionTests.cs @@ -1,4 +1,4 @@ -using BenchmarkDotNet.Attributes; +using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Engines; @@ -11,7 +11,6 @@ using BenchmarkDotNet.Toolchains; using BenchmarkDotNet.Toolchains.Results; using System.Collections.Immutable; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Reports { diff --git a/tests/BenchmarkDotNet.Tests/Reports/RatioStyleTests.cs b/tests/BenchmarkDotNet.Tests/Reports/RatioStyleTests.cs index f47df0244d..2ae4cd9c52 100644 --- a/tests/BenchmarkDotNet.Tests/Reports/RatioStyleTests.cs +++ b/tests/BenchmarkDotNet.Tests/Reports/RatioStyleTests.cs @@ -12,7 +12,6 @@ using BenchmarkDotNet.Toolchains.Results; using JetBrains.Annotations; using System.Collections.Immutable; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Reports { diff --git a/tests/BenchmarkDotNet.Tests/Reports/SummaryTableTests.cs b/tests/BenchmarkDotNet.Tests/Reports/SummaryTableTests.cs index fb96014ea6..a8d98cf547 100644 --- a/tests/BenchmarkDotNet.Tests/Reports/SummaryTableTests.cs +++ b/tests/BenchmarkDotNet.Tests/Reports/SummaryTableTests.cs @@ -8,7 +8,6 @@ using BenchmarkDotNet.Reports; using BenchmarkDotNet.Tests.Helpers; using BenchmarkDotNet.Tests.Mocks; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests.Reports { diff --git a/tests/BenchmarkDotNet.Tests/SourceCodeHelperTests.cs b/tests/BenchmarkDotNet.Tests/SourceCodeHelperTests.cs index a4509dc722..0770a34f93 100644 --- a/tests/BenchmarkDotNet.Tests/SourceCodeHelperTests.cs +++ b/tests/BenchmarkDotNet.Tests/SourceCodeHelperTests.cs @@ -1,6 +1,5 @@ -using BenchmarkDotNet.Helpers; +using BenchmarkDotNet.Helpers; using System.Reflection; -using Xunit.Abstractions; namespace BenchmarkDotNet.Tests { diff --git a/tests/BenchmarkDotNet.Tests/TypeFilterTests.cs b/tests/BenchmarkDotNet.Tests/TypeFilterTests.cs index 4407c21f17..04bb6c4778 100644 --- a/tests/BenchmarkDotNet.Tests/TypeFilterTests.cs +++ b/tests/BenchmarkDotNet.Tests/TypeFilterTests.cs @@ -5,7 +5,6 @@ using BenchmarkDotNet.Tests; using BenchmarkDotNet.Tests.Loggers; using JetBrains.Annotations; -using Xunit.Abstractions; using TypeFilter = BenchmarkDotNet.Running.TypeFilter; namespace BenchmarkDotNet.Tests diff --git a/tests/BenchmarkDotNet.Tests/Validators/ParamsValidatorTests.cs b/tests/BenchmarkDotNet.Tests/Validators/ParamsValidatorTests.cs index 6b3bbac76d..f61d881f9a 100644 --- a/tests/BenchmarkDotNet.Tests/Validators/ParamsValidatorTests.cs +++ b/tests/BenchmarkDotNet.Tests/Validators/ParamsValidatorTests.cs @@ -2,7 +2,7 @@ using BenchmarkDotNet.Running; using BenchmarkDotNet.Validators; using System.Diagnostics.CodeAnalysis; -using Xunit.Abstractions; + #pragma warning disable CS0414 namespace BenchmarkDotNet.Tests.Validators diff --git a/tests/BenchmarkDotNet.Tests/XUnit/FactEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/XUnit/FactEnvSpecific.cs index 5fa7ffab52..a0e02d4c07 100644 --- a/tests/BenchmarkDotNet.Tests/XUnit/FactEnvSpecific.cs +++ b/tests/BenchmarkDotNet.Tests/XUnit/FactEnvSpecific.cs @@ -1,3 +1,4 @@ +using System.Runtime.CompilerServices; using Xunit; namespace BenchmarkDotNet.Tests.XUnit; @@ -15,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/XUnit/InlineDataEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/XUnit/InlineDataEnvSpecific.cs index 9c9bbf70e1..8f9419f5c0 100644 --- a/tests/BenchmarkDotNet.Tests/XUnit/InlineDataEnvSpecific.cs +++ b/tests/BenchmarkDotNet.Tests/XUnit/InlineDataEnvSpecific.cs @@ -1,24 +1,53 @@ -using System.Reflection; +using System.Reflection; +using Xunit; using Xunit.Sdk; +using Xunit.v3; namespace BenchmarkDotNet.Tests.XUnit; -[DataDiscoverer("BenchmarkDotNet.Tests.XUnit.InlineDataEnvSpecificDiscoverer", "BenchmarkDotNet.Tests")] [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] public class InlineDataEnvSpecific : DataAttribute { - readonly object[] data; + /// + /// 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) + public InlineDataEnvSpecific(object? data, string reason, params EnvRequirement[] requirements) : this([data], reason, requirements) { } - public InlineDataEnvSpecific(object[] data, string reason, params EnvRequirement[] requirements) + public InlineDataEnvSpecific(object?[] data, string reason, params EnvRequirement[] requirements) { - this.data = data; + // 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 IEnumerable GetData(MethodInfo testMethod) => [data]; + 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; } diff --git a/tests/BenchmarkDotNet.Tests/XUnit/InlineDataEnvSpecificDiscoverer.cs b/tests/BenchmarkDotNet.Tests/XUnit/InlineDataEnvSpecificDiscoverer.cs deleted file mode 100644 index c65c2d2a68..0000000000 --- a/tests/BenchmarkDotNet.Tests/XUnit/InlineDataEnvSpecificDiscoverer.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Xunit.Abstractions; -using Xunit.Sdk; - -namespace BenchmarkDotNet.Tests.XUnit; - -public class InlineDataEnvSpecificDiscoverer : IDataDiscoverer -{ - public IEnumerable GetData(IAttributeInfo dataAttribute, IMethodInfo testMethod) - { - // InlineDataEnvSpecific has two constructors: - // 1. InlineDataEnvSpecific(object data, string reason, params EnvRequirement[] requirements) - // 2. InlineDataEnvSpecific(object[] data, string reason, params EnvRequirement[] requirements) - // GetConstructorArguments returns arguments from the constructor that was actually called - - var args = dataAttribute.GetConstructorArguments().ToArray(); - if (args.Length == 0) - yield break; - - // First argument is either a single object or object[] - wrap accordingly - if (args[0] is object[] dataArray) - { - // Array constructor was used - yield return dataArray; - } - else - { - // Single object constructor was used - wrap in array - yield return new[] { args[0] }; - } - } - - public bool SupportsDiscoveryEnumeration(IAttributeInfo dataAttribute, IMethodInfo testMethod) => true; -} diff --git a/tests/BenchmarkDotNet.Tests/XUnit/TheoryEnvSpecific.cs b/tests/BenchmarkDotNet.Tests/XUnit/TheoryEnvSpecific.cs index 1d0681036f..92f039f030 100644 --- a/tests/BenchmarkDotNet.Tests/XUnit/TheoryEnvSpecific.cs +++ b/tests/BenchmarkDotNet.Tests/XUnit/TheoryEnvSpecific.cs @@ -1,3 +1,4 @@ +using System.Runtime.CompilerServices; using Xunit; namespace BenchmarkDotNet.Tests.XUnit; @@ -15,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 diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 95b878006d..7192d1f6ff 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -10,6 +10,10 @@ $([System.IO.Path]::GetDirectoryName($(MSBuildThisFileDirectory))) + + + + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets new file mode 100644 index 0000000000..be5cd7eabe --- /dev/null +++ b/tests/Directory.Build.targets @@ -0,0 +1,14 @@ + + + + true + + + + + + + +