Unverified Commit 27c61eeb authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Explicitly report CFE output(when using --preview-dart-2) (#13936)

* Explicitly report CFE output(when using --preview-dart-2)

* Fix test so it looks at errorText

* Fix expected text
parent 467daba4
......@@ -45,7 +45,7 @@ class _StdoutHandler {
? string.substring(boundaryKey.length + 1)
: null);
else
printTrace('compile debug message: $string');
printError('compiler message: $string');
}
// This is needed to get ready to process next compilation result output,
......@@ -98,14 +98,14 @@ Future<String> compile(
final Process server = await processManager
.start(command)
.catchError((dynamic error, StackTrace stack) {
printTrace('Failed to start frontend server $error, $stack');
printError('Failed to start frontend server $error, $stack');
});
final _StdoutHandler stdoutHandler = new _StdoutHandler();
server.stderr
.transform(UTF8.decoder)
.listen((String s) { printTrace('compile debug message: $s'); });
.listen((String s) { printError('compiler message: $s'); });
server.stdout
.transform(UTF8.decoder)
.transform(const LineSplitter())
......@@ -171,7 +171,7 @@ class ResidentCompiler {
_server.stderr
.transform(UTF8.decoder)
.transform(const LineSplitter())
.listen((String s) { printTrace('compile debug message: $s'); });
.listen((String s) { printError('compiler message: $s'); });
_server.stdin.writeln('compile $scriptFilename');
......
......@@ -49,7 +49,7 @@ void main() {
mainPath: '/path/to/main.dart'
);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
expect(logger.traceText, equals('compile debug message: line1\ncompile debug message: line2\n'));
expect(logger.errorText, equals('compiler message: line1\ncompiler message: line2\n'));
expect(output, equals('/path/to/main.dart.dill'));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
......@@ -69,7 +69,7 @@ void main() {
mainPath: '/path/to/main.dart'
);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
expect(logger.traceText, equals('compile debug message: line1\ncompile debug message: line2\n'));
expect(logger.errorText, equals('compiler message: line1\ncompiler message: line2\n'));
expect(output, equals(null));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
......@@ -119,7 +119,7 @@ void main() {
);
expect(mockFrontendServerStdIn.getAndClear(), 'compile /path/to/main.dart\n');
verifyNoMoreInteractions(mockFrontendServerStdIn);
expect(logger.traceText, equals('compile debug message: line1\ncompile debug message: line2\n'));
expect(logger.errorText, equals('compiler message: line1\ncompiler message: line2\n'));
expect(output, equals('/path/to/main.dart.dill'));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
......@@ -140,9 +140,9 @@ void main() {
verifyNoMoreInteractions(mockFrontendServerStdIn);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
expect(logger.traceText, equals(
'compile debug message: line0\ncompile debug message: line1\n'
'compile debug message: line1\ncompile debug message: line2\n'
expect(logger.errorText, equals(
'compiler message: line0\ncompiler message: line1\n'
'compiler message: line1\ncompiler message: line2\n'
));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
......@@ -167,10 +167,10 @@ void main() {
verifyNoMoreInteractions(mockFrontendServerStdIn);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
expect(logger.traceText, equals(
'compile debug message: line0\ncompile debug message: line1\n'
'compile debug message: line1\ncompile debug message: line2\n'
'compile debug message: line2\ncompile debug message: line3\n'
expect(logger.errorText, equals(
'compiler message: line0\ncompiler message: line1\n'
'compiler message: line1\ncompiler message: line2\n'
'compiler message: line2\ncompiler message: line3\n'
));
}, overrides: <Type, Generator>{
ProcessManager: () => mockProcessManager,
......
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