55using BenchmarkDotNet . Configs ;
66using BenchmarkDotNet . Environments ;
77using BenchmarkDotNet . Jobs ;
8+ using BenchmarkDotNet . Portability ;
89using BenchmarkDotNet . Running ;
910using BenchmarkDotNet . Tests . Loggers ;
1011using BenchmarkDotNet . Tests . XUnit ;
@@ -22,13 +23,20 @@ public class LargeAddressAwareTest
2223 [ FactEnvSpecific ( "CLR is a valid job only on Windows" , EnvRequirement . WindowsOnly ) ]
2324 public void BenchmarkCanAllocateMoreThan2Gb ( )
2425 {
25- var summary = BenchmarkRunner
26- . Run < NeedsMoreThan2GB > (
27- ManualConfig . CreateEmpty ( )
28- . AddJob ( Job . Dry . WithRuntime ( CoreRuntime . Core80 ) . WithPlatform ( Platform . X64 ) . WithId ( "Core" ) )
29- . AddJob ( Job . Dry . WithRuntime ( ClrRuntime . Net462 ) . WithPlatform ( Platform . X86 ) . WithGcServer ( false ) . WithLargeAddressAware ( ) . WithId ( "Framework" ) )
30- . AddColumnProvider ( DefaultColumnProviders . Instance )
31- . AddLogger ( new OutputLogger ( output ) ) ) ;
26+ var platform = RuntimeInformation . GetCurrentPlatform ( ) ;
27+ var config = ManualConfig . CreateEmpty ( ) ;
28+ if ( platform == Platform . X64 || platform == Platform . Arm64 )
29+ {
30+ config . AddJob ( Job . Dry . WithRuntime ( CoreRuntime . Core80 ) . WithPlatform ( platform ) . WithId ( "Core" ) ) ;
31+ }
32+ if ( platform == Platform . X64 || platform == Platform . X86 )
33+ {
34+ config . AddJob ( Job . Dry . WithRuntime ( ClrRuntime . Net462 ) . WithPlatform ( Platform . X86 ) . WithGcServer ( false ) . WithLargeAddressAware ( ) . WithId ( "Framework" ) ) ;
35+ }
36+ config . AddColumnProvider ( DefaultColumnProviders . Instance )
37+ . AddLogger ( new OutputLogger ( output ) ) ;
38+
39+ var summary = BenchmarkRunner . Run < NeedsMoreThan2GB > ( config ) ;
3240
3341 Assert . True ( summary . Reports
3442 . All ( report => report . ExecuteResults
0 commit comments