diff --git a/packages/shorebird_cli/lib/src/executables/aot_tools.dart b/packages/shorebird_cli/lib/src/executables/aot_tools.dart index 97c4aeac..73ee799b 100644 --- a/packages/shorebird_cli/lib/src/executables/aot_tools.dart +++ b/packages/shorebird_cli/lib/src/executables/aot_tools.dart @@ -229,7 +229,10 @@ class AotTools { ); if (result.exitCode != 0) { - throw Exception('Failed to link: ${result.stderr}'); + throw Exception(''' +Failed to link: +stdout: ${result.stdout} +stderr: ${result.stderr}'''); } return linkerUsesGenSnapshot diff --git a/packages/shorebird_cli/test/src/executables/aot_tools_test.dart b/packages/shorebird_cli/test/src/executables/aot_tools_test.dart index c95c8c6b..910e2379 100644 --- a/packages/shorebird_cli/test/src/executables/aot_tools_test.dart +++ b/packages/shorebird_cli/test/src/executables/aot_tools_test.dart @@ -96,10 +96,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 1); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => Stream.value(utf8.encode('error'))); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => Stream.value(utf8.encode('info'))); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => Stream.value(utf8.encode('error'))); return mockProcess; }, @@ -119,7 +121,10 @@ void main() { isA().having( (e) => '$e', 'exception', - 'Exception: Failed to link: error', + ''' +Exception: Failed to link: +stdout: info +stderr: error''', ), ), ); @@ -160,10 +165,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; }, @@ -222,10 +229,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => Stream.value(utf8.encode('stdout'))); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => Stream.value(utf8.encode('stdout'))); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; }, @@ -285,10 +294,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; }, @@ -362,10 +373,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; }, ); @@ -437,10 +450,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; }, @@ -513,10 +528,12 @@ void main() { (_) async { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; }, @@ -588,10 +605,12 @@ void main() { final mockProcess = MockProcess(); when(() => mockProcess.exitCode).thenAnswer((_) async => 0); - when(() => mockProcess.stdout) - .thenAnswer((_) => const Stream.empty()); - when(() => mockProcess.stderr) - .thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stdout, + ).thenAnswer((_) => const Stream.empty()); + when( + () => mockProcess.stderr, + ).thenAnswer((_) => const Stream.empty()); return mockProcess; },