Skip to content

Commit 9d4e051

Browse files
committed
Refactor harness system
1 parent 2ddff8d commit 9d4e051

97 files changed

Lines changed: 1267 additions & 1552 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
- Run a single test class: `dotnet test Src/FastData.Tests/FastData.Tests.csproj -c Debug --filter "FullyQualifiedName~Namespace.ClassName"`.
3939
- Optional analyzers (lint-like): `dotnet build FastData.slnx -c Debug -p:RunAnalyzersDuringBuild=true`.
4040
- Run benchmarks: `dotnet run -c Release --project Src/FastData.Benchmarks/FastData.Benchmarks.csproj`.
41-
- Other benchmark projects:
42-
- `dotnet run -c Release --project Src/FastData.Generator.CSharp.Benchmarks/FastData.Generator.CSharp.Benchmarks.csproj`
43-
- `dotnet run -c Release --project Src/FastData.Generator.CPlusPlus.Benchmarks/FastData.Generator.CPlusPlus.Benchmarks.csproj`
44-
- `dotnet run -c Release --project Src/FastData.Generator.Rust.Benchmarks/FastData.Generator.Rust.Benchmarks.csproj`
41+
- Generator benchmark harness:
42+
- `dotnet run -c Release --project Src/FastData.BenchmarkHarness.Runner/FastData.BenchmarkHarness.Runner.csproj`
43+
- `dotnet run -c Release --project Src/FastData.BenchmarkHarness.Runner/FastData.BenchmarkHarness.Runner.csproj CSharp`
44+
- `dotnet run -c Release --project Src/FastData.BenchmarkHarness.Runner/FastData.BenchmarkHarness.Runner.csproj CPlusPlus`
45+
- `dotnet run -c Release --project Src/FastData.BenchmarkHarness.Runner/FastData.BenchmarkHarness.Runner.csproj Rust`
4546
- Run a specific benchmark (BenchmarkDotNet): `dotnet run -c Release --project Src/FastData.Benchmarks/FastData.Benchmarks.csproj -- --filter "*Hash*"`.
4647

4748
## Common Test Examples

FastData.slnx

