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 30 matching lines...) Expand all Loading... |
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 initConfig(); | 48 initConfig(); |
49 withBarbackVersions("any", () { | 49 withBarbackVersions("any", () { |
50 integration('displays transformer log messages', () { | 50 integration('displays transformer log messages', () { |
51 d.dir(appPath, [ | 51 d.dir(appPath, [d.pubspec({ |
52 d.pubspec({ | |
53 "name": "myapp", | 52 "name": "myapp", |
54 "transformers": ["myapp/src/transformer"] | 53 "transformers": ["myapp/src/transformer"] |
55 }), | 54 }), |
56 d.dir("lib", [ | 55 d.dir( |
57 d.file("lib.dart", LIB), | 56 "lib", |
58 d.dir("src", [ | 57 [ |
59 d.file("transformer.dart", TRANSFORMER) | 58 d.file("lib.dart", LIB), |
60 ]) | 59 d.dir("src", [d.file("transformer.dart", TRANSFORMER)])]), |
61 ]), | 60 d.dir("bin", [d.file("script.dart", SCRIPT)])]).create(); |
62 d.dir("bin", [ | |
63 d.file("script.dart", SCRIPT) | |
64 ]) | |
65 ]).create(); | |
66 | 61 |
67 createLockFile('myapp', pkg: ['barback']); | 62 createLockFile('myapp', pkg: ['barback']); |
68 | 63 |
69 var pub = pubRun(args: ["script"]); | 64 var pub = pubRun(args: ["script"]); |
70 | 65 |
71 // Note that the info log is only displayed here because the test | 66 // Note that the info log is only displayed here because the test |
72 // harness runs pub in verbose mode. By default, only the warning would | 67 // harness runs pub in verbose mode. By default, only the warning would |
73 // be shown. | 68 // be shown. |
74 pub.stdout.expect("[Info from Logging]:"); | 69 pub.stdout.expect("[Info from Logging]:"); |
75 pub.stdout.expect("myapp|bin/script.dart."); | 70 pub.stdout.expect("myapp|bin/script.dart."); |
76 | 71 |
77 pub.stderr.expect("[Warning from Logging]:"); | 72 pub.stderr.expect("[Warning from Logging]:"); |
78 pub.stderr.expect("myapp|bin/script.dart."); | 73 pub.stderr.expect("myapp|bin/script.dart."); |
79 | 74 |
80 pub.stdout.expect("[Info from Logging]:"); | 75 pub.stdout.expect("[Info from Logging]:"); |
81 pub.stdout.expect("myapp|lib/lib.dart."); | 76 pub.stdout.expect("myapp|lib/lib.dart."); |
82 | 77 |
83 pub.stderr.expect("[Warning from Logging]:"); | 78 pub.stderr.expect("[Warning from Logging]:"); |
84 pub.stderr.expect("myapp|lib/lib.dart."); | 79 pub.stderr.expect("myapp|lib/lib.dart."); |
85 | 80 |
86 pub.stdout.expect("lib"); | 81 pub.stdout.expect("lib"); |
87 pub.shouldExit(); | 82 pub.shouldExit(); |
88 }); | 83 }); |
89 }); | 84 }); |
90 } | 85 } |
OLD | NEW |