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 // Dart2js can take a long time to compile dart code, so we increase the timeout | 5 // Dart2js can take a long time to compile dart code, so we increase the timeout |
6 // to cope with that. | 6 // to cope with that. |
7 @Timeout.factor(3) | 7 @Timeout.factor(3) |
8 | 8 |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 | 10 |
11 import '../descriptor.dart' as d; | 11 import '../descriptor.dart' as d; |
12 import '../test_pub.dart'; | 12 import '../test_pub.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 integration("outputs results to JSON in a successful build", () { | 15 integration("outputs results to JSON in a successful build", () { |
16 d.dir(appPath, [ | 16 d.dir(appPath, [ |
17 d.appPubspec(), | 17 d.appPubspec(), |
18 d.dir('web', [ | 18 d.dir('web', [ |
19 d.file('main.dart', 'void main() => print("hello");') | 19 d.file('main.dart', 'void main() => print("hello");') |
20 ]) | 20 ]) |
21 ]).create(); | 21 ]).create(); |
22 | 22 |
23 schedulePub(args: ["build", "--format", "json"], | 23 pubGet(); |
24 outputJson: { | 24 schedulePub(args: ["build", "--format", "json"], outputJson: { |
25 'buildResult': 'success', | 25 'buildResult': 'success', |
26 'outputDirectory': 'build', | 26 'outputDirectory': 'build', |
27 'numFiles': 1, | 27 'numFiles': 1, |
28 'log': [ | 28 'log': [ |
29 { | 29 { |
30 'level': 'Info', | 30 'level': 'Info', |
31 'transformer': { | 31 'transformer': { |
32 'name': 'Dart2JS', | 32 'name': 'Dart2JS', |
33 'primaryInput': {'package': 'myapp', 'path': 'web/main.dart'} | 33 'primaryInput': {'package': 'myapp', 'path': 'web/main.dart'} |
34 }, | 34 }, |
35 'assetId': {'package': 'myapp', 'path': 'web/main.dart'}, | 35 'assetId': {'package': 'myapp', 'path': 'web/main.dart'}, |
36 'message': 'Compiling myapp|web/main.dart...' | 36 'message': 'Compiling myapp|web/main.dart...' |
37 }, | 37 }, |
38 { | 38 { |
39 'level': 'Info', | 39 'level': 'Info', |
40 'transformer': { | 40 'transformer': { |
41 'name': 'Dart2JS', | 41 'name': 'Dart2JS', |
42 'primaryInput': {'package': 'myapp', 'path': 'web/main.dart'} | 42 'primaryInput': {'package': 'myapp', 'path': 'web/main.dart'} |
43 }, | 43 }, |
44 'assetId': {'package': 'myapp', 'path': 'web/main.dart'}, | 44 'assetId': {'package': 'myapp', 'path': 'web/main.dart'}, |
45 'message': contains(r'to compile myapp|web/main.dart.') | 45 'message': contains(r'to compile myapp|web/main.dart.') |
46 }, | 46 }, |
47 { | 47 { |
48 'level': 'Fine', | 48 'level': 'Fine', |
49 'transformer': { | 49 'transformer': { |
50 'name': 'Dart2JS', | 50 'name': 'Dart2JS', |
51 'primaryInput': {'package': 'myapp', 'path': 'web/main.dart'} | 51 'primaryInput': {'package': 'myapp', 'path': 'web/main.dart'} |
52 }, | 52 }, |
53 'assetId': {'package': 'myapp', 'path': 'web/main.dart'}, | 53 'assetId': {'package': 'myapp', 'path': 'web/main.dart'}, |
54 'message': contains(r'Took') | 54 'message': contains(r'Took') |
55 } | 55 } |
56 ] | 56 ] |
57 }); | 57 }); |
58 }); | 58 }); |
59 } | 59 } |
OLD | NEW |