OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked | 4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override --checked |
5 | 5 |
6 library test_helper; | 6 library test_helper; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 first = false; | 61 first = false; |
62 print('** Signaled to run test queries on $portNumber'); | 62 print('** Signaled to run test queries on $portNumber'); |
63 } | 63 } |
64 print(line); | 64 print(line); |
65 }); | 65 }); |
66 process.stderr.transform(UTF8.decoder) | 66 process.stderr.transform(UTF8.decoder) |
67 .transform(new LineSplitter()).listen((line) { | 67 .transform(new LineSplitter()).listen((line) { |
68 print(line); | 68 print(line); |
69 }); | 69 }); |
70 process.exitCode.then((exitCode) { | 70 process.exitCode.then((exitCode) { |
71 final success = 0; | |
72 final killed = -15; | |
rmacnak
2015/04/10 22:36:44
This might be different on Windows...
rmacnak
2015/04/16 20:47:35
Of course we can keep track of whether we killed t
| |
73 if (exitCode != success && exitCode != killed) { | |
74 throw "Testee exited with $exitCode"; | |
75 } | |
71 print("** Process exited"); | 76 print("** Process exited"); |
72 }); | 77 }); |
73 return completer.future; | 78 return completer.future; |
74 }); | 79 }); |
75 } | 80 } |
76 | 81 |
77 void requestExit() { | 82 void requestExit() { |
78 print('** Killing script'); | 83 print('** Killing script'); |
79 process.kill(); | 84 process.kill(); |
80 } | 85 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 })).then((_) => process.requestExit()); | 184 })).then((_) => process.requestExit()); |
180 }, onError: (e, st) { | 185 }, onError: (e, st) { |
181 if (!_isWebSocketDisconnect(e)) { | 186 if (!_isWebSocketDisconnect(e)) { |
182 print('Unexpected exception in service tests: $e $st'); | 187 print('Unexpected exception in service tests: $e $st'); |
183 throw e; | 188 throw e; |
184 } | 189 } |
185 }); | 190 }); |
186 }); | 191 }); |
187 } | 192 } |
188 } | 193 } |
OLD | NEW |