@@ -20,19 +20,14 @@ public class LargeAddressAwareTest
2020
2121 public LargeAddressAwareTest ( ITestOutputHelper outputHelper ) => output = outputHelper ;
2222
23- [ FactEnvSpecific ( "CLR is a valid job only on Windows" , EnvRequirement . WindowsOnly ) ]
24- public void BenchmarkCanAllocateMoreThan2Gb ( )
23+ [ Fact ]
24+ public void BenchmarkCanAllocateMoreThan2Gb_Core ( )
2525 {
2626 var platform = RuntimeInformation . GetCurrentPlatform ( ) ;
2727 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- }
28+ // Running 32-bit benchmarks with .Net Core requires passing the path to 32-bit SDK,
29+ // which makes this test more complex than it's worth in CI, so we only test 64-bit.
30+ config . AddJob ( Job . Dry . WithRuntime ( CoreRuntime . Core80 ) . WithPlatform ( platform ) . WithId ( platform . ToString ( ) ) ) ;
3631 config . AddColumnProvider ( DefaultColumnProviders . Instance )
3732 . AddLogger ( new OutputLogger ( output ) ) ;
3833
@@ -43,16 +38,37 @@ public void BenchmarkCanAllocateMoreThan2Gb()
4338 . All ( executeResult => executeResult . FoundExecutable ) ) ) ;
4439
4540 Assert . True ( summary . Reports . All ( report => report . AllMeasurements . Any ( ) ) ) ;
41+ Assert . True ( summary . Reports . All ( report => report . ExecuteResults . Any ( ) ) ) ;
42+ Assert . Equal ( 1 , summary . Reports . Count ( report => report . BenchmarkCase . Job . Environment . Runtime is CoreRuntime ) ) ;
4643
47- Assert . True ( summary . Reports
48- . Single ( report => report . BenchmarkCase . Job . Environment . Runtime is ClrRuntime )
49- . ExecuteResults
50- . Any ( ) ) ;
44+ Assert . Contains ( ".NET 8.0" , summary . AllRuntimes ) ;
45+ }
46+
47+ [ FactEnvSpecific ( "Framework is only on Windows" , EnvRequirement . WindowsOnly ) ]
48+ public void BenchmarkCanAllocateMoreThan2Gb_Framework ( )
49+ {
50+ var platform = RuntimeInformation . GetCurrentPlatform ( ) ;
51+ var config = ManualConfig . CreateEmpty ( ) ;
52+ // Net481 officially only supports x86, x64, and Arm64.
53+ config . AddJob ( Job . Dry . WithRuntime ( ClrRuntime . Net481 ) . WithPlatform ( platform ) . WithGcServer ( false ) . WithLargeAddressAware ( ) . WithId ( platform . ToString ( ) ) ) ;
54+ int jobCount = 1 ;
55+ if ( platform == Platform . X64 )
56+ {
57+ ++ jobCount ;
58+ config . AddJob ( Job . Dry . WithRuntime ( ClrRuntime . Net462 ) . WithPlatform ( Platform . X86 ) . WithGcServer ( false ) . WithLargeAddressAware ( ) . WithId ( "X86" ) ) ;
59+ }
60+ config . AddColumnProvider ( DefaultColumnProviders . Instance )
61+ . AddLogger ( new OutputLogger ( output ) ) ;
62+
63+ var summary = BenchmarkRunner . Run < NeedsMoreThan2GB > ( config ) ;
5164
5265 Assert . True ( summary . Reports
53- . Single ( report => report . BenchmarkCase . Job . Environment . Runtime is CoreRuntime )
54- . ExecuteResults
55- . Any ( ) ) ;
66+ . All ( report => report . ExecuteResults
67+ . All ( executeResult => executeResult . FoundExecutable ) ) ) ;
68+
69+ Assert . True ( summary . Reports . All ( report => report . AllMeasurements . Any ( ) ) ) ;
70+ Assert . True ( summary . Reports . All ( report => report . ExecuteResults . Any ( ) ) ) ;
71+ Assert . Equal ( jobCount , summary . Reports . Count ( report => report . BenchmarkCase . Job . Environment . Runtime is ClrRuntime ) ) ;
5672
5773 Assert . Contains ( ".NET Framework" , summary . AllRuntimes ) ;
5874 Assert . Contains ( DotNetRuntimeHelper . GetExpectedDotNetCoreRuntimeName ( ) , summary . AllRuntimes ) ;
0 commit comments