1111using BenchmarkDotNet . Tests . Loggers ;
1212using BenchmarkDotNet . Tests . XUnit ;
1313using BenchmarkDotNet . Toolchains . DotNetCli ;
14+ using BenchmarkDotNet . Toolchains . MonoAotLLVM ;
1415using BenchmarkDotNet . Toolchains . MonoWasm ;
1516using Xunit ;
1617using Xunit . Abstractions ;
@@ -27,11 +28,11 @@ namespace BenchmarkDotNet.IntegrationTests
2728 /// </summary>
2829 public class WasmTests ( ITestOutputHelper output ) : BenchmarkTestExecutor ( output )
2930 {
30- private ManualConfig GetConfig ( )
31+ private ManualConfig GetConfig ( MonoAotCompilerMode aotCompilerMode )
3132 {
3233 var dotnetVersion = "net8.0" ;
3334 var logger = new OutputLogger ( Output ) ;
34- var netCoreAppSettings = new NetCoreAppSettings ( dotnetVersion , null , "Wasm" ) ;
35+ var netCoreAppSettings = new NetCoreAppSettings ( dotnetVersion , null , "Wasm" , aotCompilerMode : aotCompilerMode ) ;
3536 var mainJsPath = Path . Combine ( AppContext . BaseDirectory , "AppBundle" , "test-main.js" ) ;
3637
3738 return ManualConfig . CreateEmpty ( )
@@ -44,20 +45,24 @@ private ManualConfig GetConfig()
4445 . WithOption ( ConfigOptions . GenerateMSBuildBinLog , true ) ;
4546 }
4647
47- [ FactEnvSpecific ( "WASM is only supported on Unix" , EnvRequirement . NonWindows ) ]
48- public void WasmIsSupported ( )
48+ [ TheoryEnvSpecific ( "WASM is only supported on Unix" , EnvRequirement . NonWindows ) ]
49+ [ InlineData ( MonoAotCompilerMode . mini ) ]
50+ [ InlineData ( MonoAotCompilerMode . wasm ) ]
51+ public void WasmIsSupported ( MonoAotCompilerMode aotCompilerMode )
4952 {
5053 // Test fails on Linux non-x64.
5154 if ( OsDetector . IsLinux ( ) && RuntimeInformation . GetCurrentPlatform ( ) != Platform . X64 )
5255 {
5356 return ;
5457 }
5558
56- CanExecute < WasmBenchmark > ( GetConfig ( ) ) ;
59+ CanExecute < WasmBenchmark > ( GetConfig ( aotCompilerMode ) ) ;
5760 }
5861
59- [ FactEnvSpecific ( "WASM is only supported on Unix" , EnvRequirement . NonWindows ) ]
60- public void WasmSupportsInProcessDiagnosers ( )
62+ [ TheoryEnvSpecific ( "WASM is only supported on Unix" , EnvRequirement . NonWindows ) ]
63+ [ InlineData ( MonoAotCompilerMode . mini ) ]
64+ [ InlineData ( MonoAotCompilerMode . wasm ) ]
65+ public void WasmSupportsInProcessDiagnosers ( MonoAotCompilerMode aotCompilerMode )
6166 {
6267 // Test fails on Linux non-x64.
6368 if ( OsDetector . IsLinux ( ) && RuntimeInformation . GetCurrentPlatform ( ) != Platform . X64 )
@@ -68,7 +73,7 @@ public void WasmSupportsInProcessDiagnosers()
6873 try
6974 {
7075 var diagnoser = new MockInProcessDiagnoser1 ( BenchmarkDotNet . Diagnosers . RunMode . NoOverhead ) ;
71- var config = GetConfig ( ) . AddDiagnoser ( diagnoser ) ;
76+ var config = GetConfig ( aotCompilerMode ) . AddDiagnoser ( diagnoser ) ;
7277
7378 CanExecute < WasmBenchmark > ( config ) ;
7479
0 commit comments