| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 server.driver; | 5 library server.driver; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:math' show max, sqrt; | 8 import 'dart:math' show max, sqrt; |
| 9 | 9 |
| 10 import 'package:logging/logging.dart'; | 10 import 'package:logging/logging.dart'; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 /** | 127 /** |
| 128 * Shutdown the analysis server if it is running. | 128 * Shutdown the analysis server if it is running. |
| 129 */ | 129 */ |
| 130 Future stopServer([Duration timeout = SHUTDOWN_TIMEOUT]) async { | 130 Future stopServer([Duration timeout = SHUTDOWN_TIMEOUT]) async { |
| 131 if (running) { | 131 if (running) { |
| 132 logger.log(Level.FINE, 'requesting server shutdown'); | 132 logger.log(Level.FINE, 'requesting server shutdown'); |
| 133 // Give the server a short time to comply with the shutdown request; if it | 133 // Give the server a short time to comply with the shutdown request; if it |
| 134 // doesn't exit, then forcibly terminate it. | 134 // doesn't exit, then forcibly terminate it. |
| 135 sendServerShutdown(); | 135 sendServerShutdown(); |
| 136 await server.exitCode.timeout(timeout, onTimeout: () { | 136 await server.exitCode.timeout(timeout, onTimeout: () { |
| 137 return server.kill(); | 137 return server.kill('server failed to exit'); |
| 138 }); | 138 }); |
| 139 } | 139 } |
| 140 _resultsReady(); | 140 _resultsReady(); |
| 141 } | 141 } |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * If not already complete, signal the completer with the collected results. | 144 * If not already complete, signal the completer with the collected results. |
| 145 */ | 145 */ |
| 146 void _resultsReady() { | 146 void _resultsReady() { |
| 147 if (!_runCompleter.isCompleted) { | 147 if (!_runCompleter.isCompleted) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 int totalUnexpectedResultCount) { | 307 int totalUnexpectedResultCount) { |
| 308 StringBuffer sb = new StringBuffer(); | 308 StringBuffer sb = new StringBuffer(); |
| 309 _printColumn(sb, 'Totals', keyLen); | 309 _printColumn(sb, 'Totals', keyLen); |
| 310 _printColumn(sb, totalCount.toString(), 6, rightJustified: true); | 310 _printColumn(sb, totalCount.toString(), 6, rightJustified: true); |
| 311 _printColumn(sb, totalErrorCount.toString(), 6, rightJustified: true); | 311 _printColumn(sb, totalErrorCount.toString(), 6, rightJustified: true); |
| 312 _printColumn(sb, totalUnexpectedResultCount.toString(), 6, | 312 _printColumn(sb, totalUnexpectedResultCount.toString(), 6, |
| 313 rightJustified: true); | 313 rightJustified: true); |
| 314 print(sb.toString()); | 314 print(sb.toString()); |
| 315 } | 315 } |
| 316 } | 316 } |
| OLD | NEW |