[build] Add BenchmarkDotNet.Exporters.Plotting.Tests to unit-tests
This commit is contained in:
Родитель
834417a7db
Коммит
15200d46a1
|
@ -1,4 +1,7 @@
|
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue"><Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue"><Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy></s:String>
|
||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nupkg/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
|
@ -7,28 +7,25 @@ using Cake.Core.IO;
|
|||
|
||||
namespace BenchmarkDotNet.Build.Runners;
|
||||
|
||||
public class UnitTestRunner
|
||||
public class UnitTestRunner(BuildContext context)
|
||||
{
|
||||
private readonly BuildContext context;
|
||||
private FilePath UnitTestsProjectFile { get; } = context.RootDirectory
|
||||
.Combine("tests")
|
||||
.Combine("BenchmarkDotNet.Tests")
|
||||
.CombineWithFilePath("BenchmarkDotNet.Tests.csproj");
|
||||
|
||||
private FilePath UnitTestsProjectFile { get; }
|
||||
private FilePath IntegrationTestsProjectFile { get; }
|
||||
private DirectoryPath TestOutputDirectory { get; }
|
||||
private FilePath ExporterTestsProjectFile { get; } = context.RootDirectory
|
||||
.Combine("tests")
|
||||
.Combine("BenchmarkDotNet.Exporters.Plotting.Tests")
|
||||
.CombineWithFilePath("BenchmarkDotNet.Exporters.Plotting.Tests.csproj");
|
||||
|
||||
public UnitTestRunner(BuildContext context)
|
||||
{
|
||||
this.context = context;
|
||||
UnitTestsProjectFile = context.RootDirectory
|
||||
.Combine("tests")
|
||||
.Combine("BenchmarkDotNet.Tests")
|
||||
.CombineWithFilePath("BenchmarkDotNet.Tests.csproj");
|
||||
IntegrationTestsProjectFile = context.RootDirectory
|
||||
.Combine("tests")
|
||||
.Combine("BenchmarkDotNet.IntegrationTests")
|
||||
.CombineWithFilePath("BenchmarkDotNet.IntegrationTests.csproj");
|
||||
TestOutputDirectory = context.RootDirectory
|
||||
.Combine("TestResults");
|
||||
}
|
||||
private FilePath IntegrationTestsProjectFile { get; } = context.RootDirectory
|
||||
.Combine("tests")
|
||||
.Combine("BenchmarkDotNet.IntegrationTests")
|
||||
.CombineWithFilePath("BenchmarkDotNet.IntegrationTests.csproj");
|
||||
|
||||
private DirectoryPath TestOutputDirectory { get; } = context.RootDirectory
|
||||
.Combine("TestResults");
|
||||
|
||||
private DotNetTestSettings GetTestSettingsParameters(FilePath logFile, string tfm)
|
||||
{
|
||||
|
@ -58,14 +55,15 @@ public class UnitTestRunner
|
|||
context.DotNetTest(projectFile.FullPath, settings);
|
||||
}
|
||||
|
||||
private void RunUnitTests(string tfm) => RunTests(UnitTestsProjectFile, "unit", tfm);
|
||||
private void RunUnitTests(string tfm)
|
||||
{
|
||||
RunTests(UnitTestsProjectFile, "unit", tfm);
|
||||
RunTests(ExporterTestsProjectFile, "exporters", tfm);
|
||||
}
|
||||
|
||||
public void RunUnitTests()
|
||||
{
|
||||
var targetFrameworks = context.IsRunningOnWindows()
|
||||
? new[] { "net462", "net8.0" }
|
||||
: new[] { "net8.0" };
|
||||
|
||||
string[] targetFrameworks = context.IsRunningOnWindows() ? ["net462", "net8.0"] : ["net8.0"];
|
||||
foreach (var targetFramework in targetFrameworks)
|
||||
RunUnitTests(targetFramework);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче