Chromium Code Reviews| Index: tools/testing/dart/command_output.dart |
| diff --git a/tools/testing/dart/command_output.dart b/tools/testing/dart/command_output.dart |
| index 02d61fd9b7ac1f32581d8d8203f5bd5a67d131ce..4ce5508f79becf079a343a73f35b7198d81f65a2 100644 |
| --- a/tools/testing/dart/command_output.dart |
| +++ b/tools/testing/dart/command_output.dart |
| @@ -698,6 +698,37 @@ class CompilationCommandOutput extends CommandOutput { |
| } |
| } |
| +class DevCompilerCommandOutput extends CommandOutput { |
| + DevCompilerCommandOutput( |
| + Command command, |
| + int exitCode, |
| + bool timedOut, |
| + List<int> stdout, |
| + List<int> stderr, |
| + Duration time, |
| + bool compilationSkipped, |
| + int pid) |
| + : super(command, exitCode, timedOut, stdout, stderr, time, |
| + compilationSkipped, pid); |
| + |
| + Expectation result(TestCase testCase) { |
| + if (hasCrashed) return Expectation.crash; |
| + if (hasTimedOut) return Expectation.timeout; |
| + if (hasNonUtf8) return Expectation.nonUtf8Error; |
| + |
| + // Handle errors / missing errors |
| + if (testCase.expectCompileError) { |
| + return exitCode != 0 |
|
Bob Nystrom
2017/08/03 18:28:04
How about "== 0" and flipping the cases to avoid t
Jennifer Messerly
2017/08/03 19:43:06
Done.
|
| + ? Expectation.pass |
| + : Expectation.missingCompileTimeError; |
| + } |
| + |
| + // TODO(jmesserly): should we handle `testCase.isNegative`? Analyzer does |
| + // not, so this behavior is chosen to match. |
| + return exitCode == 0 ? Expectation.pass : Expectation.compileTimeError; |
| + } |
| +} |
| + |
| class KernelCompilationCommandOutput extends CompilationCommandOutput { |
| KernelCompilationCommandOutput( |
| Command command, |
| @@ -804,6 +835,9 @@ CommandOutput createCommandOutput(Command command, int exitCode, bool timedOut, |
| command.displayName == 'app_jit') { |
| return new VMCommandOutput( |
| command, exitCode, timedOut, stdout, stderr, time, pid); |
| + } else if (command.displayName == 'dartdevc') { |
| + return new DevCompilerCommandOutput(command, exitCode, timedOut, stdout, |
| + stderr, time, compilationSkipped, pid); |
| } |
| return new CompilationCommandOutput( |
| command, exitCode, timedOut, stdout, stderr, time, compilationSkipped); |