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(appPath, [ | |
21 d.appPubspec(), | |
22 d.dir('web', [ | |
23 d.file('file.txt', 'contents'), | |
24 d.file('file.dart', 'void void;'), | |
25 d.dir('subdir', [ | |
26 d.file('subfile.dart', 'void void;') | |
27 ]) | |
28 ]) | |
29 ]).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(inOrder([ | |
36 "[Error from Dart2JS]:", | |
37 startsWith(p.join("web", "file.dart") + ":") | |
38 ])); | |
39 var consumeSubfile = consumeThrough(inOrder([ | |
40 "[Error from Dart2JS]:", | |
41 startsWith(p.join("web", "subdir", "subfile.dart") + ":") | |
42 ])); | |
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(either( | |
47 inOrder([consumeFile, consumeSubfile]), | |
48 inOrder([consumeSubfile, consumeFile]))); | |
49 | |
50 pub.shouldExit(exit_codes.DATA); | |
51 | |
52 // Doesn't output anything if an error occurred. | |
53 d.dir(appPath, [ | |
54 d.dir('build', [ | |
55 d.nothing('web') | |
56 ]) | |
57 ]).validate(); | |
58 }); | |
59 } | |
OLD | NEW |