-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test * Add Benchmarks * Add Camera + MediaElement Analyzer Benchmarks * Add `run_benchmarks` * Revert to main * Fix Formatting * Use `$(NetVersion)` * Rename Files * Run all 3 benchmarks * Add `/* language=C#-test */` * Fix Failing Tests * Update azure-pipelines.yml * Add `public` * Fix Analyzer Build Warnings --------- Co-authored-by: Brandon Minnick <[email protected]>
- Loading branch information
1 parent
cf6360d
commit b9c7854
Showing
25 changed files
with
294 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...munityToolkit.Maui.Analyzers.Benchmarks/CommunityToolkit.Maui.Analyzers.Benchmarks.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>$(NetVersion)</TargetFramework> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<DebugSymbols>true</DebugSymbols> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<Optimize>true</Optimize> | ||
<Configuration>Release</Configuration> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" /> | ||
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\CommunityToolkit.Maui.Analyzers.UnitTests\CommunityToolkit.Maui.Analyzers.UnitTests.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using BenchmarkDotNet.Configs; | ||
using BenchmarkDotNet.Running; | ||
|
||
namespace CommunityToolkit.Maui.Analyzers.Benchmarks; | ||
|
||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var config = DefaultConfig.Instance; | ||
BenchmarkRunner.Run<UseMauiCommunityToolkitAnalyzerBenchmarks>(config, args); | ||
BenchmarkRunner.Run<UseMauiCommunityToolkitCameraAnalyzerBenchmarks>(config, args); | ||
BenchmarkRunner.Run<UseMauiCommunityToolkitMediaElementInitializationAnalyzerBenchmarks>(config, args); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/CommunityToolkit.Maui.Analyzers.Benchmarks/UseMauiCommunityToolkitAnalyzerBenchmarks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using CommunityToolkit.Maui.Analyzers.UnitTests; | ||
|
||
namespace CommunityToolkit.Maui.Analyzers.Benchmarks; | ||
|
||
[MemoryDiagnoser] | ||
public class UseMauiCommunityToolkitAnalyzerBenchmarks | ||
{ | ||
static readonly UseCommunityToolkitInitializationAnalyzerTests useCommunityToolkitInitializationAnalyzerTests = new(); | ||
|
||
[Benchmark] | ||
public Task VerifyNoErrorsWhenUseMauiCommunityToolkit() | ||
{ | ||
return useCommunityToolkitInitializationAnalyzerTests.VerifyNoErrorsWhenUseMauiCommunityToolkit(); | ||
} | ||
|
||
[Benchmark] | ||
public Task VerifyNoErrorsWhenUseMauiCommunityToolkitHasAdditonalWhitespace() | ||
{ | ||
return useCommunityToolkitInitializationAnalyzerTests.VerifyNoErrorsWhenUseMauiCommunityToolkitHasAdditonalWhitespace(); | ||
} | ||
|
||
[Benchmark] | ||
public Task VerifyErrorsWhenMissingUseMauiCommunityToolkit() | ||
{ | ||
return useCommunityToolkitInitializationAnalyzerTests.VerifyErrorsWhenMissingUseMauiCommunityToolkit(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...unityToolkit.Maui.Analyzers.Benchmarks/UseMauiCommunityToolkitCameraAnalyzerBenchmarks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using CommunityToolkit.Maui.Analyzers.UnitTests; | ||
|
||
namespace CommunityToolkit.Maui.Analyzers.Benchmarks; | ||
|
||
[MemoryDiagnoser] | ||
public class UseMauiCommunityToolkitCameraAnalyzerBenchmarks | ||
{ | ||
static readonly UseCommunityToolkitCameraInitializationAnalyzerTests useCommunityToolkitCameraInitializationAnalyzerTests = new(); | ||
|
||
[Benchmark] | ||
public Task VerifyNoErrorsWhenUseMauiCommunityToolkitCamera() | ||
{ | ||
return useCommunityToolkitCameraInitializationAnalyzerTests.VerifyNoErrorsWhenUseMauiCommunityToolkitCamera(); | ||
} | ||
|
||
[Benchmark] | ||
public Task VerifyNoErrorsWhenUseMauiCommunityToolkitCameraHasAdditonalWhitespace() | ||
{ | ||
return useCommunityToolkitCameraInitializationAnalyzerTests.VerifyNoErrorsWhenUseMauiCommunityToolkitCameraHasAdditonalWhitespace(); | ||
} | ||
|
||
[Benchmark] | ||
public Task VerifyErrorsWhenMissingUseMauiCommunityToolkitCamera() | ||
{ | ||
return useCommunityToolkitCameraInitializationAnalyzerTests.VerifyErrorsWhenMissingUseMauiCommunityToolkitCamera(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...alyzers.Benchmarks/UseMauiCommunityToolkitMediaElementInitializationAnalyzerBenchmarks.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using CommunityToolkit.Maui.Analyzers.UnitTests; | ||
|
||
namespace CommunityToolkit.Maui.Analyzers.Benchmarks; | ||
|
||
[MemoryDiagnoser] | ||
public class UseMauiCommunityToolkitMediaElementInitializationAnalyzerBenchmarks | ||
{ | ||
static readonly UseCommunityToolkitMediaElementInitializationAnalyzerTests useCommunityToolkitMediaElementInitializationAnalyzerTests = new(); | ||
|
||
[Benchmark] | ||
public Task VerifyNoErrorsWhenUseMauiCommunityToolkitMediaElement() | ||
{ | ||
return useCommunityToolkitMediaElementInitializationAnalyzerTests.VerifyNoErrorsWhenUseMauiCommunityToolkitMediaElement(); | ||
} | ||
|
||
[Benchmark] | ||
public Task VerifyNoErrorsWhenUseMauiCommunityToolkitMediaElementHasAdditonalWhitespace() | ||
{ | ||
return useCommunityToolkitMediaElementInitializationAnalyzerTests.VerifyNoErrorsWhenUseMauiCommunityToolkitMediaElementHasAdditonalWhitespace(); | ||
} | ||
|
||
[Benchmark] | ||
public Task VerifyErrorsWhenMissingUseMauiCommunityToolkitMediaElement() | ||
{ | ||
return useCommunityToolkitMediaElementInitializationAnalyzerTests.VerifyErrorsWhenMissingUseMauiCommunityToolkitMediaElement(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.