OLD | NEW |
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 SCRIPT = """ | 8 const SCRIPT = """ |
9 import "package:myapp/lib.dart"; | 9 import "package:myapp/lib.dart"; |
10 main() { | 10 main() { |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 void declareOutputs(DeclaringTransform transform) { | 40 void declareOutputs(DeclaringTransform transform) { |
41 // TODO(rnystrom): Remove this when #19408 is fixed. | 41 // TODO(rnystrom): Remove this when #19408 is fixed. |
42 transform.declareOutput(transform.primaryId); | 42 transform.declareOutput(transform.primaryId); |
43 } | 43 } |
44 } | 44 } |
45 """; | 45 """; |
46 | 46 |
47 main() { | 47 main() { |
48 integration('displays transformer log messages', () { | 48 integration('displays transformer log messages', () { |
| 49 serveBarback(); |
| 50 |
49 d.dir(appPath, [ | 51 d.dir(appPath, [ |
50 d.pubspec({ | 52 d.pubspec({ |
51 "name": "myapp", | 53 "name": "myapp", |
52 "transformers": ["myapp/src/transformer"] | 54 "transformers": ["myapp/src/transformer"], |
| 55 "dependencies": {"barback": "any"} |
53 }), | 56 }), |
54 d.dir("lib", [ | 57 d.dir("lib", [ |
55 d.file("lib.dart", LIB), | 58 d.file("lib.dart", LIB), |
56 d.dir("src", [ | 59 d.dir("src", [ |
57 d.file("transformer.dart", TRANSFORMER) | 60 d.file("transformer.dart", TRANSFORMER) |
58 ]) | 61 ]) |
59 ]), | 62 ]), |
60 d.dir("bin", [ | 63 d.dir("bin", [ |
61 d.file("script.dart", SCRIPT) | 64 d.file("script.dart", SCRIPT) |
62 ]) | 65 ]) |
63 ]).create(); | 66 ]).create(); |
64 | 67 |
65 createLockFile('myapp', pkg: ['barback']); | 68 pubGet(); |
66 | |
67 var pub = pubRun(args: ["bin/script"]); | 69 var pub = pubRun(args: ["bin/script"]); |
68 | 70 |
69 // Note that the info log is only displayed here because the test | 71 // Note that the info log is only displayed here because the test |
70 // harness runs pub in verbose mode. By default, only the warning would | 72 // harness runs pub in verbose mode. By default, only the warning would |
71 // be shown. | 73 // be shown. |
72 pub.stdout.expect("[Info from Logging]:"); | 74 pub.stdout.expect("[Info from Logging]:"); |
73 pub.stdout.expect("myapp|bin/script.dart."); | 75 pub.stdout.expect("myapp|bin/script.dart."); |
74 | 76 |
75 pub.stderr.expect("[Warning from Logging]:"); | 77 pub.stderr.expect("[Warning from Logging]:"); |
76 pub.stderr.expect("myapp|bin/script.dart."); | 78 pub.stderr.expect("myapp|bin/script.dart."); |
77 | 79 |
78 pub.stdout.expect("[Info from Logging]:"); | 80 pub.stdout.expect("[Info from Logging]:"); |
79 pub.stdout.expect("myapp|lib/lib.dart."); | 81 pub.stdout.expect("myapp|lib/lib.dart."); |
80 | 82 |
81 pub.stderr.expect("[Warning from Logging]:"); | 83 pub.stderr.expect("[Warning from Logging]:"); |
82 pub.stderr.expect("myapp|lib/lib.dart."); | 84 pub.stderr.expect("myapp|lib/lib.dart."); |
83 | 85 |
84 pub.stdout.expect("lib"); | 86 pub.stdout.expect("lib"); |
85 pub.shouldExit(); | 87 pub.shouldExit(); |
86 }); | 88 }); |
87 } | 89 } |
OLD | NEW |