Commit 376cb2eb authored by Chinmay Garde's avatar Chinmay Garde

Attach standard streams of the child sky_shell process so that logs from the shell show up. (#4024)

parent 07719ad5
......@@ -54,6 +54,18 @@ Future<Process> _startProcess(String mainPath, { String packages }) {
], environment: <String, String>{ 'FLUTTER_TEST': 'true' });
}
void _attachStandardStreams(Process process) {
for (Stream<List<int>> stream in
<Stream<List<int>>>[process.stderr, process.stdout]) {
stream.transform(UTF8.decoder)
.transform(const LineSplitter())
.listen((String line) {
if (line != null)
print('Shell: $line');
});
}
}
class FlutterPlatform extends PlatformPlugin {
@override
StreamChannel<String> loadChannel(String mainPath, TestPlatform platform) {
......@@ -93,6 +105,8 @@ void main() {
listenerFile.path, packages: PackageMap.instance.packagesPath
);
_attachStandardStreams(process);
void finalize() {
if (process != null) {
Process processToKill = process;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment