Chromium Code Reviews| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 | 74 |
| 75 // Extract global options from first configuration. | 75 // Extract global options from first configuration. |
| 76 var firstConf = configurations[0]; | 76 var firstConf = configurations[0]; |
| 77 Map<String, RegExp> selectors = firstConf['selectors']; | 77 Map<String, RegExp> selectors = firstConf['selectors']; |
| 78 var maxProcesses = firstConf['tasks']; | 78 var maxProcesses = firstConf['tasks']; |
| 79 var progressIndicator = firstConf['progress']; | 79 var progressIndicator = firstConf['progress']; |
| 80 BuildbotProgressIndicator.stepName = firstConf['step_name']; | 80 BuildbotProgressIndicator.stepName = firstConf['step_name']; |
| 81 var verbose = firstConf['verbose']; | 81 var verbose = firstConf['verbose']; |
| 82 var printTiming = firstConf['time']; | 82 var printTiming = firstConf['time']; |
| 83 var listTests = firstConf['list']; | 83 var listTests = firstConf['list']; |
| 84 | 84 |
| 85 if (!firstConf['append_flaky_log']) { | 85 if (!firstConf['append_flaky_log']) { |
| 86 var file = new File(TestUtils.flakyFileName()); | 86 var file = new File(TestUtils.flakyFileName()); |
| 87 if (file.existsSync()) { | 87 if (file.existsSync()) { |
| 88 file.deleteSync(); | 88 file.deleteSync(); |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 // Print the configurations being run by this execution of | 92 // Print the configurations being run by this execution of |
| 93 // test.dart. However, don't do it if the silent progress indicator | 93 // test.dart. However, don't do it if the silent progress indicator |
| 94 // is used. This is only needed because of the junit tests. | 94 // is used. This is only needed because of the junit tests. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 124 | 124 |
| 125 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 125 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 126 final name = testSuiteDir.filename; | 126 final name = testSuiteDir.filename; |
| 127 if (selectors.containsKey(name)) { | 127 if (selectors.containsKey(name)) { |
| 128 queue.addTestSuite( | 128 queue.addTestSuite( |
| 129 new StandardTestSuite.forDirectory(conf, testSuiteDir)); | 129 new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 // Start global http server that serves the entire dart repo. | 134 // Start global http servers that serve the entire dart repo. |
| 135 // The http server is available on localhost:9876 for any | 135 // The http server is available on localhost:9876 and localhost:5432 for any |
| 136 // test that needs to load resources from the repo over http. | 136 // test that needs to load resources from the repo over http. |
| 137 List serverList = []; | |
| 137 if (!listTests) { | 138 if (!listTests) { |
| 138 // Only start the server if we are running browser tests. | 139 // Only start the server if we are running browser tests. |
| 139 var runningBrowserTests = configurations.some((config) { | 140 var runningBrowserTests = configurations.some((config) { |
| 140 return TestUtils.isBrowserRuntime(config['runtime']); | 141 return TestUtils.isBrowserRuntime(config['runtime']); |
| 141 }); | 142 }); |
| 142 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); | 143 if (runningBrowserTests) { |
| 144 serverList.add( | |
| 145 startHttpServer('127.0.0.1', SERVER_PORT_ONE, SERVER_PORT_TWO)); | |
|
Mads Ager (google)
2013/01/02 10:09:50
Instead of passing in two ports here, we could ret
Emily Fortuna
2013/01/04 00:51:03
Done.
| |
| 146 // We start two servers so that we can test cross-domain tests. | |
| 147 serverList.add( | |
| 148 startHttpServer('127.0.0.1', SERVER_PORT_TWO, SERVER_PORT_ONE)); | |
| 149 } | |
| 143 } | 150 } |
| 144 | 151 |
| 145 // Start process queue. | 152 // Start process queue. |
| 146 new ProcessQueue(maxProcesses, | 153 new ProcessQueue(maxProcesses, |
| 147 progressIndicator, | 154 progressIndicator, |
| 148 startTime, | 155 startTime, |
| 149 printTiming, | 156 printTiming, |
| 150 enqueueConfiguration, | 157 enqueueConfiguration, |
| 151 () => terminateHttpServer(), | 158 () => terminateHttpServers(serverList), |
| 152 verbose, | 159 verbose, |
| 153 listTests); | 160 listTests); |
| 154 } | 161 } |
| OLD | NEW |