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:io'; | 10 import 'dart:io'; |
11 import 'dart:isolate'; | |
12 | 11 |
13 import 'package:package_resolver/package_resolver.dart'; | 12 import 'package:package_resolver/package_resolver.dart'; |
14 import 'package:path/path.dart' as p; | 13 import 'package:path/path.dart' as p; |
15 import 'package:scheduled_test/descriptor.dart' as d; | 14 import 'package:scheduled_test/descriptor.dart' as d; |
16 import 'package:scheduled_test/scheduled_process.dart'; | 15 import 'package:scheduled_test/scheduled_process.dart'; |
17 import 'package:scheduled_test/scheduled_stream.dart'; | 16 import 'package:scheduled_test/scheduled_stream.dart'; |
18 import 'package:scheduled_test/scheduled_test.dart'; | 17 import 'package:scheduled_test/scheduled_test.dart'; |
19 import 'package:test/src/util/io.dart'; | 18 import 'package:test/src/util/io.dart'; |
20 | 19 |
21 /// The path to the root directory of the `test` package. | 20 /// The path to the root directory of the `test` package. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 process.stdoutStream().listen(print); | 126 process.stdoutStream().listen(print); |
128 process.stderrStream().listen(print); | 127 process.stderrStream().listen(print); |
129 } | 128 } |
130 | 129 |
131 return process; | 130 return process; |
132 } | 131 } |
133 | 132 |
134 /// Runs Dart. | 133 /// Runs Dart. |
135 ScheduledProcess runDart(List<String> args, {Map<String, String> environment, | 134 ScheduledProcess runDart(List<String> args, {Map<String, String> environment, |
136 String description}) { | 135 String description}) { |
137 var allArgs = Platform.executableArguments | 136 var allArgs = <Object>[] |
nweiz
2016/08/30 20:23:20
<String>[]
kevmoo
2016/08/30 22:11:49
Nope. This was the problem. This contains both `St
| |
138 .where((arg) => | 137 ..addAll(Platform.executableArguments.where((arg) => |
139 !arg.startsWith("--package-root=") && !arg.startsWith("--packages=")) | 138 !arg.startsWith("--package-root=") && !arg.startsWith("--packages="))) |
140 .toList() | 139 ..add(PackageResolver.current.processArgument) |
141 ..add(PackageResolver.current.processArgument) | 140 ..addAll(args); |
142 ..addAll(args); | |
143 | 141 |
144 return new ScheduledProcess.start( | 142 return new ScheduledProcess.start( |
145 p.absolute(Platform.resolvedExecutable), allArgs, | 143 p.absolute(Platform.resolvedExecutable), allArgs, |
146 workingDirectory: _sandbox, | 144 workingDirectory: _sandbox, |
147 environment: environment, | 145 environment: environment, |
148 description: description); | 146 description: description); |
149 } | 147 } |
150 | 148 |
151 /// Runs Pub. | 149 /// Runs Pub. |
152 ScheduledProcess runPub(List args, {Map<String, String> environment}) { | 150 ScheduledProcess runPub(List args, {Map<String, String> environment}) { |
(...skipping 22 matching lines...) Expand all Loading... | |
175 var match; | 173 var match; |
176 while (match == null) { | 174 while (match == null) { |
177 var line = await pub.stdout.next(); | 175 var line = await pub.stdout.next(); |
178 match = _servingRegExp.firstMatch(line); | 176 match = _servingRegExp.firstMatch(line); |
179 } | 177 } |
180 _pubServePortCompleter.complete(int.parse(match[1])); | 178 _pubServePortCompleter.complete(int.parse(match[1])); |
181 }, "waiting for pub serve to emit its port number"); | 179 }, "waiting for pub serve to emit its port number"); |
182 | 180 |
183 return pub; | 181 return pub; |
184 } | 182 } |
OLD | NEW |