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

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

Issue 548603002: Use the VM to detect when a precompiled executable is out-of-date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 3 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/test/snapshot/recompiles_if_the_sdk_is_out_of_date_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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 "author": "Natalie Weizenbaum <nweiz@google.com>", 818 "author": "Natalie Weizenbaum <nweiz@google.com>",
819 "homepage": "http://pub.dartlang.org", 819 "homepage": "http://pub.dartlang.org",
820 "description": "A package, I guess." 820 "description": "A package, I guess."
821 }; 821 };
822 822
823 if (dependencies != null) package["dependencies"] = dependencies; 823 if (dependencies != null) package["dependencies"] = dependencies;
824 824
825 return package; 825 return package;
826 } 826 }
827 827
828 /// Resolves [target] relative to the path to pub's `test/asset` directory.
829 String testAssetPath(String target) =>
830 p.join(p.dirname(libraryPath('test_pub')), 'asset', target);
831
828 /// Returns a Map in the format used by the pub.dartlang.org API to represent a 832 /// Returns a Map in the format used by the pub.dartlang.org API to represent a
829 /// package version. 833 /// package version.
830 /// 834 ///
831 /// [pubspec] is the parsed pubspec of the package version. If [full] is true, 835 /// [pubspec] is the parsed pubspec of the package version. If [full] is true,
832 /// this returns the complete map, including metadata that's only included when 836 /// this returns the complete map, including metadata that's only included when
833 /// requesting the package version directly. 837 /// requesting the package version directly.
834 Map packageVersionApiMap(Map pubspec, {bool full: false}) { 838 Map packageVersionApiMap(Map pubspec, {bool full: false}) {
835 var name = pubspec['name']; 839 var name = pubspec['name'];
836 var version = pubspec['version']; 840 var version = pubspec['version'];
837 var map = { 841 var map = {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 _lastMatcher.matches(item.last, matchState); 983 _lastMatcher.matches(item.last, matchState);
980 } 984 }
981 985
982 Description describe(Description description) { 986 Description describe(Description description) {
983 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 987 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
984 } 988 }
985 } 989 }
986 990
987 /// A [StreamMatcher] that matches multiple lines of output. 991 /// A [StreamMatcher] that matches multiple lines of output.
988 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); 992 StreamMatcher emitsLines(String output) => inOrder(output.split("\n"));
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/test/snapshot/recompiles_if_the_sdk_is_out_of_date_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698