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 main() { | 9 main() { |
10 print("should not get here!"); | 10 print("should not get here!"); |
(...skipping 15 matching lines...) Expand all Loading... |
26 if (transform.primaryInput.id.path.startsWith("lib")) return; | 26 if (transform.primaryInput.id.path.startsWith("lib")) return; |
27 transform.logger.error('\${transform.primaryInput.id}.'); | 27 transform.logger.error('\${transform.primaryInput.id}.'); |
28 } | 28 } |
29 } | 29 } |
30 """; | 30 """; |
31 | 31 |
32 main() { | 32 main() { |
33 initConfig(); | 33 initConfig(); |
34 withBarbackVersions("any", () { | 34 withBarbackVersions("any", () { |
35 integration('does not run if a transformer has an error', () { | 35 integration('does not run if a transformer has an error', () { |
36 d.dir(appPath, [ | 36 d.dir(appPath, [d.pubspec({ |
37 d.pubspec({ | |
38 "name": "myapp", | 37 "name": "myapp", |
39 "transformers": ["myapp/src/transformer"] | 38 "transformers": ["myapp/src/transformer"] |
40 }), | 39 }), |
41 d.dir("lib", [ | 40 d.dir("lib", [d.dir("src", [d.file("transformer.dart", TRANSFORMER)]
)]), |
42 d.dir("src", [ | 41 d.dir("bin", [d.file("script.dart", SCRIPT)])]).create(); |
43 d.file("transformer.dart", TRANSFORMER) | |
44 ]) | |
45 ]), | |
46 d.dir("bin", [ | |
47 d.file("script.dart", SCRIPT) | |
48 ]) | |
49 ]).create(); | |
50 | 42 |
51 createLockFile('myapp', pkg: ['barback']); | 43 createLockFile('myapp', pkg: ['barback']); |
52 | 44 |
53 var pub = pubRun(args: ["script"]); | 45 var pub = pubRun(args: ["script"]); |
54 | 46 |
55 pub.stderr.expect("[Error from Failing]:"); | 47 pub.stderr.expect("[Error from Failing]:"); |
56 pub.stderr.expect("myapp|bin/script.dart."); | 48 pub.stderr.expect("myapp|bin/script.dart."); |
57 | 49 |
58 // Note: no output from the script. | 50 // Note: no output from the script. |
59 pub.shouldExit(); | 51 pub.shouldExit(); |
60 }); | 52 }); |
61 }); | 53 }); |
62 } | 54 } |
OLD | NEW |