| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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 library pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import 'package:pub/src/exit_codes.dart' as exit_codes; | 7 import 'package:pub/src/exit_codes.dart' as exit_codes; |
| 8 import 'package:scheduled_test/scheduled_test.dart'; | 8 import 'package:scheduled_test/scheduled_test.dart'; |
| 9 import 'package:scheduled_test/scheduled_stream.dart'; | 9 import 'package:scheduled_test/scheduled_stream.dart'; |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 transform.logger.error('ERROR!', span: sourceFile.span(11, 12)); | 58 transform.logger.error('ERROR!', span: sourceFile.span(11, 12)); |
| 59 return transform.primaryInput.readAsString().then((contents) { | 59 return transform.primaryInput.readAsString().then((contents) { |
| 60 var id = transform.primaryInput.id.changeExtension(".out"); | 60 var id = transform.primaryInput.id.changeExtension(".out"); |
| 61 transform.addOutput(new Asset.fromString(id, "\$contents.out")); | 61 transform.addOutput(new Asset.fromString(id, "\$contents.out")); |
| 62 }); | 62 }); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 """; | 65 """; |
| 66 | 66 |
| 67 main() { | 67 main() { |
| 68 initConfig(); | |
| 69 // This intentionally tests barback 0.14.2 with both transformers, since it | 68 // This intentionally tests barback 0.14.2 with both transformers, since it |
| 70 // supports both types of span. | 69 // supports both types of span. |
| 71 withBarbackVersions("<0.15.0", () => runTest(SOURCE_MAPS_TRANSFORMER)); | 70 withBarbackVersions("<0.15.0", () => runTest(SOURCE_MAPS_TRANSFORMER)); |
| 72 withBarbackVersions(">=0.14.2", () => runTest(SOURCE_SPAN_TRANSFORMER)); | 71 withBarbackVersions(">=0.14.2", () => runTest(SOURCE_SPAN_TRANSFORMER)); |
| 73 } | 72 } |
| 74 | 73 |
| 75 void runTest(String transformerText) { | 74 void runTest(String transformerText) { |
| 76 integration("can log messages", () { | 75 integration("can log messages", () { |
| 77 d.dir(appPath, [ | 76 d.dir(appPath, [ |
| 78 d.pubspec({ | 77 d.pubspec({ |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 114 |
| 116 // In barback >=0.15.0, the span will point to the location where the error | 115 // In barback >=0.15.0, the span will point to the location where the error |
| 117 // occurred. | 116 // occurred. |
| 118 pub.stderr.expect(allow(inOrder(["d", "^"]))); | 117 pub.stderr.expect(allow(inOrder(["d", "^"]))); |
| 119 | 118 |
| 120 pub.stderr.expect("Build failed."); | 119 pub.stderr.expect("Build failed."); |
| 121 | 120 |
| 122 pub.shouldExit(exit_codes.DATA); | 121 pub.shouldExit(exit_codes.DATA); |
| 123 }); | 122 }); |
| 124 } | 123 } |
| OLD | NEW |