@@ -475,6 +475,7 @@ void main() {
475
475
'cd3' : 'false' , 'cd4' : 'ios' , 'cd22' : 'iOS 13' ,
476
476
'cd23' : 'debug' , 'cd18' : 'false' , 'cd15' : 'swift' , 'cd31' : 'true' ,
477
477
'cd57' : 'usb' ,
478
+ 'cd58' : 'false' ,
478
479
})
479
480
)));
480
481
}, overrides: < Type , Generator > {
@@ -488,6 +489,41 @@ void main() {
488
489
Usage : () => usage,
489
490
});
490
491
492
+ testUsingContext ('correctly reports tests to usage' , () async {
493
+ fs.currentDirectory.childDirectory ('test' ).childFile ('widget_test.dart' ).createSync (recursive: true );
494
+ fs.currentDirectory.childDirectory ('ios' ).childFile ('AppDelegate.swift' ).createSync (recursive: true );
495
+ final RunCommand command = RunCommand ();
496
+ final FakeDevice mockDevice = FakeDevice (sdkNameAndVersion: 'iOS 13' )
497
+ ..startAppSuccess = false ;
498
+
499
+ testDeviceManager.devices = < Device > [mockDevice];
500
+
501
+ await expectToolExitLater (createTestCommandRunner (command).run (< String > [
502
+ 'run' ,
503
+ '--no-pub' ,
504
+ '--no-hot' ,
505
+ 'test/widget_test.dart' ,
506
+ ]), isNull);
507
+
508
+ expect (usage.commands, contains (
509
+ TestUsageCommand ('run' , parameters: CustomDimensions .fromMap (< String , String > {
510
+ 'cd3' : 'false' , 'cd4' : 'ios' , 'cd22' : 'iOS 13' ,
511
+ 'cd23' : 'debug' , 'cd18' : 'false' , 'cd15' : 'swift' , 'cd31' : 'true' ,
512
+ 'cd57' : 'usb' ,
513
+ 'cd58' : 'true' ,
514
+ })),
515
+ ));
516
+ }, overrides: < Type , Generator > {
517
+ AnsiTerminal : () => fakeTerminal,
518
+ Artifacts : () => artifacts,
519
+ Cache : () => Cache .test (processManager: FakeProcessManager .any ()),
520
+ DeviceManager : () => testDeviceManager,
521
+ FileSystem : () => fs,
522
+ ProcessManager : () => FakeProcessManager .any (),
523
+ Stdio : () => FakeStdio (),
524
+ Usage : () => usage,
525
+ });
526
+
491
527
group ('--machine' , () {
492
528
testUsingContext ('enables multidex by default' , () async {
493
529
final DaemonCapturingRunCommand command = DaemonCapturingRunCommand ();
@@ -745,6 +781,7 @@ void main() {
745
781
commandRunModeName: 'debug' ,
746
782
commandRunProjectModule: false ,
747
783
commandRunProjectHostLanguage: '' ,
784
+ commandRunIsTest: false ,
748
785
));
749
786
}, overrides: < Type , Generator > {
750
787
DeviceManager : () => testDeviceManager,
@@ -785,6 +822,7 @@ void main() {
785
822
commandRunProjectModule: false ,
786
823
commandRunProjectHostLanguage: '' ,
787
824
commandRunIOSInterfaceType: 'usb' ,
825
+ commandRunIsTest: false ,
788
826
));
789
827
}, overrides: < Type , Generator > {
790
828
DeviceManager : () => testDeviceManager,
@@ -828,6 +866,7 @@ void main() {
828
866
commandRunProjectModule: false ,
829
867
commandRunProjectHostLanguage: '' ,
830
868
commandRunIOSInterfaceType: 'wireless' ,
869
+ commandRunIsTest: false ,
831
870
));
832
871
}, overrides: < Type , Generator > {
833
872
DeviceManager : () => testDeviceManager,
@@ -871,6 +910,7 @@ void main() {
871
910
commandRunProjectModule: false ,
872
911
commandRunProjectHostLanguage: '' ,
873
912
commandRunIOSInterfaceType: 'wireless' ,
913
+ commandRunIsTest: false ,
874
914
));
875
915
}, overrides: < Type , Generator > {
876
916
DeviceManager : () => testDeviceManager,
0 commit comments