| 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 test.integration.analysis; | 5 library test.integration.analysis; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:convert'; | 9 import 'dart:convert'; |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 Platform.isWindows)); | 545 Platform.isWindows)); |
| 546 String serverPath = normalize(join(scriptDir, '..', '..', 'bin', | 546 String serverPath = normalize(join(scriptDir, '..', '..', 'bin', |
| 547 'server.dart')); | 547 'server.dart')); |
| 548 List<String> arguments = []; | 548 List<String> arguments = []; |
| 549 if (debugServer) { | 549 if (debugServer) { |
| 550 arguments.add('--debug'); | 550 arguments.add('--debug'); |
| 551 } | 551 } |
| 552 if (Platform.packageRoot.isNotEmpty) { | 552 if (Platform.packageRoot.isNotEmpty) { |
| 553 arguments.add('--package-root=${Platform.packageRoot}'); | 553 arguments.add('--package-root=${Platform.packageRoot}'); |
| 554 } | 554 } |
| 555 arguments.add('--checked'); |
| 555 arguments.add(serverPath); | 556 arguments.add(serverPath); |
| 556 return Process.start(dartBinary, arguments).then((Process process) { | 557 return Process.start(dartBinary, arguments).then((Process process) { |
| 557 _process = process; | 558 _process = process; |
| 558 process.stdout.transform((new Utf8Codec()).decoder).transform( | 559 process.stdout.transform((new Utf8Codec()).decoder).transform( |
| 559 new LineSplitter()).listen((String line) { | 560 new LineSplitter()).listen((String line) { |
| 560 String trimmedLine = line.trim(); | 561 String trimmedLine = line.trim(); |
| 561 _recordStdio('RECV: $trimmedLine'); | 562 _recordStdio('RECV: $trimmedLine'); |
| 562 var message; | 563 var message; |
| 563 try { | 564 try { |
| 564 message = JSON.decoder.convert(trimmedLine); | 565 message = JSON.decoder.convert(trimmedLine); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 */ | 701 */ |
| 701 void _recordStdio(String line) { | 702 void _recordStdio(String line) { |
| 702 double elapsedTime = _time.elapsedTicks / _time.frequency; | 703 double elapsedTime = _time.elapsedTicks / _time.frequency; |
| 703 line = "$elapsedTime: $line"; | 704 line = "$elapsedTime: $line"; |
| 704 if (_debuggingStdio) { | 705 if (_debuggingStdio) { |
| 705 print(line); | 706 print(line); |
| 706 } | 707 } |
| 707 _recordedStdio.add(line); | 708 _recordedStdio.add(line); |
| 708 } | 709 } |
| 709 } | 710 } |
| OLD | NEW |