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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/test_pub.dart

Issue 805393002: Update pub to use the new command runner API in args. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 5 years, 11 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 | « sdk/lib/_internal/pub_generated/test/run/errors_if_path_in_dependency_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Test infrastructure for testing pub. 5 /// Test infrastructure for testing pub.
6 /// 6 ///
7 /// Unlike typical unit tests, most pub tests are integration tests that stage 7 /// Unlike typical unit tests, most pub tests are integration tests that stage
8 /// some stuff on the file system, run pub, and then validate the results. This 8 /// some stuff on the file system, run pub, and then validate the results. This
9 /// library provides an API to build tests like that. 9 /// library provides an API to build tests like that.
10 library test_pub; 10 library test_pub;
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 /// A function that creates a [Validator] subclass. 971 /// A function that creates a [Validator] subclass.
972 typedef Validator ValidatorCreator(Entrypoint entrypoint); 972 typedef Validator ValidatorCreator(Entrypoint entrypoint);
973 973
974 /// Schedules a single [Validator] to run on the [appPath]. 974 /// Schedules a single [Validator] to run on the [appPath].
975 /// 975 ///
976 /// Returns a scheduled Future that contains the errors and warnings produced 976 /// Returns a scheduled Future that contains the errors and warnings produced
977 /// by that validator. 977 /// by that validator.
978 Future<Pair<List<String>, List<String>>> 978 Future<Pair<List<String>, List<String>>>
979 schedulePackageValidation(ValidatorCreator fn) { 979 schedulePackageValidation(ValidatorCreator fn) {
980 return schedule(() { 980 return schedule(() {
981 var cache = new SystemCache.withSources(p.join(sandboxDir, cachePath)); 981 var cache =
982 new SystemCache.withSources(rootDir: p.join(sandboxDir, cachePath));
982 983
983 return new Future.sync(() { 984 return new Future.sync(() {
984 var validator = fn(new Entrypoint(p.join(sandboxDir, appPath), cache)); 985 var validator = fn(new Entrypoint(p.join(sandboxDir, appPath), cache));
985 return validator.validate().then((_) { 986 return validator.validate().then((_) {
986 return new Pair(validator.errors, validator.warnings); 987 return new Pair(validator.errors, validator.warnings);
987 }); 988 });
988 }); 989 });
989 }, "validating package"); 990 }, "validating package");
990 } 991 }
991 992
(...skipping 13 matching lines...) Expand all
1005 _lastMatcher.matches(item.last, matchState); 1006 _lastMatcher.matches(item.last, matchState);
1006 } 1007 }
1007 1008
1008 Description describe(Description description) { 1009 Description describe(Description description) {
1009 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 1010 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
1010 } 1011 }
1011 } 1012 }
1012 1013
1013 /// A [StreamMatcher] that matches multiple lines of output. 1014 /// A [StreamMatcher] that matches multiple lines of output.
1014 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); 1015 StreamMatcher emitsLines(String output) => inOrder(output.split("\n"));
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub_generated/test/run/errors_if_path_in_dependency_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698