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

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

Issue 301063002: First stab at "pub run" command. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO. Created 6 years, 6 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/run/utils.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 library pub_upgrade_test; 5 library pub_upgrade_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
11 import '../lib/src/lock_file.dart'; 11 import '../lib/src/lock_file.dart';
12 import '../lib/src/log.dart' as log; 12 import '../lib/src/log.dart' as log;
13 import '../lib/src/package.dart'; 13 import '../lib/src/package.dart';
14 import '../lib/src/pubspec.dart'; 14 import '../lib/src/pubspec.dart';
15 import '../lib/src/sdk.dart' as sdk; 15 import '../lib/src/sdk.dart' as sdk;
16 import '../lib/src/source/cached.dart'; 16 import '../lib/src/source/cached.dart';
17 import '../lib/src/system_cache.dart'; 17 import '../lib/src/system_cache.dart';
18 import '../lib/src/utils.dart'; 18 import '../lib/src/utils.dart';
19 import '../lib/src/version.dart'; 19 import '../lib/src/version.dart';
20 import '../lib/src/solver/version_solver.dart'; 20 import '../lib/src/solver/version_solver.dart';
21 import 'test_pub.dart'; 21 import 'test_pub.dart';
22 22
23 MockSource source1; 23 MockSource source1;
24 MockSource source2; 24 MockSource source2;
25 25
26 main() { 26 main() {
27 initConfig(); 27 initConfig();
28 28
29 // Uncomment this to debug failing tests. 29 // Uncomment this to debug failing tests.
30 // log.showSolver(); 30 // log.verbosity = log.Verbosity.SOLVER;
31 31
32 // Since this test isn't run from the SDK, it can't find the "version" file 32 // Since this test isn't run from the SDK, it can't find the "version" file
33 // to load. Instead, just manually inject a version. 33 // to load. Instead, just manually inject a version.
34 sdk.version = new Version(1, 2, 3); 34 sdk.version = new Version(1, 2, 3);
35 35
36 group('basic graph', basicGraph); 36 group('basic graph', basicGraph);
37 group('with lockfile', withLockFile); 37 group('with lockfile', withLockFile);
38 group('root dependency', rootDependency); 38 group('root dependency', rootDependency);
39 group('dev dependency', devDependency); 39 group('dev dependency', devDependency);
40 group('unsolvable', unsolvable); 40 group('unsolvable', unsolvable);
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 testResolve(String description, Map packages, { 1060 testResolve(String description, Map packages, {
1061 Map lockfile, Map overrides, Map result, FailMatcherBuilder error, 1061 Map lockfile, Map overrides, Map result, FailMatcherBuilder error,
1062 int maxTries}) { 1062 int maxTries}) {
1063 _testResolve(test, description, packages, lockfile: lockfile, 1063 _testResolve(test, description, packages, lockfile: lockfile,
1064 overrides: overrides, result: result, error: error, maxTries: maxTries); 1064 overrides: overrides, result: result, error: error, maxTries: maxTries);
1065 } 1065 }
1066 1066
1067 solo_testResolve(String description, Map packages, { 1067 solo_testResolve(String description, Map packages, {
1068 Map lockfile, Map overrides, Map result, FailMatcherBuilder error, 1068 Map lockfile, Map overrides, Map result, FailMatcherBuilder error,
1069 int maxTries}) { 1069 int maxTries}) {
1070 log.showSolver(); 1070 log.verbosity = log.Verbosity.SOLVER;
1071 _testResolve(solo_test, description, packages, lockfile: lockfile, 1071 _testResolve(solo_test, description, packages, lockfile: lockfile,
1072 overrides: overrides, result: result, error: error, maxTries: maxTries); 1072 overrides: overrides, result: result, error: error, maxTries: maxTries);
1073 } 1073 }
1074 1074
1075 _testResolve(void testFn(String description, Function body), 1075 _testResolve(void testFn(String description, Function body),
1076 String description, Map packages, { 1076 String description, Map packages, {
1077 Map lockfile, Map overrides, Map result, FailMatcherBuilder error, 1077 Map lockfile, Map overrides, Map result, FailMatcherBuilder error,
1078 int maxTries}) { 1078 int maxTries}) {
1079 if (maxTries == null) maxTries = 1; 1079 if (maxTries == null) maxTries = 1;
1080 1080
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 } 1473 }
1474 1474
1475 var source = "mock1"; 1475 var source = "mock1";
1476 if (match[7] != null) { 1476 if (match[7] != null) {
1477 source = match[7]; 1477 source = match[7];
1478 if (source == "root") source = null; 1478 if (source == "root") source = null;
1479 } 1479 }
1480 1480
1481 return new PackageId(name, source, parsedVersion, description); 1481 return new PackageId(name, source, parsedVersion, description);
1482 } 1482 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/test/run/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698