@@ -475,6 +475,7 @@ void main() {
475475 'cd3' : 'false' , 'cd4' : 'ios' , 'cd22' : 'iOS 13' ,
476476 'cd23' : 'debug' , 'cd18' : 'false' , 'cd15' : 'swift' , 'cd31' : 'true' ,
477477 'cd57' : 'usb' ,
478+ 'cd58' : 'false' ,
478479 })
479480 )));
480481 }, overrides: < Type , Generator > {
@@ -488,6 +489,41 @@ void main() {
488489 Usage : () => usage,
489490 });
490491
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+
491527 group ('--machine' , () {
492528 testUsingContext ('enables multidex by default' , () async {
493529 final DaemonCapturingRunCommand command = DaemonCapturingRunCommand ();
@@ -745,6 +781,7 @@ void main() {
745781 commandRunModeName: 'debug' ,
746782 commandRunProjectModule: false ,
747783 commandRunProjectHostLanguage: '' ,
784+ commandRunIsTest: false ,
748785 ));
749786 }, overrides: < Type , Generator > {
750787 DeviceManager : () => testDeviceManager,
@@ -785,6 +822,7 @@ void main() {
785822 commandRunProjectModule: false ,
786823 commandRunProjectHostLanguage: '' ,
787824 commandRunIOSInterfaceType: 'usb' ,
825+ commandRunIsTest: false ,
788826 ));
789827 }, overrides: < Type , Generator > {
790828 DeviceManager : () => testDeviceManager,
@@ -828,6 +866,7 @@ void main() {
828866 commandRunProjectModule: false ,
829867 commandRunProjectHostLanguage: '' ,
830868 commandRunIOSInterfaceType: 'wireless' ,
869+ commandRunIsTest: false ,
831870 ));
832871 }, overrides: < Type , Generator > {
833872 DeviceManager : () => testDeviceManager,
@@ -871,6 +910,7 @@ void main() {
871910 commandRunProjectModule: false ,
872911 commandRunProjectHostLanguage: '' ,
873912 commandRunIOSInterfaceType: 'wireless' ,
913+ commandRunIsTest: false ,
874914 ));
875915 }, overrides: < Type , Generator > {
876916 DeviceManager : () => testDeviceManager,
0 commit comments