| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 print(output_words.join(' ')); | 125 print(output_words.join(' ')); |
| 126 } | 126 } |
| 127 | 127 |
| 128 var runningBrowserTests = configurations.any((config) { | 128 var runningBrowserTests = configurations.any((config) { |
| 129 return TestUtils.isBrowserRuntime(config['runtime']); | 129 return TestUtils.isBrowserRuntime(config['runtime']); |
| 130 }); | 130 }); |
| 131 | 131 |
| 132 List<Future> serverFutures = []; | 132 List<Future> serverFutures = []; |
| 133 var testSuites = new List<TestSuite>(); | 133 var testSuites = new List<TestSuite>(); |
| 134 var maxBrowserProcesses = maxProcesses; | 134 var maxBrowserProcesses = maxProcesses; |
| 135 // If the server ports are fixed, then we can only have one configuration. |
| 136 assert(((configurations[0]['test_server_port'] == 0) && |
| 137 (configurations[0]['test_server_cross_origin_port'] == 0)) || |
| 138 (configurations.length == 1)); |
| 135 for (var conf in configurations) { | 139 for (var conf in configurations) { |
| 136 Map<String, RegExp> selectors = conf['selectors']; | 140 Map<String, RegExp> selectors = conf['selectors']; |
| 137 var useContentSecurityPolicy = conf['csp']; | 141 var useContentSecurityPolicy = conf['csp']; |
| 138 if (!listTests && runningBrowserTests) { | 142 if (!listTests && runningBrowserTests) { |
| 139 // Start global http servers that serve the entire dart repo. | 143 // Start global http servers that serve the entire dart repo. |
| 140 // The http server is available on window.location.port, and a second | 144 // The http server is available on window.location.port, and a second |
| 141 // server for cross-domain tests can be found by calling | 145 // server for cross-domain tests can be found by calling |
| 142 // getCrossOriginPortNumber(). | 146 // getCrossOriginPortNumber(). |
| 143 var servers = new TestingServers(new Path(TestUtils.buildDir(conf)), | 147 var servers = new TestingServers(new Path(TestUtils.buildDir(conf)), |
| 144 useContentSecurityPolicy, | 148 useContentSecurityPolicy, |
| 145 conf['runtime']); | 149 conf['runtime']); |
| 146 serverFutures.add(servers.startServers(conf['local_ip'])); | 150 serverFutures.add(servers.startServers(conf['local_ip'], |
| 151 port: conf['test_server_port'], |
| 152 crossOriginPort: conf['test_server_cross_origin_port'])); |
| 147 conf['_servers_'] = servers; | 153 conf['_servers_'] = servers; |
| 148 if (verbose) { | 154 if (verbose) { |
| 149 serverFutures.last.then((_) { | 155 serverFutures.last.then((_) { |
| 150 var commandline = servers.httpServerCommandline(); | 156 var commandline = servers.httpServerCommandline(); |
| 151 print('Started HttpServers: $commandline'); | 157 print('Started HttpServers: $commandline'); |
| 152 }); | 158 }); |
| 153 } | 159 } |
| 154 } | 160 } |
| 155 | 161 |
| 156 if (conf['runtime'].startsWith('ie')) { | 162 if (conf['runtime'].startsWith('ie')) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 void main() { | 287 void main() { |
| 282 deleteTemporaryDartDirectories().then((_) { | 288 deleteTemporaryDartDirectories().then((_) { |
| 283 var optionsParser = new TestOptionsParser(); | 289 var optionsParser = new TestOptionsParser(); |
| 284 var configurations = optionsParser.parse(new Options().arguments); | 290 var configurations = optionsParser.parse(new Options().arguments); |
| 285 if (configurations != null && configurations.length > 0) { | 291 if (configurations != null && configurations.length > 0) { |
| 286 testConfigurations(configurations); | 292 testConfigurations(configurations); |
| 287 } | 293 } |
| 288 }); | 294 }); |
| 289 } | 295 } |
| 290 | 296 |
| OLD | NEW |