| Index: pkg/analyzer_cli/test/utils.dart
|
| diff --git a/pkg/analyzer_cli/test/utils.dart b/pkg/analyzer_cli/test/utils.dart
|
| index 25779ab18668b6bade22de94de3fd060b4582032..07dbe4baaa23e97b719d164bb27d08044f37d0a4 100644
|
| --- a/pkg/analyzer_cli/test/utils.dart
|
| +++ b/pkg/analyzer_cli/test/utils.dart
|
| @@ -8,7 +8,16 @@ import 'dart:io';
|
| import 'dart:mirrors';
|
|
|
| import 'package:analyzer/analyzer.dart';
|
| +import 'package:analyzer/src/generated/java_io.dart';
|
| import 'package:path/path.dart' as pathos;
|
| +import 'package:path/path.dart' as path;
|
| +import 'package:unittest/unittest.dart';
|
| +
|
| +/// Gets the test directory in a way that works with
|
| +/// package:test and package:unittest.
|
| +/// See <https://github.com/dart-lang/test/issues/110> for more info.
|
| +final String testDirectory = pathos.dirname(
|
| + pathos.fromUri((reflectClass(_TestUtils).owner as LibraryMirror).uri));
|
|
|
| /// Returns the string representation of the [AnalyzerErrorGroup] thrown when
|
| /// parsing [contents] as a Dart file. If [contents] doesn't throw any errors,
|
| @@ -34,6 +43,12 @@ String errorsForFile(String contents) {
|
| });
|
| }
|
|
|
| +/// Test env setup (copied from `analyzer/test/utils.dart`).
|
| +void initializeTestEnvironment() {
|
| + groupSep = ' | ';
|
| + JavaFile.pathContext = path.posix;
|
| +}
|
| +
|
| /// Creates a temporary directory and passes its path to [fn]. Once [fn]
|
| /// completes, the temporary directory and all its contents will be deleted.
|
| ///
|
| @@ -47,10 +62,4 @@ dynamic withTempDir(fn(String path)) {
|
| }
|
| }
|
|
|
| -/// Gets the test directory in a way that works with
|
| -/// package:test and package:unittest.
|
| -/// See <https://github.com/dart-lang/test/issues/110> for more info.
|
| -final String testDirectory = pathos.dirname(
|
| - pathos.fromUri((reflectClass(_TestUtils).owner as LibraryMirror).uri));
|
| -
|
| class _TestUtils {}
|
|
|