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

Unified Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/sdk/lib/_internal/pub/test/test_pub.dart
similarity index 96%
rename from utils/tests/pub/test_pub.dart
rename to sdk/lib/_internal/pub/test/test_pub.dart
index f5cb82c3841bebf3b36463419229bd949daa74ac..a1188805aa05e7857300a17ad0a44f45d639009f 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/sdk/lib/_internal/pub/test/test_pub.dart
@@ -24,20 +24,20 @@ import 'package:scheduled_test/scheduled_server.dart';
import 'package:scheduled_test/scheduled_test.dart';
import 'package:yaml/yaml.dart';
-import '../../pub/entrypoint.dart';
+import '../lib/src/entrypoint.dart';
// TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides
// with the git descriptor method. Maybe we should try to clean up the top level
// scope a bit?
-import '../../pub/git.dart' as gitlib;
-import '../../pub/git_source.dart';
-import '../../pub/hosted_source.dart';
-import '../../pub/http.dart';
-import '../../pub/io.dart';
-import '../../pub/path_source.dart';
-import '../../pub/safe_http_server.dart';
-import '../../pub/system_cache.dart';
-import '../../pub/utils.dart';
-import '../../pub/validator.dart';
+import '../lib/src/git.dart' as gitlib;
+import '../lib/src/git_source.dart';
+import '../lib/src/hosted_source.dart';
+import '../lib/src/http.dart';
+import '../lib/src/io.dart';
+import '../lib/src/path_source.dart';
+import '../lib/src/safe_http_server.dart';
+import '../lib/src/system_cache.dart';
+import '../lib/src/utils.dart';
+import '../lib/src/validator.dart';
import 'command_line_config.dart';
import 'descriptor.dart' as d;
@@ -270,11 +270,11 @@ void _integration(String description, void body(), [Function testFn]) {
});
}
-/// Get the path to the root "util/test/pub" directory containing the pub
+/// Get the path to the root "pub/test" directory containing the pub
/// tests.
String get testDirectory {
var dir = new Options().script;
- while (path.basename(dir) != 'pub') dir = path.dirname(dir);
+ while (path.basename(dir) != 'test') dir = path.dirname(dir);
return path.absolute(dir);
}
@@ -368,7 +368,7 @@ ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
}
// Find the main pub entrypoint.
- var pubPath = path.join(testDirectory, '..', '..', 'pub', 'pub.dart');
+ var pubPath = path.join(testDirectory, '..', 'bin', 'pub.dart');
var dartArgs = ['--package-root=$_packageRoot/', '--checked', pubPath,
'--trace'];
@@ -395,14 +395,16 @@ ScheduledProcess startPub({List args, Future<Uri> tokenEndpoint}) {
/// Whether pub is running from within the Dart SDK, as opposed to from the Dart
/// source repository.
-bool get _runningFromSdk => path.dirname(relativeToPub('..')) == 'util';
+bool get _runningFromSdk =>
+ fileExists(relativeToPub(path.join('..', '..', '..', '..', 'version')));
// TODO(nweiz): use the built-in mechanism for accessing this once it exists
// (issue 9119).
/// The path to the `packages` directory from which pub loads its dependencies.
String get _packageRoot {
if (_runningFromSdk) {
- return path.absolute(relativeToPub(path.join('..', '..', 'packages')));
+ return path.absolute(relativeToPub(
+ path.join('..', '..', '..', '..', 'packages')));
} else {
return path.absolute(path.join(
path.dirname(new Options().executable), '..', '..', 'packages'));

Powered by Google App Engine
This is Rietveld 408576698