Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Side by Side Diff: tools/testing/dart/test_configurations.dart

Issue 1922163002: Initial support to test.dart for running precompiler tests on android devices (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Some fixes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library test_configurations; 5 library test_configurations;
6 6
7 import "dart:async"; 7 import "dart:async";
8 import 'dart:io'; 8 import 'dart:io';
9 import "dart:math" as math; 9 import "dart:math" as math;
10 10
11 import 'android.dart';
11 import "browser_controller.dart"; 12 import "browser_controller.dart";
12 import "co19_test_config.dart"; 13 import "co19_test_config.dart";
13 import "http_server.dart"; 14 import "http_server.dart";
14 import "path.dart"; 15 import "path.dart";
15 import "test_progress.dart"; 16 import "test_progress.dart";
16 import "test_runner.dart"; 17 import "test_runner.dart";
17 import "test_suite.dart"; 18 import "test_suite.dart";
18 import "utils.dart"; 19 import "utils.dart";
19 import "vm_test_config.dart"; 20 import "vm_test_config.dart";
20 21
(...skipping 21 matching lines...) Expand all
42 new Path('tests/isolate'), 43 new Path('tests/isolate'),
43 new Path('tests/language'), 44 new Path('tests/language'),
44 new Path('tests/lib'), 45 new Path('tests/lib'),
45 new Path('tests/standalone'), 46 new Path('tests/standalone'),
46 new Path('tests/try'), 47 new Path('tests/try'),
47 new Path('tests/utils'), 48 new Path('tests/utils'),
48 new Path('utils/tests/css'), 49 new Path('utils/tests/css'),
49 new Path('utils/tests/peg'), 50 new Path('utils/tests/peg'),
50 ]; 51 ];
51 52
52 void testConfigurations(List<Map> configurations) { 53 Future testConfigurations(List<Map> configurations) async {
53 var startTime = new DateTime.now(); 54 var startTime = new DateTime.now();
54 // Extract global options from first configuration. 55 // Extract global options from first configuration.
55 var firstConf = configurations[0]; 56 var firstConf = configurations[0];
56 var maxProcesses = firstConf['tasks']; 57 var maxProcesses = firstConf['tasks'];
57 var progressIndicator = firstConf['progress']; 58 var progressIndicator = firstConf['progress'];
58 // TODO(kustermann): Remove this option once the buildbots don't use it 59 // TODO(kustermann): Remove this option once the buildbots don't use it
59 // anymore. 60 // anymore.
60 var failureSummary = firstConf['failure-summary']; 61 var failureSummary = firstConf['failure-summary'];
61 BuildbotProgressIndicator.stepName = firstConf['step_name']; 62 BuildbotProgressIndicator.stepName = firstConf['step_name'];
62 var verbose = firstConf['verbose']; 63 var verbose = firstConf['verbose'];
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 275 }
275 276
276 // The only progress indicator when listing tests should be the 277 // The only progress indicator when listing tests should be the
277 // the summary printer. 278 // the summary printer.
278 if (listTests) { 279 if (listTests) {
279 eventListener.add(new SummaryPrinter(jsonOnly: reportInJson)); 280 eventListener.add(new SummaryPrinter(jsonOnly: reportInJson));
280 } else { 281 } else {
281 eventListener.add(new ExitCodeSetter()); 282 eventListener.add(new ExitCodeSetter());
282 } 283 }
283 284
284 void startProcessQueue() { 285 Future startProcessQueue() async {
286 AdbDevicePool pool;
287
288 bool needsAdbDevicePool = configurations.any((Map conf) {
289 return conf['runtime'] == 'dart_precompiled' &&
290 conf['system'] == 'android';
291 });
292 if (needsAdbDevicePool) {
293 pool = await AdbDevicePool.create();
294 }
Bill Hesse 2016/04/27 12:22:32 We have code for awaiting the AdbDevices in browse
kustermann 2016/04/27 13:25:09 I'd really prefer not to modify any unrelated code
295
285 // [firstConf] is needed here, since the ProcessQueue needs to know the 296 // [firstConf] is needed here, since the ProcessQueue needs to know the
286 // settings of 'noBatch' and 'local_ip' 297 // settings of 'noBatch' and 'local_ip'
287 new ProcessQueue( 298 new ProcessQueue(
288 firstConf, 299 firstConf,
289 maxProcesses, 300 maxProcesses,
290 maxBrowserProcesses, 301 maxBrowserProcesses,
291 startTime, 302 startTime,
292 testSuites, 303 testSuites,
293 eventListener, 304 eventListener,
294 allTestsFinished, 305 allTestsFinished,
295 verbose, 306 verbose,
296 recordingPath, 307 recordingPath,
297 recordingOutputPath); 308 recordingOutputPath,
309 pool);
298 } 310 }
299 311
300 // Start all the HTTP servers required before starting the process queue. 312 // Start all the HTTP servers required before starting the process queue.
301 if (serverFutures.isEmpty) { 313 if (serverFutures.isEmpty) {
302 startProcessQueue(); 314 await startProcessQueue();
303 } else { 315 } else {
304 Future.wait(serverFutures).then((_) => startProcessQueue()); 316 await Future.wait(serverFutures).then((_) => startProcessQueue());
Bill Hesse 2016/04/27 12:22:32 This should just be: if (serverFutures.isNotEmpty
305 } 317 }
306 } 318 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698