| 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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 for (String line in _recordedStdio) { | 455 for (String line in _recordedStdio) { |
| 456 print(line); | 456 print(line); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 /** | 460 /** |
| 461 * Find the root directory of the analysis_server package by proceeding | 461 * Find the root directory of the analysis_server package by proceeding |
| 462 * upward to the 'test' dir, and then going up one more directory. | 462 * upward to the 'test' dir, and then going up one more directory. |
| 463 */ | 463 */ |
| 464 String findRoot(String pathname) { | 464 String findRoot(String pathname) { |
| 465 while (basename(pathname) != 'test') { | 465 while (!['benchmark', 'test'].contains(basename(pathname))) { |
| 466 String parent = dirname(pathname); | 466 String parent = dirname(pathname); |
| 467 if (parent.length >= pathname.length) { | 467 if (parent.length >= pathname.length) { |
| 468 throw new Exception("Can't find root directory"); | 468 throw new Exception("Can't find root directory"); |
| 469 } | 469 } |
| 470 pathname = parent; | 470 pathname = parent; |
| 471 } | 471 } |
| 472 return dirname(pathname); | 472 return dirname(pathname); |
| 473 } | 473 } |
| 474 | 474 |
| 475 /** | 475 /** |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 void populateMismatches(item, List<MismatchDescriber> mismatches); | 860 void populateMismatches(item, List<MismatchDescriber> mismatches); |
| 861 | 861 |
| 862 /** | 862 /** |
| 863 * Create a [MismatchDescriber] describing a mismatch with a simple string. | 863 * Create a [MismatchDescriber] describing a mismatch with a simple string. |
| 864 */ | 864 */ |
| 865 MismatchDescriber simpleDescription(String description) => | 865 MismatchDescriber simpleDescription(String description) => |
| 866 (Description mismatchDescription) { | 866 (Description mismatchDescription) { |
| 867 mismatchDescription.add(description); | 867 mismatchDescription.add(description); |
| 868 }; | 868 }; |
| 869 } | 869 } |
| OLD | NEW |