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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 | 653 |
654 /** | 654 /** |
655 * Start the server. If [profileServer] is `true`, the server will be started | 655 * Start the server. If [profileServer] is `true`, the server will be started |
656 * with "--observe" and "--pause-isolates-on-exit", allowing the observatory | 656 * with "--observe" and "--pause-isolates-on-exit", allowing the observatory |
657 * to be used. | 657 * to be used. |
658 */ | 658 */ |
659 Future start( | 659 Future start( |
660 {bool checked: true, | 660 {bool checked: true, |
661 int diagnosticPort, | 661 int diagnosticPort, |
662 bool enableNewAnalysisDriver: false, | 662 bool enableNewAnalysisDriver: false, |
663 bool noErrorNotification: false, | |
664 bool profileServer: false, | 663 bool profileServer: false, |
665 String sdkPath, | 664 String sdkPath, |
666 int servicesPort, | 665 int servicesPort, |
667 bool useAnalysisHighlight2: false}) { | 666 bool useAnalysisHighlight2: false}) { |
668 if (_process != null) { | 667 if (_process != null) { |
669 throw new Exception('Process already started'); | 668 throw new Exception('Process already started'); |
670 } | 669 } |
671 _time.start(); | 670 _time.start(); |
672 String dartBinary = Platform.executable; | 671 String dartBinary = Platform.executable; |
673 String rootDir = | 672 String rootDir = |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 708 } |
710 if (sdkPath != null) { | 709 if (sdkPath != null) { |
711 arguments.add('--sdk=$sdkPath'); | 710 arguments.add('--sdk=$sdkPath'); |
712 } | 711 } |
713 if (useAnalysisHighlight2) { | 712 if (useAnalysisHighlight2) { |
714 arguments.add('--useAnalysisHighlight2'); | 713 arguments.add('--useAnalysisHighlight2'); |
715 } | 714 } |
716 if (!enableNewAnalysisDriver) { | 715 if (!enableNewAnalysisDriver) { |
717 arguments.add('--disable-new-analysis-driver'); | 716 arguments.add('--disable-new-analysis-driver'); |
718 } | 717 } |
719 if (noErrorNotification) { | |
720 arguments.add('--no-error-notification'); | |
721 } | |
722 // print('Launching $serverPath'); | 718 // print('Launching $serverPath'); |
723 // print('$dartBinary ${arguments.join(' ')}'); | 719 // print('$dartBinary ${arguments.join(' ')}'); |
724 // TODO(devoncarew): We could experiment with instead launching the analysis | 720 // TODO(devoncarew): We could experiment with instead launching the analysis |
725 // server in a separate isolate. This would make it easier to debug the | 721 // server in a separate isolate. This would make it easier to debug the |
726 // integration tests, and would like speed the tests up as well. | 722 // integration tests, and would like speed the tests up as well. |
727 return Process.start(dartBinary, arguments).then((Process process) { | 723 return Process.start(dartBinary, arguments).then((Process process) { |
728 _process = process; | 724 _process = process; |
729 process.exitCode.then((int code) { | 725 process.exitCode.then((int code) { |
730 if (code != 0) { | 726 if (code != 0) { |
731 _badDataFromServer('server terminated with exit code $code'); | 727 _badDataFromServer('server terminated with exit code $code'); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 void populateMismatches(item, List<MismatchDescriber> mismatches); | 979 void populateMismatches(item, List<MismatchDescriber> mismatches); |
984 | 980 |
985 /** | 981 /** |
986 * Create a [MismatchDescriber] describing a mismatch with a simple string. | 982 * Create a [MismatchDescriber] describing a mismatch with a simple string. |
987 */ | 983 */ |
988 MismatchDescriber simpleDescription(String description) => | 984 MismatchDescriber simpleDescription(String description) => |
989 (Description mismatchDescription) { | 985 (Description mismatchDescription) { |
990 mismatchDescription.add(description); | 986 mismatchDescription.add(description); |
991 }; | 987 }; |
992 } | 988 } |
OLD | NEW |