Lines changed: 91 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,93 @@
11
<Solution>
2-
<Configurations>
3-
<Platform Name="Any CPU" />
4-
<Platform Name="x64" />
5-
<Platform Name="x86" />
6-
</Configurations>
7-
<Folder Name="/Cli/">
8-
<Project Path="Src/FastData.Cli.Tests/FastData.Cli.Tests.csproj" />
9-
<Project Path="Src/FastData.Cli/FastData.Cli.csproj" />
10-
</Folder>
11-
<Folder Name="/Cli/PowerShell/">
12-
<File Path="Misc/PowerShell/FastData.psd1" />
13-
<File Path="Misc/PowerShell/FastData.psm1" />
14-
</Folder>
15-
<Folder Name="/Generators/">
16-
<Project Path="Src/FastData.Generator.CPlusPlus.Benchmarks/FastData.Generator.CPlusPlus.Benchmarks.csproj" />
17-
<Project Path="Src/FastData.Generator.CPlusPlus.TestHarness/FastData.Generator.CPlusPlus.TestHarness.csproj" />
18-
<Project Path="Src/FastData.Generator.CPlusPlus/FastData.Generator.CPlusPlus.csproj" />
19-
<Project Path="Src/FastData.Generator.CSharp.Benchmarks/FastData.Generator.CSharp.Benchmarks.csproj" />
20-
<Project Path="Src/FastData.Generator.CSharp.TestHarness/FastData.Generator.CSharp.TestHarness.csproj" />
21-
<Project Path="Src/FastData.Generator.CSharp/FastData.Generator.CSharp.csproj" />
22-
<Project Path="Src/FastData.Generator.Rust.Benchmarks/FastData.Generator.Rust.Benchmarks.csproj" />
23-
<Project Path="Src/FastData.Generator.Rust.TestHarness/FastData.Generator.Rust.TestHarness.csproj" />
24-
<Project Path="Src/FastData.Generator.Rust/FastData.Generator.Rust.csproj" />
25-
<Project Path="Src/FastData.Generator.Template/FastData.Generator.Template.csproj" />
26-
<Project Path="Src/FastData.Generator.Tests/FastData.Generator.Tests.csproj" />
27-
<Project Path="Src/FastData.Generator/FastData.Generator.csproj" />
28-
</Folder>
29-
<Folder Name="/SourceGenerator/">
30-
<Project Path="Src/FastData.SourceGenerator.Attributes/FastData.SourceGenerator.Attributes.csproj" />
31-
<Project Path="Src/FastData.SourceGenerator.Examples/FastData.SourceGenerator.Examples.csproj" />
32-
<Project Path="Src/FastData.SourceGenerator.Tests/FastData.SourceGenerator.Tests.csproj" />
33-
<Project Path="Src/FastData.SourceGenerator/FastData.SourceGenerator.csproj" />
34-
</Folder>
35-
<Folder Name="/_Docs/">
36-
<File Path="AGENTS.md" />
37-
<File Path="Docs/DataStructures.md" />
38-
<File Path="Docs/HowWork.md" />
39-
<File Path="Docs/Optimizations.md" />
40-
<File Path="README.md" />
41-
</Folder>
42-
<Folder Name="/_Github/">
43-
<File Path=".github/FUNDING.yml" />
44-
</Folder>
45-
<Folder Name="/_Github/IssueTemplates/">
46-
<File Path=".github/ISSUE_TEMPLATE/bug_report.md" />
47-
<File Path=".github/ISSUE_TEMPLATE/feature_request.md" />
48-
</Folder>
49-
<Folder Name="/_Github/Workflows/">
50-
<File Path=".github/workflows/generic-build.yml" />
51-
<File Path=".github/workflows/nuget-release.yml" />
52-
</Folder>
53-
<Folder Name="/_Imports/" />
54-
<Folder Name="/_Imports/Local/">
55-
<File Path="Locals/Benchmarks.props" />
56-
<File Path="Locals/Directory.Build.props" />
57-
<File Path="Locals/Directory.Packages.props" />
58-
<File Path="Locals/Library.props" />
59-
<File Path="Locals/Tests.props" />
60-
</Folder>
61-
<Folder Name="/_Imports/Managed/">
62-
<File Path="Src/Directory.Build.props" />
63-
<File Path="Src/Directory.Build.targets" />
64-
</Folder>
65-
<Folder Name="/_Imports/Managed/Packages/">
66-
<File Path="Src/Directory.Packages.Analyzers.props" />
67-
<File Path="Src/Directory.Packages.props" />
68-
</Folder>
69-
<Folder Name="/_Imports/Managed/Project/">
70-
<File Path="Imports/Benchmarks.props" />
71-
<File Path="Imports/Console.props" />
72-
<File Path="Imports/Examples.props" />
73-
<File Path="Imports/Library.props" />
74-
<File Path="Imports/Tests.props" />
75-
</Folder>
76-
<Folder Name="/_Items/">
77-
<File Path=".editorconfig" />
78-
<File Path=".gitattributes" />
79-
<File Path=".gitignore" />
80-
<File Path=".globalconfig" />
81-
<File Path="LICENSE.txt" />
82-
</Folder>
83-
<Folder Name="/_Scripts/">
84-
<File Path="Scripts/Build.ps1" />
85-
<File Path="Scripts/Install-Gcc.ps1" />
86-
<File Path="Scripts/Install-Rust.ps1" />
87-
<File Path="Scripts/Publish.ps1" />
88-
</Folder>
89-
<Project Path="Src/FastData.Benchmarks/FastData.Benchmarks.csproj" />
90-
<Project Path="Src/FastData.Demo/FastData.Demo.csproj" />
91-
<Project Path="Src/FastData.Examples/FastData.Examples.csproj" />
92-
<Project Path="Src/FastData.InternalShared/FastData.InternalShared.csproj" />
93-
<Project Path="Src/FastData.Testbed/FastData.Testbed.csproj" />
94-
<Project Path="Src/FastData.TestHarness.Runner/FastData.TestHarness.Runner.csproj" />
95-
<Project Path="Src/FastData.Tests/FastData.Tests.csproj" />
96-
<Project Path="Src/FastData/FastData.csproj" />
2+
<Configurations>
3+
<Platform Name="Any CPU" />
4+
<Platform Name="x64" />
5+
<Platform Name="x86" />
6+
</Configurations>
7+
<Folder Name="/Cli/">
8+
<Project Path="Src/FastData.Cli.Tests/FastData.Cli.Tests.csproj" />
9+
<Project Path="Src/FastData.Cli/FastData.Cli.csproj" />
10+
</Folder>
11+
<Folder Name="/Cli/PowerShell/">
12+
<File Path="Misc/PowerShell/FastData.psd1" />
13+
<File Path="Misc/PowerShell/FastData.psm1" />
14+
</Folder>
15+
<Folder Name="/Generators/">
16+
<Project Path="Src/FastData.Generator.CPlusPlus.TestHarness/FastData.Generator.CPlusPlus.TestHarness.csproj" />
17+
<Project Path="Src/FastData.Generator.CPlusPlus/FastData.Generator.CPlusPlus.csproj" />
18+
<Project Path="Src/FastData.Generator.CSharp.TestHarness/FastData.Generator.CSharp.TestHarness.csproj" />
19+
<Project Path="Src/FastData.Generator.CSharp/FastData.Generator.CSharp.csproj" />
20+
<Project Path="Src/FastData.Generator.Rust.TestHarness/FastData.Generator.Rust.TestHarness.csproj" />
21+
<Project Path="Src/FastData.Generator.Rust/FastData.Generator.Rust.csproj" />
22+
<Project Path="Src/FastData.Generator.Template/FastData.Generator.Template.csproj" />
23+
<Project Path="Src/FastData.Generator.Tests/FastData.Generator.Tests.csproj" />
24+
<Project Path="Src/FastData.Generator/FastData.Generator.csproj" />
25+
</Folder>
26+
<Folder Name="/SourceGenerator/">
27+
<Project Path="Src/FastData.SourceGenerator.Attributes/FastData.SourceGenerator.Attributes.csproj" />
28+
<Project Path="Src/FastData.SourceGenerator.Examples/FastData.SourceGenerator.Examples.csproj" />
29+
<Project Path="Src/FastData.SourceGenerator.Tests/FastData.SourceGenerator.Tests.csproj" />
30+
<Project Path="Src/FastData.SourceGenerator/FastData.SourceGenerator.csproj" />
31+
</Folder>
32+
<Folder Name="/_Docs/">
33+
<File Path="AGENTS.md" />
34+
<File Path="Docs/DataStructures.md" />
35+
<File Path="Docs/HowWork.md" />
36+
<File Path="Docs/Optimizations.md" />
37+
<File Path="README.md" />
38+
</Folder>
39+
<Folder Name="/_Github/">
40+
<File Path=".github/FUNDING.yml" />
41+
</Folder>
42+
<Folder Name="/_Github/IssueTemplates/">
43+
<File Path=".github/ISSUE_TEMPLATE/bug_report.md" />
44+
<File Path=".github/ISSUE_TEMPLATE/feature_request.md" />
45+
</Folder>
46+
<Folder Name="/_Github/Workflows/">
47+
<File Path=".github/workflows/generic-build.yml" />
48+
<File Path=".github/workflows/nuget-release.yml" />
49+
</Folder>
50+
<Folder Name="/_Imports/" />
51+
<Folder Name="/_Imports/Local/">
52+
<File Path="Locals/Benchmarks.props" />
53+
<File Path="Locals/Directory.Build.props" />
54+
<File Path="Locals/Directory.Packages.props" />
55+
<File Path="Locals/Library.props" />
56+
<File Path="Locals/Tests.props" />
57+
</Folder>
58+
<Folder Name="/_Imports/Managed/">
59+
<File Path="Src/Directory.Build.props" />
60+
<File Path="Src/Directory.Build.targets" />
61+
</Folder>
62+
<Folder Name="/_Imports/Managed/Packages/">
63+
<File Path="Src/Directory.Packages.Analyzers.props" />
64+
<File Path="Src/Directory.Packages.props" />
65+
</Folder>
66+
<Folder Name="/_Imports/Managed/Project/">
67+
<File Path="Imports/Benchmarks.props" />
68+
<File Path="Imports/Console.props" />
69+
<File Path="Imports/Examples.props" />
70+
<File Path="Imports/Library.props" />
71+
<File Path="Imports/Tests.props" />
72+
</Folder>
73+
<Folder Name="/_Items/">
74+
<File Path=".editorconfig" />
75+
<File Path=".gitattributes" />
76+
<File Path=".gitignore" />
77+
<File Path=".globalconfig" />
78+
<File Path="LICENSE.txt" />
79+
</Folder>
80+
<Folder Name="/_Scripts/">
81+
<File Path="Scripts/Build.ps1" />
82+
<File Path="Scripts/Publish.ps1" />
83+
</Folder>
84+
<Project Path="Src/FastData.Benchmarks/FastData.Benchmarks.csproj" />
85+
<Project Path="Src/FastData.BenchmarkHarness.Runner/FastData.BenchmarkHarness.Runner.csproj" />
86+
<Project Path="Src/FastData.Demo/FastData.Demo.csproj" />
87+
<Project Path="Src/FastData.Examples/FastData.Examples.csproj" />
88+
<Project Path="Src/FastData.InternalShared/FastData.InternalShared.csproj" />
89+
<Project Path="Src/FastData.Testbed/FastData.Testbed.csproj" />
90+
<Project Path="Src/FastData.TestHarness.Runner/FastData.TestHarness.Runner.csproj" />
91+
<Project Path="Src/FastData.Tests/FastData.Tests.csproj" />
92+
<Project Path="Src/FastData/FastData.csproj" />
9793
</Solution>

