@@ -720,13 +720,29 @@ void main() {
720
720
expect (defaultTargetPlatform, equals (TargetPlatform .iOS));
721
721
}, variant: TargetPlatformVariant .only (TargetPlatform .iOS));
722
722
723
- testWidgets ('TargetPlatformVariant.all tests run all variants' , (WidgetTester tester) async {
724
- if (debugDefaultTargetPlatformOverride == null ) {
725
- expect (numberOfVariationsRun, equals (TargetPlatform .values.length));
726
- } else {
727
- numberOfVariationsRun += 1 ;
728
- }
729
- }, variant: TargetPlatformVariant .all ());
723
+ group ('all' , () {
724
+ testWidgets ('TargetPlatformVariant.all tests run all variants' , (WidgetTester tester) async {
725
+ if (debugDefaultTargetPlatformOverride == null ) {
726
+ expect (numberOfVariationsRun, equals (TargetPlatform .values.length));
727
+ } else {
728
+ numberOfVariationsRun += 1 ;
729
+ }
730
+ }, variant: TargetPlatformVariant .all ());
731
+
732
+ const Set <TargetPlatform > excludePlatforms = < TargetPlatform > { TargetPlatform .android, TargetPlatform .linux };
733
+ testWidgets ('TargetPlatformVariant.all, excluding runs an all variants except those provided in excluding' , (WidgetTester tester) async {
734
+ if (debugDefaultTargetPlatformOverride == null ) {
735
+ expect (numberOfVariationsRun, equals (TargetPlatform .values.length - excludePlatforms.length));
736
+ expect (
737
+ excludePlatforms,
738
+ isNot (contains (debugDefaultTargetPlatformOverride)),
739
+ reason: 'this test should not run on any platform in excludePlatforms'
740
+ );
741
+ } else {
742
+ numberOfVariationsRun += 1 ;
743
+ }
744
+ }, variant: TargetPlatformVariant .all (excluding: excludePlatforms));
745
+ });
730
746
731
747
testWidgets ('TargetPlatformVariant.desktop + mobile contains all TargetPlatform values' , (WidgetTester tester) async {
732
748
final TargetPlatformVariant all = TargetPlatformVariant .all ();
0 commit comments