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 // TODO(nweiz): Remove this tag when we can get [packageDir] working without it | 5 // TODO(nweiz): Remove this tag when we can get [packageDir] working without it |
6 // (dart-lang/sdk#24022). | 6 // (dart-lang/sdk#24022). |
7 library test.test.io; | 7 library test.test.io; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'dart:convert'; |
10 import 'dart:io'; | 11 import 'dart:io'; |
11 | 12 |
12 import 'package:path/path.dart' as p; | 13 import 'package:path/path.dart' as p; |
13 import 'package:scheduled_test/descriptor.dart' as d; | 14 import 'package:scheduled_test/descriptor.dart' as d; |
14 import 'package:scheduled_test/scheduled_process.dart'; | 15 import 'package:scheduled_test/scheduled_process.dart'; |
15 import 'package:scheduled_test/scheduled_stream.dart'; | 16 import 'package:scheduled_test/scheduled_stream.dart'; |
16 import 'package:scheduled_test/scheduled_test.dart'; | 17 import 'package:scheduled_test/scheduled_test.dart'; |
17 import 'package:test/src/util/io.dart'; | 18 import 'package:test/src/util/io.dart'; |
| 19 import 'package:yaml/yaml.dart'; |
18 | 20 |
19 /// The path to the root directory of the `test` package. | 21 /// The path to the root directory of the `test` package. |
20 final String packageDir = p.dirname(p.dirname(libraryPath(#test.test.io))); | 22 final String packageDir = p.dirname(p.dirname(libraryPath(#test.test.io))); |
21 | 23 |
22 /// The path to the `pub` executable in the current Dart SDK. | 24 /// The path to the `pub` executable in the current Dart SDK. |
23 final _pubPath = p.absolute(p.join( | 25 final _pubPath = p.absolute(p.join( |
24 p.dirname(Platform.resolvedExecutable), | 26 p.dirname(Platform.resolvedExecutable), |
25 Platform.isWindows ? 'pub.bat' : 'pub')); | 27 Platform.isWindows ? 'pub.bat' : 'pub')); |
26 | 28 |
27 /// The platform-specific message emitted when a nonexistent file is loaded. | 29 /// The platform-specific message emitted when a nonexistent file is loaded. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 var match; | 177 var match; |
176 while (match == null) { | 178 while (match == null) { |
177 var line = await pub.stdout.next(); | 179 var line = await pub.stdout.next(); |
178 match = _servingRegExp.firstMatch(line); | 180 match = _servingRegExp.firstMatch(line); |
179 } | 181 } |
180 _pubServePortCompleter.complete(int.parse(match[1])); | 182 _pubServePortCompleter.complete(int.parse(match[1])); |
181 }, "waiting for pub serve to emit its port number"); | 183 }, "waiting for pub serve to emit its port number"); |
182 | 184 |
183 return pub; | 185 return pub; |
184 } | 186 } |
OLD | NEW |