| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 if (configurations == null || configurations.isEmpty()) return; | 53 if (configurations == null || configurations.isEmpty()) return; |
| 54 | 54 |
| 55 var firstConfiguration = configurations[0]; | 55 var firstConfiguration = configurations[0]; |
| 56 Map<String, RegExp> selectors = firstConfiguration['selectors']; | 56 Map<String, RegExp> selectors = firstConfiguration['selectors']; |
| 57 var maxProcesses = firstConfiguration['tasks']; | 57 var maxProcesses = firstConfiguration['tasks']; |
| 58 var verbose = firstConfiguration['verbose']; | 58 var verbose = firstConfiguration['verbose']; |
| 59 var listTests = firstConfiguration['list']; | 59 var listTests = firstConfiguration['list']; |
| 60 | 60 |
| 61 var configurationIterator = configurations.iterator(); | 61 var configurationIterator = configurations.iterator(); |
| 62 bool enqueueConfiguration(ProcessQueue queue) { | 62 void enqueueConfiguration(ProcessQueue queue) { |
| 63 if (!configurationIterator.hasNext()) { | 63 if (!configurationIterator.hasNext()) return; |
| 64 return false; | |
| 65 } | |
| 66 | |
| 67 var configuration = configurationIterator.next(); | 64 var configuration = configurationIterator.next(); |
| 68 for (String selector in selectors.getKeys()) { | 65 for (String selector in selectors.getKeys()) { |
| 69 if (selector == 'co19') { | 66 if (selector == 'co19') { |
| 70 queue.addTestSuite(new Co19TestSuite(configuration)); | 67 queue.addTestSuite(new Co19TestSuite(configuration)); |
| 71 } else { | 68 } else { |
| 72 throw 'Error: unexpected selector: "$selector".'; | 69 throw 'Error: unexpected selector: "$selector".'; |
| 73 } | 70 } |
| 74 } | 71 } |
| 75 return true; | |
| 76 } | 72 } |
| 77 | 73 |
| 78 // Start process queue. | 74 // Start process queue. |
| 79 var queue = new ProcessQueue(maxProcesses, | 75 var queue = new ProcessQueue(maxProcesses, |
| 80 'diff', | 76 'diff', |
| 81 startTime, | 77 startTime, |
| 82 false, | 78 false, |
| 83 enqueueConfiguration, | 79 enqueueConfiguration, |
| 84 () {}, | 80 () {}, |
| 85 verbose, | 81 verbose, |
| 86 listTests); | 82 listTests); |
| 87 } | 83 } |
| OLD | NEW |