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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/global/run/mode_test.dart

Issue 887223007: Revert "Use native async/await support in pub." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import '../../descriptor.dart' as d; 5 import '../../descriptor.dart' as d;
6 import '../../test_pub.dart'; 6 import '../../test_pub.dart';
7 7
8 const TRANSFORMER = """ 8 const TRANSFORMER = """
9 import 'dart:async'; 9 import 'dart:async';
10 10
11 import 'package:barback/barback.dart'; 11 import 'package:barback/barback.dart';
12 12
13 class DartTransformer extends Transformer { 13 class DartTransformer extends Transformer {
14 final BarbackSettings _settings; 14 final BarbackSettings _settings;
15 15
16 DartTransformer.asPlugin(this._settings); 16 DartTransformer.asPlugin(this._settings);
17 17
18 String get allowedExtensions => '.in'; 18 String get allowedExtensions => '.in';
19 19
20 void apply(Transform transform) { 20 void apply(Transform transform) {
21 transform.addOutput(new Asset.fromString( 21 transform.addOutput(new Asset.fromString(
22 new AssetId(transform.primaryInput.id.package, "bin/script.dart"), 22 new AssetId(transform.primaryInput.id.package, "bin/script.dart"),
23 "void main() => print('\${_settings.mode.name}');")); 23 "void main() => print('\${_settings.mode.name}');"));
24 } 24 }
25 } 25 }
26 """; 26 """;
27 27
28 main() { 28 main() {
29 initConfig(); 29 initConfig();
30 integration('runs a script in an activated package with customizable modes', 30 integration(
31 'runs a script in an activated package with customizable modes',
31 () { 32 () {
32 servePackages((builder) { 33 servePackages((builder) {
33 builder.serveRepoPackage("barback"); 34 builder.serveRepoPackage("barback");
34 35
35 builder.serve("foo", "1.0.0", 36 builder.serve("foo", "1.0.0", deps: {
36 deps: {"barback": "any"}, 37 "barback": "any"
37 pubspec: {"transformers": ["foo/src/transformer"]}, 38 }, pubspec: {
39 "transformers": ["foo/src/transformer"]
40 },
38 contents: [ 41 contents: [
39 d.dir("lib", [d.dir("src", [ 42 d.dir(
40 d.file("transformer.dart", TRANSFORMER), 43 "lib",
41 d.file("primary.in", "") 44 [
42 ])]) 45 d.dir(
43 ]); 46 "src",
47 [d.file("transformer.dart", TRANSFORMER), d.file("prim ary.in", "")])])]);
44 }); 48 });
45 49
46 schedulePub(args: ["global", "activate", "foo"]); 50 schedulePub(args: ["global", "activate", "foo"]);
47 51
48 // By default it should run in release mode. 52 // By default it should run in release mode.
49 var pub = pubRun(global: true, args: ["foo:script"]); 53 var pub = pubRun(global: true, args: ["foo:script"]);
50 pub.stdout.expect("release"); 54 pub.stdout.expect("release");
51 pub.shouldExit(); 55 pub.shouldExit();
52 56
53 // A custom mode should be specifiable. 57 // A custom mode should be specifiable.
54 pub = pubRun(global: true, args: ["--mode", "custom-mode", "foo:script"]); 58 pub = pubRun(global: true, args: ["--mode", "custom-mode", "foo:script"]);
55 pub.stdout.expect("custom-mode"); 59 pub.stdout.expect("custom-mode");
56 pub.shouldExit(); 60 pub.shouldExit();
57 }); 61 });
58 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698