| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dartino_compiler.test.dartino_vm_tester; | 5 library dartino_compiler.test.dartino_vm_tester; |
| 6 | 6 |
| 7 import 'dart:io' hide | 7 import 'dart:io' hide |
| 8 exitCode, | 8 exitCode, |
| 9 stderr, | 9 stderr, |
| 10 stdin, | 10 stdin, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 208 |
| 209 // Wait for process termination. | 209 // Wait for process termination. |
| 210 VmCommand response = await vmContext.runCommand(continueCommand); | 210 VmCommand response = await vmContext.runCommand(continueCommand); |
| 211 if (response is! commands_lib.ProcessTerminated) { | 211 if (response is! commands_lib.ProcessTerminated) { |
| 212 // TODO(ahe): It's probably an instance of | 212 // TODO(ahe): It's probably an instance of |
| 213 // commands_lib.UncaughtException, and if so, we should try to print | 213 // commands_lib.UncaughtException, and if so, we should try to print |
| 214 // the stack trace. | 214 // the stack trace. |
| 215 throw new StateError( | 215 throw new StateError( |
| 216 "Expected ProcessTerminated, but got: $response"); | 216 "Expected ProcessTerminated, but got: $response"); |
| 217 } | 217 } |
| 218 vmContext.terminate(); |
| 218 } | 219 } |
| 219 await vmContext.runCommand(const commands_lib.SessionEnd()); | 220 await vmContext.runCommand(const commands_lib.SessionEnd()); |
| 220 await vmContext.shutdown(); | 221 await vmContext.shutdown(); |
| 221 } | 222 } |
| 222 | 223 |
| 223 Future<Null> waitForCompletion() async { | 224 Future<Null> waitForCompletion() async { |
| 224 // TODO(ahe/kustermann/ager): We really need to distinguish VM crashes from | 225 // TODO(ahe/kustermann/ager): We really need to distinguish VM crashes from |
| 225 // normal test failures. This information is based on exitCode and we need | 226 // normal test failures. This information is based on exitCode and we need |
| 226 // to propagate the exitCode back to test.dart, so we can have Fail/Crash | 227 // to propagate the exitCode back to test.dart, so we can have Fail/Crash |
| 227 // outcomes of these tests. | 228 // outcomes of these tests. |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 435 |
| 435 void add(List<int> data) => builder.add(data); | 436 void add(List<int> data) => builder.add(data); |
| 436 | 437 |
| 437 void close() { | 438 void close() { |
| 438 } | 439 } |
| 439 | 440 |
| 440 List<String> takeLines() { | 441 List<String> takeLines() { |
| 441 return new LineSplitter().convert(UTF8.decode(builder.takeBytes())); | 442 return new LineSplitter().convert(UTF8.decode(builder.takeBytes())); |
| 442 } | 443 } |
| 443 } | 444 } |
| OLD | NEW |