Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions .github/workflows/speed-comparison.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,36 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Build All Frameworks
run: |
dotnet build -c Release -p:TestFramework=TUNIT --framework net8.0
dotnet build -c Release -p:TestFramework=TUNIT --framework net9.0
dotnet build -c Release -p:TestFramework=TUNIT --framework net10.0
dotnet build -c Release -p:TestFramework=XUNIT --framework net8.0
dotnet build -c Release -p:TestFramework=XUNIT --framework net9.0
dotnet build -c Release -p:TestFramework=XUNIT --framework net10.0
dotnet build -c Release -p:TestFramework=XUNIT3 --framework net8.0
dotnet build -c Release -p:TestFramework=XUNIT3 --framework net9.0
dotnet build -c Release -p:TestFramework=XUNIT3 --framework net10.0
dotnet build -c Release -p:TestFramework=NUNIT --framework net8.0
dotnet build -c Release -p:TestFramework=NUNIT --framework net9.0
dotnet build -c Release -p:TestFramework=NUNIT --framework net10.0
dotnet build -c Release -p:TestFramework=MSTEST --framework net8.0
dotnet build -c Release -p:TestFramework=MSTEST --framework net9.0
dotnet build -c Release -p:TestFramework=MSTEST --framework net10.0
working-directory: "tools/speed-comparison/UnifiedTests"

- name: Publish TUnit AOT
run: |
dotnet publish -c Release -p:TestFramework=TUNIT -p:Aot=true --framework net8.0 --runtime ${{ matrix.os == 'windows-latest' && 'win-x64' || matrix.os == 'ubuntu-latest' && 'linux-x64' || 'osx-arm64' }} --output bin/Release-TUNIT-AOT/net8.0
dotnet publish -c Release -p:TestFramework=TUNIT -p:Aot=true --framework net9.0 --runtime ${{ matrix.os == 'windows-latest' && 'win-x64' || matrix.os == 'ubuntu-latest' && 'linux-x64' || 'osx-arm64' }} --output bin/Release-TUNIT-AOT/net9.0
dotnet publish -c Release -p:TestFramework=TUNIT -p:Aot=true --framework net10.0 --runtime ${{ matrix.os == 'windows-latest' && 'win-x64' || matrix.os == 'ubuntu-latest' && 'linux-x64' || 'osx-arm64' }} --output bin/Release-TUNIT-AOT/net10.0
working-directory: "tools/speed-comparison/UnifiedTests"

- name: Run Benchmark
run: dotnet run -c Release --framework net9.0 --allCategories=Runtime
run: dotnet run -c Release --framework net10.0 --allCategories=Runtime
working-directory: "tools/speed-comparison/Tests.Benchmark"
env:
CLASS_NAME: ${{ matrix.class }}
Expand Down Expand Up @@ -83,15 +89,15 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Prepare builds
run: |
dotnet restore UnifiedTests/UnifiedTests.csproj
working-directory: "tools/speed-comparison"

- name: Run Benchmark
run: dotnet run -c Release --allCategories=Build --framework net9.0
run: dotnet run -c Release --allCategories=Build --framework net10.0
working-directory: "tools/speed-comparison/Tests.Benchmark"

- name: Upload Markdown
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Condition="'$(TargetFramework)' == '' and '$(TargetFrameworks)' == ''">
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageVersion Include="CliWrap" Version="3.9.0" />
<PackageVersion Include="EnumerableAsyncProcessor" Version="3.8.4" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageVersion Include="FSharp.Core" Version="9.0.303" />
<PackageVersion Include="FSharp.Core" Version="10.0.100-preview7.25451.107" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="MessagePack" Version="3.1.4" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
Expand Down
2 changes: 1 addition & 1 deletion Library.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

Expand Down
6 changes: 6 additions & 0 deletions TUnit.Analyzers.Tests/TUnit.Analyzers.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@
<Reference Include="$(PkgMicrosoft_CodeAnalysis_NetAnalyzers)\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" VersionOverride="9.0.0" PrivateAssets="all" GeneratePathProperty="true" />
<Reference Include="$(PkgMicrosoft_CodeAnalysis_NetAnalyzers)\analyzers\dotnet\cs\Microsoft.CodeAnalysis.NetAnalyzers.dll" />
<Reference Include="$(PkgMicrosoft_CodeAnalysis_NetAnalyzers)\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" />
</ItemGroup>

<Import Project="..\TestProject.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
// <auto-generated/>
#pragma warning disable

