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

Unified Diff: sdk/lib/_internal/pub/test/run/utils.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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/run/utils.dart
diff --git a/sdk/lib/_internal/pub/test/run/utils.dart b/sdk/lib/_internal/pub/test/run/utils.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6535b33bff9d650af556b9cceac23abc8b3be8c7
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/run/utils.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2014, 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.
+
+import 'package:scheduled_test/scheduled_process.dart';
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../test_pub.dart';
+
+/// Schedules starting the "pub run" process and validates the expected startup
+/// output.
+///
+/// if [transformers] is given, it should contain a list of transformer IDs
+/// (like "myapp/src/transformer") and this will validate that the output for
+/// loading those is shown.
+///
+/// Returns the `pub run` process.
+ScheduledProcess pubRun({Iterable<String> args,
+ Iterable<String> transformers}) {
+ var pub = startPub(args: ["run"]..addAll(args));
+
+ // This isn't normally printed, but the pub test infrastructure runs pub in
+ // verbose mode, which enables this.
+ pub.stdout.expect(startsWith("Loading source assets"));
+
+ if (transformers != null) {
+ for (var transformer in transformers) {
+ pub.stdout.expect(startsWith("Loading $transformer transformers"));
+ }
+ }
+ return pub;
+}

Powered by Google App Engine
This is Rietveld 408576698