| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, 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 /** | 6 /** |
| 7 * This file is the entrypoint of the dart test suite. This suite is used | 7 * This file is the entrypoint of the dart test suite. This suite is used |
| 8 * to test: | 8 * to test: |
| 9 * | 9 * |
| 10 * 1. the dart vm | 10 * 1. the dart vm |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 return TestUtils.isBrowserRuntime(config['runtime']); | 113 return TestUtils.isBrowserRuntime(config['runtime']); |
| 114 }); | 114 }); |
| 115 if (runningBrowserTests) { | 115 if (runningBrowserTests) { |
| 116 TestingServerRunner.startHttpServer('127.0.0.1'); | 116 TestingServerRunner.startHttpServer('127.0.0.1'); |
| 117 // We start two servers so that we can test cross-domain tests. | 117 // We start two servers so that we can test cross-domain tests. |
| 118 TestingServerRunner.startHttpServer('127.0.0.1', | 118 TestingServerRunner.startHttpServer('127.0.0.1', |
| 119 allowedPort: TestingServerRunner.serverList[0].port); | 119 allowedPort: TestingServerRunner.serverList[0].port); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 var configurationIterator = configurations.iterator; | 123 var testSuites = new List<TestSuite>(); |
| 124 void enqueueConfiguration(ProcessQueue queue) { | 124 for (var conf in configurations) { |
| 125 if (!configurationIterator.moveNext()) return; | |
| 126 | |
| 127 var conf = configurationIterator.current; | |
| 128 TestingServerRunner.setPackageRootDir(conf); | 125 TestingServerRunner.setPackageRootDir(conf); |
| 129 | |
| 130 for (String key in selectors.keys) { | 126 for (String key in selectors.keys) { |
| 131 if (key == 'co19') { | 127 if (key == 'co19') { |
| 132 queue.addTestSuite(new Co19TestSuite(conf)); | 128 testSuites.add(new Co19TestSuite(conf)); |
| 133 } else if (conf['runtime'] == 'vm' && key == 'vm') { | 129 } else if (conf['runtime'] == 'vm' && key == 'vm') { |
| 134 // vm tests contain both cc tests (added here) and dart tests (added in | 130 // vm tests contain both cc tests (added here) and dart tests (added in |
| 135 // [TEST_SUITE_DIRECTORIES]). | 131 // [TEST_SUITE_DIRECTORIES]). |
| 136 queue.addTestSuite(new VMTestSuite(conf)); | 132 testSuites.add(new VMTestSuite(conf)); |
| 137 } else if (conf['compiler'] == 'dartc' && key == 'dartc') { | 133 } else if (conf['compiler'] == 'dartc' && key == 'dartc') { |
| 138 queue.addTestSuite(new SamplesDartcTestSuite(conf)); | 134 testSuites.add(new SamplesDartcTestSuite(conf)); |
| 139 queue.addTestSuite(new JUnitDartcTestSuite(conf)); | 135 testSuites.add(new JUnitDartcTestSuite(conf)); |
| 140 } | 136 } |
| 141 } | 137 } |
| 142 | 138 |
| 143 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 139 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 144 final name = testSuiteDir.filename; | 140 final name = testSuiteDir.filename; |
| 145 if (selectors.containsKey(name)) { | 141 if (selectors.containsKey(name)) { |
| 146 queue.addTestSuite( | 142 testSuites.add( |
| 147 new StandardTestSuite.forDirectory(conf, testSuiteDir, | 143 new StandardTestSuite.forDirectory(conf, testSuiteDir, |
| 148 serverList: TestingServerRunner.serverList)); | 144 serverList: TestingServerRunner.serverList)); |
| 149 } | 145 } |
| 150 } | 146 } |
| 151 } | 147 } |
| 152 | 148 |
| 153 // Start process queue. | 149 // Start process queue. |
| 154 new ProcessQueue(maxProcesses, | 150 new ProcessQueue(maxProcesses, |
| 155 progressIndicator, | 151 progressIndicator, |
| 156 startTime, | 152 startTime, |
| 157 printTiming, | 153 printTiming, |
| 158 enqueueConfiguration, | 154 testSuites, |
| 159 () => TestingServerRunner.terminateHttpServers(), | 155 () => TestingServerRunner.terminateHttpServers(), |
| 160 verbose, | 156 verbose, |
| 161 listTests); | 157 listTests); |
| 162 } | 158 } |
| OLD | NEW |