| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 #library("test"); | 6 #library("test"); |
| 7 | 7 |
| 8 #import("testing/dart/test_runner.dart"); | 8 #import("testing/dart/test_runner.dart"); |
| 9 #import("testing/dart/test_options.dart"); | 9 #import("testing/dart/test_options.dart"); |
| 10 | 10 |
| 11 #import("../tests/co19/test_config.dart"); | 11 #import("../tests/co19/test_config.dart"); |
| 12 #import("../tests/corelib/test_config.dart"); | 12 #import("../tests/corelib/test_config.dart"); |
| 13 #import("../tests/isolate/test_config.dart"); | 13 #import("../tests/isolate/test_config.dart"); |
| 14 #import("../tests/language/test_config.dart"); | 14 #import("../tests/language/test_config.dart"); |
| 15 #import("../tests/standalone/test_config.dart"); | 15 #import("../tests/standalone/test_config.dart"); |
| 16 #import("../tests/stub-generator/test_config.dart"); | 16 #import("../tests/stub-generator/test_config.dart"); |
| 17 #import("../runtime/tests/vm/test_config.dart"); | 17 #import("../runtime/tests/vm/test_config.dart"); |
| 18 #import("../samples/tests/samples/test_config.dart"); | 18 #import("../samples/tests/samples/test_config.dart"); |
| 19 #import("../frog/tests/frog/test_config.dart"); | 19 #import("../frog/tests/frog/test_config.dart"); |
| 20 #import("../frog/tests/leg/test_config.dart"); | 20 #import("../frog/tests/leg/test_config.dart"); |
| 21 #import("../frog/tests/leg_only/test_config.dart"); | 21 #import("../frog/tests/leg_only/test_config.dart"); |
| 22 | 22 |
| 23 main() { | 23 main() { |
| 24 var startTime = new Date.now(); | 24 var startTime = new Date.now(); |
| 25 var optionsParser = new TestOptionsParser(); | 25 var optionsParser = new TestOptionsParser(); |
| 26 var configurations = optionsParser.parse(new Options().arguments); | 26 List<Map> configurations = optionsParser.parse(new Options().arguments); |
| 27 if (configurations == null) return; | 27 if (configurations == null) return; |
| 28 |
| 28 // Extract global options from first configuration. | 29 // Extract global options from first configuration. |
| 29 var firstConf = configurations[0]; | 30 var firstConf = configurations[0]; |
| 30 var queue = new ProcessQueue(firstConf['tasks'], | |
| 31 firstConf['progress'], | |
| 32 startTime); | |
| 33 Map<String, RegExp> selectors = firstConf['selectors']; | 31 Map<String, RegExp> selectors = firstConf['selectors']; |
| 34 for (var conf in configurations) { | 32 var maxProcesses = firstConf['tasks']; |
| 33 var progressIndicator = firstConf['progress']; |
| 34 |
| 35 var currentConfiguration = 0; |
| 36 bool enqueueConfiguration(ProcessQueue queue) { |
| 37 if (currentConfiguration == configurations.length) { |
| 38 return false; |
| 39 } |
| 40 |
| 41 var conf = configurations[currentConfiguration++]; |
| 35 if (selectors.containsKey('samples')) { | 42 if (selectors.containsKey('samples')) { |
| 36 queue.addTestSuite(new SamplesTestSuite(conf)); | 43 queue.addTestSuite(new SamplesTestSuite(conf)); |
| 37 } | 44 } |
| 38 if (selectors.containsKey('standalone')) { | 45 if (selectors.containsKey('standalone')) { |
| 39 queue.addTestSuite(new StandaloneTestSuite(conf)); | 46 queue.addTestSuite(new StandaloneTestSuite(conf)); |
| 40 } | 47 } |
| 41 if (selectors.containsKey('corelib')) { | 48 if (selectors.containsKey('corelib')) { |
| 42 queue.addTestSuite(new CorelibTestSuite(conf)); | 49 queue.addTestSuite(new CorelibTestSuite(conf)); |
| 43 } | 50 } |
| 44 if (selectors.containsKey('co19')) { | 51 if (selectors.containsKey('co19')) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 } | 65 } |
| 59 if (selectors.containsKey('frog')) { | 66 if (selectors.containsKey('frog')) { |
| 60 queue.addTestSuite(new FrogTestSuite(conf)); | 67 queue.addTestSuite(new FrogTestSuite(conf)); |
| 61 } | 68 } |
| 62 if (selectors.containsKey('leg')) { | 69 if (selectors.containsKey('leg')) { |
| 63 queue.addTestSuite(new LegTestSuite(conf)); | 70 queue.addTestSuite(new LegTestSuite(conf)); |
| 64 } | 71 } |
| 65 if (selectors.containsKey('leg_only')) { | 72 if (selectors.containsKey('leg_only')) { |
| 66 queue.addTestSuite(new LegOnlyTestSuite(conf)); | 73 queue.addTestSuite(new LegOnlyTestSuite(conf)); |
| 67 } | 74 } |
| 75 |
| 76 return true; |
| 68 } | 77 } |
| 78 |
| 79 // Start process queue. |
| 80 var queue = new ProcessQueue(maxProcesses, |
| 81 progressIndicator, |
| 82 startTime, |
| 83 enqueueConfiguration); |
| 69 } | 84 } |
| OLD | NEW |