@@ -29,6 +29,7 @@ const Map<String, ShardRunner> _kShards = const <String, ShardRunner>{
29
29
'docs' : _generateDocs,
30
30
'analyze' : _analyzeRepo,
31
31
'tests' : _runTests,
32
+ 'tests_dart2' : _runTestsDart2,
32
33
'coverage' : _runCoverage,
33
34
};
34
35
@@ -129,35 +130,50 @@ Future<Null> _analyzeRepo() async {
129
130
print ('${bold }DONE: Analysis successful.$reset ' );
130
131
}
131
132
132
- Future <Null > _runTests () async {
133
+ Future <Null > _runTestsDart2 () async {
134
+ if (Platform .isWindows) {
135
+ // AppVeyor platform is overloaded, won't be able to handle additional
136
+ // load of dart2 testing.
137
+ return ;
138
+ }
139
+ _runTests (options: < String > ['--preview-dart-2' ]);
140
+ }
141
+
142
+ Future <Null > _runTests ({List <String > options: const < String > []}) async {
133
143
// Verify that the tests actually return failure on failure and success on success.
134
144
final String automatedTests = path.join (flutterRoot, 'dev' , 'automated_tests' );
135
145
await _runFlutterTest (automatedTests,
136
146
script: path.join ('test_smoke_test' , 'fail_test.dart' ),
147
+ options: options,
137
148
expectFailure: true ,
138
149
printOutput: false ,
139
150
);
140
151
await _runFlutterTest (automatedTests,
141
152
script: path.join ('test_smoke_test' , 'pass_test.dart' ),
153
+ options: options,
142
154
printOutput: false ,
143
155
);
144
156
await _runFlutterTest (automatedTests,
145
157
script: path.join ('test_smoke_test' , 'crash1_test.dart' ),
158
+ options: options,
146
159
expectFailure: true ,
147
160
printOutput: false ,
148
161
);
149
162
await _runFlutterTest (automatedTests,
150
163
script: path.join ('test_smoke_test' , 'crash2_test.dart' ),
164
+ options: options,
151
165
expectFailure: true ,
152
166
printOutput: false ,
153
167
);
154
168
await _runFlutterTest (automatedTests,
155
169
script: path.join ('test_smoke_test' , 'syntax_error_test.broken_dart' ),
170
+ options: options,
156
171
expectFailure: true ,
157
172
printOutput: false ,
158
173
);
159
174
await _runFlutterTest (automatedTests,
160
175
script: path.join ('test_smoke_test' , 'missing_import_test.broken_dart' ),
176
+ options: options,
161
177
expectFailure: true ,
162
178
printOutput: false ,
163
179
);
@@ -171,21 +187,21 @@ Future<Null> _runTests() async {
171
187
await _verifyVersion (path.join (flutterRoot, 'version' ));
172
188
173
189
// Run tests.
174
- await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter' ));
175
- await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter_localizations' ));
176
- await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter_driver' ));
177
- await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter_test' ));
190
+ await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter' ), options : options );
191
+ await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter_localizations' ), options : options );
192
+ await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter_driver' ), options : options );
193
+ await _runFlutterTest (path.join (flutterRoot, 'packages' , 'flutter_test' ), options : options );
178
194
await _pubRunTest (path.join (flutterRoot, 'packages' , 'flutter_tools' ));
179
195
await _pubRunTest (path.join (flutterRoot, 'dev' , 'bots' ));
180
196
181
- await _runAllDartTests (path.join (flutterRoot, 'dev' , 'devicelab' ));
182
- await _runFlutterTest (path.join (flutterRoot, 'dev' , 'manual_tests' ));
183
- await _runFlutterTest (path.join (flutterRoot, 'dev' , 'tools' , 'vitool' ));
184
- await _runFlutterTest (path.join (flutterRoot, 'examples' , 'hello_world' ));
185
- await _runFlutterTest (path.join (flutterRoot, 'examples' , 'layers' ));
186
- await _runFlutterTest (path.join (flutterRoot, 'examples' , 'stocks' ));
187
- await _runFlutterTest (path.join (flutterRoot, 'examples' , 'flutter_gallery' ));
188
- await _runFlutterTest (path.join (flutterRoot, 'examples' , 'catalog' ));
197
+ await _runAllDartTests (path.join (flutterRoot, 'dev' , 'devicelab' ), options : options );
198
+ await _runFlutterTest (path.join (flutterRoot, 'dev' , 'manual_tests' ), options : options );
199
+ await _runFlutterTest (path.join (flutterRoot, 'dev' , 'tools' , 'vitool' ), options : options );
200
+ await _runFlutterTest (path.join (flutterRoot, 'examples' , 'hello_world' ), options : options );
201
+ await _runFlutterTest (path.join (flutterRoot, 'examples' , 'layers' ), options : options );
202
+ await _runFlutterTest (path.join (flutterRoot, 'examples' , 'stocks' ), options : options );
203
+ await _runFlutterTest (path.join (flutterRoot, 'examples' , 'flutter_gallery' ), options : options );
204
+ await _runFlutterTest (path.join (flutterRoot, 'examples' , 'catalog' ), options : options );
189
205
190
206
print ('${bold }DONE: All tests successful.$reset ' );
191
207
}
@@ -356,8 +372,13 @@ Future<Null> _runFlutterTest(String workingDirectory, {
356
372
357
373
Future <Null > _runAllDartTests (String workingDirectory, {
358
374
Map <String , String > environment,
375
+ List <String > options,
359
376
}) {
360
- final List <String > args = < String > ['--checked' , path.join ('test' , 'all.dart' )];
377
+ final List <String > args = < String > ['--checked' ];
378
+ if (options != null ) {
379
+ args.addAll (options);
380
+ }
381
+ args.add (path.join ('test' , 'all.dart' ));
361
382
return _runCommand (dart, args,
362
383
workingDirectory: workingDirectory,
363
384
environment: environment,
0 commit comments