@@ -565,18 +565,34 @@ final dynamic match = Matchers();
565
565
/// set this field.
566
566
late String Function (Symbol ) getName;
567
567
568
+ const testRunnerKey = 'test_runner.configuration' ;
569
+
568
570
final bool isSimulator = (() {
569
- final configuration = Platform .environment['DART_CONFIGURATION' ];
570
- if (configuration == null ) {
571
+ if (bool .hasEnvironment (testRunnerKey)) {
572
+ const config = String .fromEnvironment (testRunnerKey);
573
+ return config.contains ('-sim' );
574
+ }
575
+ final runtimeConfiguration = Platform .environment['DART_CONFIGURATION' ];
576
+ if (runtimeConfiguration == null ) {
571
577
throw 'Expected DART_CONFIGURATION to be defined' ;
572
578
}
573
- return configuration .contains ('SIM' );
579
+ return runtimeConfiguration .contains ('SIM' );
574
580
})();
575
581
576
582
final bool is32BitConfiguration = (() {
577
- final configuration = Platform .environment['DART_CONFIGURATION' ];
578
- if (configuration == null ) {
583
+ if (bool .hasEnvironment (testRunnerKey)) {
584
+ const config = String .fromEnvironment (testRunnerKey);
585
+ // No IA32 as AOT mode is unsupported there.
586
+ return config.endsWith ('arm' ) ||
587
+ config.endsWith ('arm_x64' ) ||
588
+ config.endsWith ('riscv32' );
589
+ }
590
+ final runtimeConfiguration = Platform .environment['DART_CONFIGURATION' ];
591
+ if (runtimeConfiguration == null ) {
579
592
throw 'Expected DART_CONFIGURATION to be defined' ;
580
593
}
581
- return configuration.endsWith ('ARM' ) || configuration.endsWith ('ARM_X64' );
594
+ // No IA32 as AOT mode is unsupported there.
595
+ return runtimeConfiguration.endsWith ('ARM' ) ||
596
+ runtimeConfiguration.endsWith ('ARM_X64' ) ||
597
+ runtimeConfiguration.endsWith ('RISCV32' );
582
598
})();
0 commit comments