Scripts/Install-Gcc.ps1

Lines changed: 0 additions & 22 deletions
This file was deleted.

Scripts/Install-Rust.ps1

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<Import Project="../../Imports/Console.props" />
4+
5+
<PropertyGroup>
6+
<TargetFramework>net10.0</TargetFramework>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\FastData.Generator.CPlusPlus.TestHarness\FastData.Generator.CPlusPlus.TestHarness.csproj" />
11+
<ProjectReference Include="..\FastData.Generator.CSharp.TestHarness\FastData.Generator.CSharp.TestHarness.csproj" />
12+
<ProjectReference Include="..\FastData.Generator.Rust.TestHarness\FastData.Generator.Rust.TestHarness.csproj" />
13+
<ProjectReference Include="..\FastData.InternalShared\FastData.InternalShared.csproj" />
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using Genbox.FastData.Generator.CPlusPlus.TestHarness;
2+
using Genbox.FastData.Generator.CSharp.TestHarness;
3+
using Genbox.FastData.Generator.Rust.TestHarness;
4+
using Genbox.FastData.InternalShared.Harness;
5+
using Genbox.FastData.InternalShared.Helpers;
6+
7+
namespace Genbox.FastData.BenchmarkHarness.Runner;
8+
9+
internal static class Program
10+
{
11+
private const bool UseBencher = false;
12+
private const bool UseShell = true;
13+
14+
private static readonly BenchmarkBase[] Harnesses =
15+
[
16+
CSharpBenchmark.Instance,
17+
CPlusPlusBenchmark.Instance,
18+
RustBenchmark.Instance
19+
];
20+
21+
private static void Main()
22+
{
23+
Parallel.ForEach(Harnesses, RunHarness);
24+
}
25+
26+
private static void RunHarness(BenchmarkBase harness)
27+
{
28+
BenchmarkSuite suite = harness.CreateFiles(TestVectorHelper.GetBenchmarkData());
29+
WriteSuite(harness.RootDir, suite);
30+
31+
Console.WriteLine($"Executing {harness.Name}");
32+
harness.Run(suite, UseBencher, UseShell);
33+
}
34+
35+
private static void WriteSuite(string rootDir, BenchmarkSuite suite)
36+
{
37+
string entryPath = Path.Combine(rootDir, suite.EntryFilename);
38+
FileHelper.TryWriteFile(entryPath, suite.EntrySource);
39+
40+
foreach (BenchmarkFile file in suite.AdditionalFiles)
41+
{
42+
string filePath = Path.Combine(rootDir, file.Filename);
43+
string? fileDir = Path.GetDirectoryName(filePath);
44+
45+
if (fileDir != null && !Directory.Exists(fileDir))
46+
Directory.CreateDirectory(fileDir);
47+
48+
FileHelper.TryWriteFile(filePath, file.Source);
49+
}
50+
}
51+
}

