Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 // Safari does not allow us to run from a fresh profile, so we can only | 168 // Safari does not allow us to run from a fresh profile, so we can only |
| 169 // use one browser. Additionally, you can not start two simulators | 169 // use one browser. Additionally, you can not start two simulators |
| 170 // for mobile safari simultainiously. | 170 // for mobile safari simultainiously. |
| 171 maxBrowserProcesses = 1; | 171 maxBrowserProcesses = 1; |
| 172 } else if (conf['runtime'] == 'chrome' && | 172 } else if (conf['runtime'] == 'chrome' && |
| 173 Platform.operatingSystem == 'macos') { | 173 Platform.operatingSystem == 'macos') { |
| 174 // Chrome on mac results in random timeouts. | 174 // Chrome on mac results in random timeouts. |
| 175 maxBrowserProcesses = math.max(1, maxBrowserProcesses ~/ 2); | 175 maxBrowserProcesses = math.max(1, maxBrowserProcesses ~/ 2); |
| 176 } | 176 } |
| 177 | 177 |
| 178 for (String key in selectors.keys) { | 178 // If we specifically pass in a suite only run that. |
| 179 if (key == 'co19') { | 179 if (conf['suite_dir'] != null) { |
| 180 testSuites.add(new Co19TestSuite(conf)); | 180 var suite_path = new Path(conf['suite_dir']); |
| 181 } else if (conf['compiler'] == 'none' && | 181 |
| 182 conf['runtime'] == 'vm' && | 182 // Add a selector if we did not specify a specific one |
| 183 key == 'vm') { | 183 if (conf['default_selector'] != null) { |
| 184 // vm tests contain both cc tests (added here) and dart tests (added | 184 var regexp = new RegExp('.?'); |
| 185 // in [TEST_SUITE_DIRECTORIES]). | 185 conf['selectors'][suite_path.filename] = regexp; |
| 186 testSuites.add(new VMTestSuite(conf)); | 186 } |
| 187 } else if (conf['analyzer']) { | 187 testSuites.add( |
| 188 if (key == 'analyze_library') { | 188 new StandardTestSuite.forDirectory(conf, suite_path)); |
| 189 testSuites.add(new AnalyzeLibraryTestSuite(conf)); | 189 } else { |
| 190 for (String key in selectors.keys) { | |
|
ricow1
2014/09/01 13:00:48
this and below is just verbatim indented copy of t
| |
| 191 if (key == 'co19') { | |
| 192 testSuites.add(new Co19TestSuite(conf)); | |
| 193 } else if (conf['compiler'] == 'none' && | |
| 194 conf['runtime'] == 'vm' && | |
| 195 key == 'vm') { | |
| 196 // vm tests contain both cc tests (added here) and dart tests (added | |
| 197 // in [TEST_SUITE_DIRECTORIES]). | |
| 198 testSuites.add(new VMTestSuite(conf)); | |
| 199 } else if (conf['analyzer']) { | |
| 200 if (key == 'analyze_library') { | |
| 201 testSuites.add(new AnalyzeLibraryTestSuite(conf)); | |
| 202 } | |
| 203 } else if (conf['compiler'] == 'none' && | |
| 204 conf['runtime'] == 'vm' && | |
| 205 key == 'pkgbuild') { | |
| 206 if (!conf['use_repository_packages'] && | |
| 207 !conf['use_public_packages']) { | |
| 208 print("You need to use either --use-repository-packages or " | |
| 209 "--use-public-packages with the pkgbuild test suite!"); | |
| 210 exit(1); | |
| 211 } | |
| 212 if (!conf['use_sdk']) { | |
| 213 print("Running the 'pkgbuild' test suite requires " | |
| 214 "passing the '--use-sdk' to test.py"); | |
| 215 exit(1); | |
| 216 } | |
| 217 testSuites.add( | |
| 218 new PkgBuildTestSuite(conf, 'pkgbuild', 'pkg/pkgbuild.status')); | |
| 190 } | 219 } |
| 191 } else if (conf['compiler'] == 'none' && | 220 } |
| 192 conf['runtime'] == 'vm' && | 221 |
| 193 key == 'pkgbuild') { | 222 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 194 if (!conf['use_repository_packages'] && !conf['use_public_packages']) { | 223 final name = testSuiteDir.filename; |
| 195 print("You need to use either --use-repository-packages or " | 224 if (selectors.containsKey(name)) { |
| 196 "--use-public-packages with the pkgbuild test suite!"); | 225 testSuites.add( |
| 197 exit(1); | 226 new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 198 } | 227 } |
| 199 if (!conf['use_sdk']) { | |
| 200 print("Running the 'pkgbuild' test suite requires " | |
| 201 "passing the '--use-sdk' to test.py"); | |
| 202 exit(1); | |
| 203 } | |
| 204 testSuites.add( | |
| 205 new PkgBuildTestSuite(conf, 'pkgbuild', 'pkg/pkgbuild.status')); | |
| 206 } | |
| 207 } | |
| 208 | |
| 209 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | |
| 210 final name = testSuiteDir.filename; | |
| 211 if (selectors.containsKey(name)) { | |
| 212 testSuites.add( | |
| 213 new StandardTestSuite.forDirectory(conf, testSuiteDir)); | |
| 214 } | 228 } |
| 215 } | 229 } |
| 216 } | 230 } |
| 217 | 231 |
| 218 void allTestsFinished() { | 232 void allTestsFinished() { |
| 219 for (var conf in configurations) { | 233 for (var conf in configurations) { |
| 220 if (conf.containsKey('_servers_')) { | 234 if (conf.containsKey('_servers_')) { |
| 221 conf['_servers_'].stopServers(); | 235 conf['_servers_'].stopServers(); |
| 222 } | 236 } |
| 223 } | 237 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 TestUtils.setDartDirUri(Platform.script.resolve('..')); | 325 TestUtils.setDartDirUri(Platform.script.resolve('..')); |
| 312 deleteTemporaryDartDirectories().then((_) { | 326 deleteTemporaryDartDirectories().then((_) { |
| 313 var optionsParser = new TestOptionsParser(); | 327 var optionsParser = new TestOptionsParser(); |
| 314 var configurations = optionsParser.parse(arguments); | 328 var configurations = optionsParser.parse(arguments); |
| 315 if (configurations != null && configurations.length > 0) { | 329 if (configurations != null && configurations.length > 0) { |
| 316 testConfigurations(configurations); | 330 testConfigurations(configurations); |
| 317 } | 331 } |
| 318 }); | 332 }); |
| 319 } | 333 } |
| 320 | 334 |
| OLD | NEW |