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

Unified Diff: sdk/lib/_internal/pub/test/serve/detects_an_ordering_dependency_cycle.dart

Issue 23924006: Detect transformer dependency cycles in packages using barback transformers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/test/serve/detects_a_transformer_cycle.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/serve/detects_an_ordering_dependency_cycle.dart
diff --git a/sdk/lib/_internal/pub/test/serve/detects_an_ordering_dependency_cycle.dart b/sdk/lib/_internal/pub/test/serve/detects_an_ordering_dependency_cycle.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3316e8d884f54e5c7896eb60aa53d8b23442ae62
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/serve/detects_an_ordering_dependency_cycle.dart
@@ -0,0 +1,67 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library pub_tests;
+
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../descriptor.dart' as d;
+import '../test_pub.dart';
+import 'utils.dart';
+
+main() {
+ initConfig();
+ integration("detects an ordering dependency cycle", () {
+ d.dir("foo", [
+ d.pubspec({
+ "name": "foo",
+ "version": "1.0.0",
+ "transformers": ["myapp/transformer"],
+ "dependencies": {'myapp': {'path': '../myapp'}}
+ })
+ ]).create();
+
+ d.dir("bar", [
+ d.pubspec({
+ "name": "bar",
+ "version": "1.0.0",
+ "dependencies": {'foo': {'path': '../foo'}}
+ }),
+ d.dir("lib", [
+ d.file("transformer.dart", dartTransformer('bar')),
+ ])
+ ]).create();
+
+ d.dir("baz", [
+ d.pubspec({
+ "name": "baz",
+ "version": "1.0.0",
+ "transformers": ["bar/transformer"],
+ "dependencies": {'bar': {'path': '../bar'}}
+ })
+ ]).create();
+
+ d.dir(appPath, [
+ d.pubspec({
+ "name": "myapp",
+ "dependencies": {'baz': {'path': '../baz'}}
+ }),
+ d.dir("lib", [
+ d.file("transformer.dart", dartTransformer('myapp')),
+ ])
+ ]).create();
+
+ createLockFile('myapp', sandbox: ['foo', 'bar', 'baz'], pkg: ['barback']);
+
+ // Use port 0 to get an ephemeral port.
+ var process = startPub(args: ["serve", "--port=0"]);
+ process.shouldExit(1);
+ expect(process.remainingStderr(), completion(equals(
+ "Transformer cycle detected:\n"
+ " bar depends on foo\n"
+ " foo is transformed by myapp/transformer\n"
+ " myapp depends on baz\n"
+ " baz is transformed by bar/transformer")));
+ });
+}
« no previous file with comments | « sdk/lib/_internal/pub/test/serve/detects_a_transformer_cycle.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698