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

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: Cleanup of CL and of existing code. 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 // If any of the configurations need to access android devices we'll first
285 // [firstConf] is needed here, since the ProcessQueue needs to know the 286 // make a pool of all available adb devices.
286 // settings of 'noBatch' and 'local_ip' 287 AdbDevicePool adbDevicePool;
287 new ProcessQueue( 288 bool needsAdbDevicePool = configurations.any((Map conf) {
288 firstConf, 289 return conf['runtime'] == 'dart_precompiled' &&
289 maxProcesses, 290 conf['system'] == 'android';
290 maxBrowserProcesses, 291 });
291 startTime, 292 if (needsAdbDevicePool) {
292 testSuites, 293 adbDevicePool = await AdbDevicePool.create();
293 eventListener,
294 allTestsFinished,
295 verbose,
296 recordingPath,
297 recordingOutputPath);
298 } 294 }
299 295
300 // Start all the HTTP servers required before starting the process queue. 296 // Start all the HTTP servers required before starting the process queue.
301 if (serverFutures.isEmpty) { 297 if (!serverFutures.isEmpty) {
302 startProcessQueue(); 298 await Future.wait(serverFutures);
303 } else {
304 Future.wait(serverFutures).then((_) => startProcessQueue());
305 } 299 }
300
301 // [firstConf] is needed here, since the ProcessQueue needs to know the
302 // settings of 'noBatch' and 'local_ip'
303 new ProcessQueue(
304 firstConf,
305 maxProcesses,
306 maxBrowserProcesses,
307 startTime,
308 testSuites,
309 eventListener,
310 allTestsFinished,
311 verbose,
312 recordingPath,
313 recordingOutputPath,
314 adbDevicePool);
306 } 315 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698