#nullable enable
namespace TUnit.Generated;
internal sealed class BasicTests_SynchronousTest_TestSource_GUID : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource
{
public async global::System.Collections.Generic.IAsyncEnumerable<global::TUnit.Core.TestMetadata> GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var metadata = new global::TUnit.Core.TestMetadata<global::TUnit.TestProject.BasicTests>
{
TestName = "SynchronousTest",
TestClassType = typeof(global::TUnit.TestProject.BasicTests),
TestMethodName = "SynchronousTest",
Dependencies = global::System.Array.Empty<global::TUnit.Core.TestDependency>(),
AttributeFactory = () =>
[
new global::TUnit.Core.TestAttribute()
],
DataSources = global::System.Array.Empty<global::TUnit.Core.IDataSourceAttribute>(),
ClassDataSources = global::System.Array.Empty<global::TUnit.Core.IDataSourceAttribute>(),
PropertyDataSources = global::System.Array.Empty<global::TUnit.Core.PropertyDataSource>(),
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
InheritanceDepth = 0,
FilePath = @"",
LineNumber = 5,
MethodMetadata = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BasicTests),
TypeReference = global::TUnit.Core.TypeReference.CreateConcrete("TUnit.TestProject.BasicTests, TestsBase`1"),
Name = "SynchronousTest",
GenericTypeCount = 0,
ReturnType = typeof(void),
ReturnTypeReference = global::TUnit.Core.TypeReference.CreateConcrete("void, System.Private.CoreLib"),
Parameters = global::System.Array.Empty<global::TUnit.Core.ParameterMetadata>(),
Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BasicTests", () =>
{
var classMetadata = new global::TUnit.Core.ClassMetadata
{
Type = typeof(global::TUnit.TestProject.BasicTests),
TypeReference = global::TUnit.Core.TypeReference.CreateConcrete("TUnit.TestProject.BasicTests, TestsBase`1"),
Name = "BasicTests",
Namespace = "TUnit.TestProject",
Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
Parameters = global::System.Array.Empty<global::TUnit.Core.ParameterMetadata>(),
Properties = global::System.Array.Empty<global::TUnit.Core.PropertyMetadata>(),
Parent = null
};
foreach (var prop in classMetadata.Properties)
{
prop.ClassMetadata = classMetadata;
prop.ContainingTypeMetadata = classMetadata;
}
return classMetadata;
})
},
InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(),
InvokeTypedTest = async (instance, args, cancellationToken) =>
{
instance.SynchronousTest();
await global::System.Threading.Tasks.Task.CompletedTask;
},
};
metadata.UseRuntimeDataGeneration(testSessionId);
yield return metadata;
yield break;
}
}
internal static class BasicTests_SynchronousTest_ModuleInitializer_GUID
{
[global::System.Runtime.CompilerServices.ModuleInitializer]
public static void Initialize()
{
global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), new BasicTests_SynchronousTest_TestSource_GUID());
}
}


// ===== FILE SEPARATOR =====

// <auto-generated/>
#pragma warning disable

#nullable enable
namespace TUnit.Generated;
internal sealed class BasicTests_AsynchronousTest_TestSource_GUID : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource
{
public async global::System.Collections.Generic.IAsyncEnumerable<global::TUnit.Core.TestMetadata> GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var metadata = new global::TUnit.Core.TestMetadata<global::TUnit.TestProject.BasicTests>
{
TestName = "AsynchronousTest",
TestClassType = typeof(global::TUnit.TestProject.BasicTests),
TestMethodName = "AsynchronousTest",
Dependencies = global::System.Array.Empty<global::TUnit.Core.TestDependency>(),
AttributeFactory = () =>
[
new global::TUnit.Core.TestAttribute()
],
DataSources = global::System.Array.Empty<global::TUnit.Core.IDataSourceAttribute>(),
ClassDataSources = global::System.Array.Empty<global::TUnit.Core.IDataSourceAttribute>(),
PropertyDataSources = global::System.Array.Empty<global::TUnit.Core.PropertyDataSource>(),
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
InheritanceDepth = 0,
FilePath = @"",
LineNumber = 11,
MethodMetadata = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BasicTests),
TypeReference = global::TUnit.Core.TypeReference.CreateConcrete("TUnit.TestProject.BasicTests, TestsBase`1"),
Name = "AsynchronousTest",
GenericTypeCount = 0,
ReturnType = typeof(global::System.Threading.Tasks.Task),
ReturnTypeReference = global::TUnit.Core.TypeReference.CreateConcrete("System.Threading.Tasks.Task, System.Private.CoreLib"),
Parameters = global::System.Array.Empty<global::TUnit.Core.ParameterMetadata>(),
Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BasicTests", () =>
{
var classMetadata = new global::TUnit.Core.ClassMetadata
{
Type = typeof(global::TUnit.TestProject.BasicTests),
TypeReference = global::TUnit.Core.TypeReference.CreateConcrete("TUnit.TestProject.BasicTests, TestsBase`1"),
Name = "BasicTests",
Namespace = "TUnit.TestProject",
Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
Parameters = global::System.Array.Empty<global::TUnit.Core.ParameterMetadata>(),
Properties = global::System.Array.Empty<global::TUnit.Core.PropertyMetadata>(),
Parent = null
};
foreach (var prop in classMetadata.Properties)
{
prop.ClassMetadata = classMetadata;
prop.ContainingTypeMetadata = classMetadata;
}
return classMetadata;
})
},
InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(),
InvokeTypedTest = async (instance, args, cancellationToken) =>
{
await instance.AsynchronousTest();
},
};
metadata.UseRuntimeDataGeneration(testSessionId);
yield return metadata;
yield break;
}
}
internal static class BasicTests_AsynchronousTest_ModuleInitializer_GUID
{
[global::System.Runtime.CompilerServices.ModuleInitializer]
public static void Initialize()
{
global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), new BasicTests_AsynchronousTest_TestSource_GUID());
}
}


