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

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

Issue 10383203: Add base Version class to start support versioning in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 _runScheduled(Directory parentDir, List<_ScheduledEvent> scheduled) { 136 _runScheduled(Directory parentDir, List<_ScheduledEvent> scheduled) {
137 if (scheduled == null) return new Future.immediate(null); 137 if (scheduled == null) return new Future.immediate(null);
138 var future = Futures.wait(scheduled.map((event) => event(parentDir))); 138 var future = Futures.wait(scheduled.map((event) => event(parentDir)));
139 scheduled.clear(); 139 scheduled.clear();
140 return future; 140 return future;
141 } 141 }
142 142
143 Future<ProcessResult> _runPub(List<String> pubArgs, String workingDir) { 143 Future<ProcessResult> _runPub(List<String> pubArgs, String workingDir) {
144 // Find a dart executable we can use to run pub. Uses the one that the 144 // Find a dart executable we can use to run pub. Uses the one that the
145 // test infrastructure uses. 145 // test infrastructure uses. We are not using new Options.executable here
146 // because that gets confused if you invoked Dart through a shell script.
146 final scriptDir = new File(new Options().script).directorySync().path; 147 final scriptDir = new File(new Options().script).directorySync().path;
147 final platform = Platform.operatingSystem; 148 final platform = Platform.operatingSystem;
148 final dartBin = new File(new Options().executable).fullPathSync(); 149 final dartBin = join(scriptDir, '../../../tools/testing/bin/$platform/dart');
149 150
150 // Find the main pub entrypoint. 151 // Find the main pub entrypoint.
151 final pubPath = fs.joinPaths(scriptDir, '../../pub/pub.dart'); 152 final pubPath = fs.joinPaths(scriptDir, '../../pub/pub.dart');
152 153
153 final args = ['--enable-type-checks', '--enable-asserts', pubPath]; 154 final args = ['--enable-type-checks', '--enable-asserts', pubPath];
154 args.addAll(pubArgs); 155 args.addAll(pubArgs);
155 156
156 return runProcess(dartBin, args, workingDir); 157 return runProcess(dartBin, args, workingDir);
157 } 158 }
158 159
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 _scheduledBeforePub.add(event); 341 _scheduledBeforePub.add(event);
341 } 342 }
342 343
343 /** 344 /**
344 * Schedules a callback to be called after Pub is run with [runPub]. 345 * Schedules a callback to be called after Pub is run with [runPub].
345 */ 346 */
346 void _scheduleAfterPub(_ScheduledEvent event) { 347 void _scheduleAfterPub(_ScheduledEvent event) {
347 if (_scheduledAfterPub == null) _scheduledAfterPub = []; 348 if (_scheduledAfterPub == null) _scheduledAfterPub = [];
348 _scheduledAfterPub.add(event); 349 _scheduledAfterPub.add(event);
349 } 350 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698