| OLD | NEW |
| 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 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 var maxProcesses = firstConf['tasks']; | 55 var maxProcesses = firstConf['tasks']; |
| 56 var progressIndicator = firstConf['progress']; | 56 var progressIndicator = firstConf['progress']; |
| 57 // TODO(kustermann): Remove this option once the buildbots don't use it | 57 // TODO(kustermann): Remove this option once the buildbots don't use it |
| 58 // anymore. | 58 // anymore. |
| 59 var failureSummary = firstConf['failure-summary']; | 59 var failureSummary = firstConf['failure-summary']; |
| 60 BuildbotProgressIndicator.stepName = firstConf['step_name']; | 60 BuildbotProgressIndicator.stepName = firstConf['step_name']; |
| 61 var verbose = firstConf['verbose']; | 61 var verbose = firstConf['verbose']; |
| 62 var printTiming = firstConf['time']; | 62 var printTiming = firstConf['time']; |
| 63 var listTests = firstConf['list']; | 63 var listTests = firstConf['list']; |
| 64 | 64 |
| 65 var jsonOnly = firstConf['jsonOnly']; |
| 66 |
| 65 var recordingPath = firstConf['record_to_file']; | 67 var recordingPath = firstConf['record_to_file']; |
| 66 var recordingOutputPath = firstConf['replay_from_file']; | 68 var recordingOutputPath = firstConf['replay_from_file']; |
| 67 | 69 |
| 68 Browser.deleteCache = firstConf['clear_browser_cache']; | 70 Browser.deleteCache = firstConf['clear_browser_cache']; |
| 69 | 71 |
| 70 if (recordingPath != null && recordingOutputPath != null) { | 72 if (recordingPath != null && recordingOutputPath != null) { |
| 71 print("Fatal: Can't have the '--record_to_file' and '--replay_from_file'" | 73 print("Fatal: Can't have the '--record_to_file' and '--replay_from_file'" |
| 72 "at the same time. Exiting ..."); | 74 "at the same time. Exiting ..."); |
| 73 exit(1); | 75 exit(1); |
| 74 } | 76 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 if (firstConf['write_test_outcome_log']) { | 261 if (firstConf['write_test_outcome_log']) { |
| 260 eventListener.add(new TestOutcomeLogWriter()); | 262 eventListener.add(new TestOutcomeLogWriter()); |
| 261 } | 263 } |
| 262 if (firstConf['copy_coredumps']) { | 264 if (firstConf['copy_coredumps']) { |
| 263 eventListener.add(new UnexpectedCrashDumpArchiver()); | 265 eventListener.add(new UnexpectedCrashDumpArchiver()); |
| 264 } | 266 } |
| 265 | 267 |
| 266 // The only progress indicator when listing tests should be the | 268 // The only progress indicator when listing tests should be the |
| 267 // the summary printer. | 269 // the summary printer. |
| 268 if (listTests) { | 270 if (listTests) { |
| 269 eventListener.add(new SummaryPrinter()); | 271 eventListener.add(new SummaryPrinter(jsonOnly: jsonOnly)); |
| 270 } else { | 272 } else { |
| 271 eventListener.add(new ExitCodeSetter()); | 273 eventListener.add(new ExitCodeSetter()); |
| 272 } | 274 } |
| 273 | 275 |
| 274 void startProcessQueue() { | 276 void startProcessQueue() { |
| 275 // [firstConf] is needed here, since the ProcessQueue needs to know the | 277 // [firstConf] is needed here, since the ProcessQueue needs to know the |
| 276 // settings of 'noBatch' and 'local_ip' | 278 // settings of 'noBatch' and 'local_ip' |
| 277 new ProcessQueue(firstConf, | 279 new ProcessQueue(firstConf, |
| 278 maxProcesses, | 280 maxProcesses, |
| 279 maxBrowserProcesses, | 281 maxBrowserProcesses, |
| 280 startTime, | 282 startTime, |
| 281 testSuites, | 283 testSuites, |
| 282 eventListener, | 284 eventListener, |
| 283 allTestsFinished, | 285 allTestsFinished, |
| 284 verbose, | 286 verbose, |
| 285 recordingPath, | 287 recordingPath, |
| 286 recordingOutputPath); | 288 recordingOutputPath); |
| 287 } | 289 } |
| 288 | 290 |
| 289 // Start all the HTTP servers required before starting the process queue. | 291 // Start all the HTTP servers required before starting the process queue. |
| 290 if (serverFutures.isEmpty) { | 292 if (serverFutures.isEmpty) { |
| 291 startProcessQueue(); | 293 startProcessQueue(); |
| 292 } else { | 294 } else { |
| 293 Future.wait(serverFutures).then((_) => startProcessQueue()); | 295 Future.wait(serverFutures).then((_) => startProcessQueue()); |
| 294 } | 296 } |
| 295 } | 297 } |
| OLD | NEW |