// ===== FILE SEPARATOR =====

// <auto-generated/>
#pragma warning disable

#nullable enable
namespace TUnit.Generated;
internal sealed class BasicTests_ValueTaskAsynchronousTest_TestSource_GUID : global::TUnit.Core.Interfaces.SourceGenerator.ITestSource
{
public async global::System.Collections.Generic.IAsyncEnumerable<global::TUnit.Core.TestMetadata> GetTestsAsync(string testSessionId, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
{
var metadata = new global::TUnit.Core.TestMetadata<global::TUnit.TestProject.BasicTests>
{
TestName = "ValueTaskAsynchronousTest",
TestClassType = typeof(global::TUnit.TestProject.BasicTests),
TestMethodName = "ValueTaskAsynchronousTest",
Dependencies = global::System.Array.Empty<global::TUnit.Core.TestDependency>(),
AttributeFactory = () =>
[
new global::TUnit.Core.TestAttribute()
],
DataSources = global::System.Array.Empty<global::TUnit.Core.IDataSourceAttribute>(),
ClassDataSources = global::System.Array.Empty<global::TUnit.Core.IDataSourceAttribute>(),
PropertyDataSources = global::System.Array.Empty<global::TUnit.Core.PropertyDataSource>(),
PropertyInjections = global::System.Array.Empty<global::TUnit.Core.PropertyInjectionData>(),
InheritanceDepth = 0,
FilePath = @"",
LineNumber = 17,
MethodMetadata = new global::TUnit.Core.MethodMetadata
{
Type = typeof(global::TUnit.TestProject.BasicTests),
TypeReference = global::TUnit.Core.TypeReference.CreateConcrete("TUnit.TestProject.BasicTests, TestsBase`1"),
Name = "ValueTaskAsynchronousTest",
GenericTypeCount = 0,
ReturnType = typeof(global::System.Threading.Tasks.ValueTask),
ReturnTypeReference = global::TUnit.Core.TypeReference.CreateConcrete("System.Threading.Tasks.ValueTask, System.Private.CoreLib"),
Parameters = global::System.Array.Empty<global::TUnit.Core.ParameterMetadata>(),
Class = global::TUnit.Core.ClassMetadata.GetOrAdd("TestsBase`1:global::TUnit.TestProject.BasicTests", () =>
{
var classMetadata = new global::TUnit.Core.ClassMetadata
{
Type = typeof(global::TUnit.TestProject.BasicTests),
TypeReference = global::TUnit.Core.TypeReference.CreateConcrete("TUnit.TestProject.BasicTests, TestsBase`1"),
Name = "BasicTests",
Namespace = "TUnit.TestProject",
Assembly = global::TUnit.Core.AssemblyMetadata.GetOrAdd("TestsBase`1", () => new global::TUnit.Core.AssemblyMetadata { Name = "TestsBase`1" }),
Parameters = global::System.Array.Empty<global::TUnit.Core.ParameterMetadata>(),
Properties = global::System.Array.Empty<global::TUnit.Core.PropertyMetadata>(),
Parent = null
};
foreach (var prop in classMetadata.Properties)
{
prop.ClassMetadata = classMetadata;
prop.ContainingTypeMetadata = classMetadata;
}
return classMetadata;
})
},
InstanceFactory = (typeArgs, args) => new global::TUnit.TestProject.BasicTests(),
InvokeTypedTest = async (instance, args, cancellationToken) =>
{
await instance.ValueTaskAsynchronousTest();
},
};
metadata.UseRuntimeDataGeneration(testSessionId);
yield return metadata;
yield break;
}
}
internal static class BasicTests_ValueTaskAsynchronousTest_ModuleInitializer_GUID
{
[global::System.Runtime.CompilerServices.ModuleInitializer]
public static void Initialize()
{
global::TUnit.Core.SourceRegistrar.Register(typeof(global::TUnit.TestProject.BasicTests), new BasicTests_ValueTaskAsynchronousTest_TestSource_GUID());
}
}
Loading
Loading