| 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 /** | 5 /** |
| 6 * Tool for running co19 tests. Used when updating co19. | 6 * Tool for running co19 tests. Used when updating co19. |
| 7 * | 7 * |
| 8 * Currently, this tool is merely a convenience around multiple | 8 * Currently, this tool is merely a convenience around multiple |
| 9 * invocations of test.dart. Long term, we hope to evolve this into a | 9 * invocations of test.dart. Long term, we hope to evolve this into a |
| 10 * script that can automate most of the tasks necessary when updating | 10 * script that can automate most of the tasks necessary when updating |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 configurations.addAll(optionsParser.parse(arguments)); | 53 configurations.addAll(optionsParser.parse(arguments)); |
| 54 } | 54 } |
| 55 if (configurations == null || configurations.isEmpty) return; | 55 if (configurations == null || configurations.isEmpty) return; |
| 56 | 56 |
| 57 var firstConfiguration = configurations[0]; | 57 var firstConfiguration = configurations[0]; |
| 58 Map<String, RegExp> selectors = firstConfiguration['selectors']; | 58 Map<String, RegExp> selectors = firstConfiguration['selectors']; |
| 59 var maxProcesses = firstConfiguration['tasks']; | 59 var maxProcesses = firstConfiguration['tasks']; |
| 60 var verbose = firstConfiguration['verbose']; | 60 var verbose = firstConfiguration['verbose']; |
| 61 var listTests = firstConfiguration['list']; | 61 var listTests = firstConfiguration['list']; |
| 62 | 62 |
| 63 var configurationIterator = configurations.iterator(); | 63 var configurationIterator = configurations.iterator; |
| 64 void enqueueConfiguration(ProcessQueue queue) { | 64 void enqueueConfiguration(ProcessQueue queue) { |
| 65 if (!configurationIterator.hasNext) return; | 65 if (!configurationIterator.moveNext()) return; |
| 66 var configuration = configurationIterator.next(); | 66 var configuration = configurationIterator.current; |
| 67 for (String selector in selectors.keys) { | 67 for (String selector in selectors.keys) { |
| 68 if (selector == 'co19') { | 68 if (selector == 'co19') { |
| 69 queue.addTestSuite(new Co19TestSuite(configuration)); | 69 queue.addTestSuite(new Co19TestSuite(configuration)); |
| 70 } else { | 70 } else { |
| 71 throw 'Error: unexpected selector: "$selector".'; | 71 throw 'Error: unexpected selector: "$selector".'; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Start process queue. | 76 // Start process queue. |
| 77 var queue = new ProcessQueue(maxProcesses, | 77 var queue = new ProcessQueue(maxProcesses, |
| 78 'diff', | 78 'diff', |
| 79 startTime, | 79 startTime, |
| 80 false, | 80 false, |
| 81 enqueueConfiguration, | 81 enqueueConfiguration, |
| 82 () {}, | 82 () {}, |
| 83 verbose, | 83 verbose, |
| 84 listTests); | 84 listTests); |
| 85 } | 85 } |
| OLD | NEW |