Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: utils/tests/pub/test_pub.dart

Issue 10392023: Change dart:io to use Future for one-shot operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Adding stable test binaries Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/tests/pub/pub_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub 6 * Test infrastructure for testing pub. Unlike typical unit tests, most pub
7 * tests are integration tests that stage some stuff on the file system, run 7 * tests are integration tests that stage some stuff on the file system, run
8 * pub, and then validate the results. This library provides an API to build 8 * pub, and then validate the results. This library provides an API to build
9 * tests like that. 9 * tests like that.
10 */ 10 */
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (sdk == null) return new Future.immediate(null); 130 if (sdk == null) return new Future.immediate(null);
131 131
132 return dir('sdk', sdk).create(sandboxDir); 132 return dir('sdk', sdk).create(sandboxDir);
133 } 133 }
134 134
135 Future<ProcessResult> _runPub(List<String> pubArgs, String workingDir) { 135 Future<ProcessResult> _runPub(List<String> pubArgs, String workingDir) {
136 // Find a dart executable we can use to run pub. Uses the one that the 136 // Find a dart executable we can use to run pub. Uses the one that the
137 // test infrastructure uses. 137 // test infrastructure uses.
138 final scriptDir = new File(new Options().script).directorySync().path; 138 final scriptDir = new File(new Options().script).directorySync().path;
139 final platform = Platform.operatingSystem; 139 final platform = Platform.operatingSystem;
140 final dartBin = join(scriptDir, '../../../tools/testing/bin/$platform/dart'); 140 final dartBin = new File(new Options().executable).fullPathSync();
141 141
142 // Find the main pub entrypoint. 142 // Find the main pub entrypoint.
143 final pubPath = fs.joinPaths(scriptDir, '../../pub/pub.dart'); 143 final pubPath = fs.joinPaths(scriptDir, '../../pub/pub.dart');
144 144
145 final args = ['--enable-type-checks', '--enable-asserts', pubPath]; 145 final args = ['--enable-type-checks', '--enable-asserts', pubPath];
146 args.addAll(pubArgs); 146 args.addAll(pubArgs);
147 147
148 return runProcess(dartBin, args, workingDir); 148 return runProcess(dartBin, args, workingDir);
149 } 149 }
150 150
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 return Futures.wait(entryFutures).transform((entries) { 324 return Futures.wait(entryFutures).transform((entries) {
325 for (final entry in entries) { 325 for (final entry in entries) {
326 if (entry != null) return entry; 326 if (entry != null) return entry;
327 } 327 }
328 328
329 // If we got here, all of the sub-entries were valid. 329 // If we got here, all of the sub-entries were valid.
330 return null; 330 return null;
331 }); 331 });
332 } 332 }
333 } 333 }
OLDNEW
« no previous file with comments | « utils/tests/pub/pub_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698