Src/FastData.Generator.CPlusPlus.Benchmarks/packages.lock.json renamed to Src/FastData.BenchmarkHarness.Runner/packages.lock.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,42 @@
5959
"fastdata.generator.cplusplus.testharness": {
6060
"type": "Project",
6161
"dependencies": {
62+
"FastData": "[1.0.0, )",
63+
"FastData.Generator": "[1.0.0, )",
6264
"FastData.Generator.CPlusPlus": "[1.0.0, )",
6365
"FastData.InternalShared": "[1.0.0, )"
6466
}
6567
},
68+
"fastdata.generator.csharp": {
69+
"type": "Project",
70+
"dependencies": {
71+
"FastData.Generator.Template": "[1.0.0, )"
72+
}
73+
},
74+
"fastdata.generator.csharp.testharness": {
75+
"type": "Project",
76+
"dependencies": {
77+
"FastData": "[1.0.0, )",
78+
"FastData.Generator": "[1.0.0, )",
79+
"FastData.Generator.CSharp": "[1.0.0, )",
80+
"FastData.InternalShared": "[1.0.0, )"
81+
}
82+
},
83+
"fastdata.generator.rust": {
84+
"type": "Project",
85+
"dependencies": {
86+
"FastData.Generator.Template": "[1.0.0, )"
87+
}
88+
},
89+
"fastdata.generator.rust.testharness": {
90+
"type": "Project",
91+
"dependencies": {
92+
"FastData": "[1.0.0, )",
93+
"FastData.Generator": "[1.0.0, )",
94+
"FastData.Generator.Rust": "[1.0.0, )",
95+
"FastData.InternalShared": "[1.0.0, )"
96+
}
97+
},
6698
"fastdata.generator.template": {
6799
"type": "Project",
68100
"dependencies": {

Src/FastData.Generator.CPlusPlus.Benchmarks/FastData.Generator.CPlusPlus.Benchmarks.csproj

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)