Attach standard streams of the child sky_shell process so that logs from the shell show up. (#4024)
This commit is contained in:
parent
07719ad5ba
commit
376cb2eb38
@ -54,6 +54,18 @@ Future<Process> _startProcess(String mainPath, { String packages }) {
|
|||||||
], environment: <String, String>{ 'FLUTTER_TEST': 'true' });
|
], 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 {
|
class FlutterPlatform extends PlatformPlugin {
|
||||||
@override
|
@override
|
||||||
StreamChannel<String> loadChannel(String mainPath, TestPlatform platform) {
|
StreamChannel<String> loadChannel(String mainPath, TestPlatform platform) {
|
||||||
@ -93,6 +105,8 @@ void main() {
|
|||||||
listenerFile.path, packages: PackageMap.instance.packagesPath
|
listenerFile.path, packages: PackageMap.instance.packagesPath
|
||||||
);
|
);
|
||||||
|
|
||||||
|
_attachStandardStreams(process);
|
||||||
|
|
||||||
void finalize() {
|
void finalize() {
|
||||||
if (process != null) {
|
if (process != null) {
|
||||||
Process processToKill = process;
|
Process processToKill = process;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user