@@ -962,6 +962,41 @@ if %errorlevel% neq 0 goto :VCEnd</Command>
962
962
ProcessManager : () => FakeProcessManager .any (),
963
963
FeatureFlags : () => TestFeatureFlags (isWindowsEnabled: true ),
964
964
});
965
+
966
+ // Tests the case where stdout contains the error about pubspec.yaml
967
+ // And tests the case where stdout contains the error about missing assets
968
+ testUsingContext ('Windows build extracts errors related to pubspec.yaml from stdout' , () async {
969
+ final FakeVisualStudio fakeVisualStudio = FakeVisualStudio ();
970
+ final BuildWindowsCommand command = BuildWindowsCommand (logger: BufferLogger .test ())
971
+ ..visualStudioOverride = fakeVisualStudio;
972
+ setUpMockProjectFilesForBuild ();
973
+
974
+ const String stdout = r'''
975
+ Error detected in pubspec.yaml:
976
+ No file or variants found for asset: images/a_dot_burr.jpeg.
977
+ ''' ;
978
+
979
+ processManager = FakeProcessManager .list (< FakeCommand > [
980
+ cmakeGenerationCommand (),
981
+ buildCommand ('Release' ,
982
+ stdout: stdout,
983
+ ),
984
+ ]);
985
+
986
+ await createTestCommandRunner (command).run (
987
+ const < String > ['windows' , '--no-pub' ]
988
+ );
989
+ // Just the warnings and errors should be surfaced.
990
+ expect (testLogger.errorText, r'''
991
+ Error detected in pubspec.yaml:
992
+ No file or variants found for asset: images/a_dot_burr.jpeg.
993
+ ''' );
994
+ }, overrides: < Type , Generator > {
995
+ FileSystem : () => fileSystem,
996
+ ProcessManager : () => processManager,
997
+ Platform : () => windowsPlatform,
998
+ FeatureFlags : () => TestFeatureFlags (isWindowsEnabled: true ),
999
+ });
965
1000
}
966
1001
967
1002
class FakeVisualStudio extends Fake implements VisualStudio {
0 commit comments