| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 import 'package:path/path.dart' as p; | |
| 6 import 'package:scheduled_test/scheduled_test.dart'; | |
| 7 import 'package:scheduled_test/scheduled_stream.dart'; | |
| 8 | |
| 9 import '../../lib/src/exit_codes.dart' as exit_codes; | |
| 10 import '../descriptor.dart' as d; | |
| 11 import '../test_pub.dart'; | |
| 12 | |
| 13 main() { | |
| 14 initConfig(); | |
| 15 integration("reports Dart parse errors", () { | |
| 16 // Dart2js can take a long time to compile dart code, so we increase the | |
| 17 // timeout to cope with that. | |
| 18 currentSchedule.timeout *= 3; | |
| 19 | |
| 20 d.dir( | |
| 21 appPath, | |
| 22 [ | |
| 23 d.appPubspec(), | |
| 24 d.dir( | |
| 25 'web', | |
| 26 [ | |
| 27 d.file('file.txt', 'contents'), | |
| 28 d.file('file.dart', 'void void;'), | |
| 29 d.dir('subdir', [d.file('subfile.dart', 'void void;')])])]).
create(); | |
| 30 | |
| 31 var pub = startPub(args: ["build"]); | |
| 32 pub.stdout.expect(startsWith("Loading source assets...")); | |
| 33 pub.stdout.expect(startsWith("Building myapp...")); | |
| 34 | |
| 35 var consumeFile = consumeThrough( | |
| 36 inOrder( | |
| 37 ["[Error from Dart2JS]:", startsWith(p.join("web", "file.dart") + ":
")])); | |
| 38 var consumeSubfile = consumeThrough( | |
| 39 inOrder( | |
| 40 [ | |
| 41 "[Error from Dart2JS]:", | |
| 42 startsWith(p.join("web", "subdir", "subfile.dart") + ":")])); | |
| 43 | |
| 44 // It's nondeterministic what order the dart2js transformers start running, | |
| 45 // so we allow the error messages to be emitted in either order. | |
| 46 pub.stderr.expect( | |
| 47 either( | |
| 48 inOrder([consumeFile, consumeSubfile]), | |
| 49 inOrder([consumeSubfile, consumeFile]))); | |
| 50 | |
| 51 pub.shouldExit(exit_codes.DATA); | |
| 52 | |
| 53 // Doesn't output anything if an error occurred. | |
| 54 d.dir(appPath, [d.dir('build', [d.nothing('web')])]).validate(); | |
| 55 }); | |
| 56 } | |
| OLD | NEW |