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 // TODO(ager): Get rid of this version of test.dart when we don't have | 6 // TODO(ager): Get rid of this version of test.dart when we don't have |
| 7 // to worry about the special runtime checkout anymore. | 7 // to worry about the special runtime checkout anymore. |
| 8 // This file is identical to test.dart with test suites in the | 8 // This file is identical to test.dart with test suites in the |
| 9 // directories samples, client, compiler, and utils removed. | 9 // directories samples, client, compiler, and utils removed. |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 ['Test configurations:'] : ['Test configuration:']; | 65 ['Test configurations:'] : ['Test configuration:']; |
| 66 for (Map conf in configurations) { | 66 for (Map conf in configurations) { |
| 67 List settings = ['compiler', 'runtime', 'mode', 'arch'] | 67 List settings = ['compiler', 'runtime', 'mode', 'arch'] |
| 68 .mappedBy((name) => conf[name]).toList(); | 68 .mappedBy((name) => conf[name]).toList(); |
| 69 if (conf['checked']) settings.add('checked'); | 69 if (conf['checked']) settings.add('checked'); |
| 70 output_words.add(settings.join('_')); | 70 output_words.add(settings.join('_')); |
| 71 } | 71 } |
| 72 print(output_words.join(' ')); | 72 print(output_words.join(' ')); |
| 73 } | 73 } |
| 74 | 74 |
| 75 var testSuites = new List<TestSuite>(); | 75 var testSuites = new List<TestSuite>(); |
|
Emily Fortuna
2013/02/22 17:45:30
the value of runningBrowserTests is no longer defi
kustermann
2013/02/22 18:16:38
Thanks for catching that.
| |
| 76 TestingServerRunner.setBuildDir(firstConf); | |
| 77 TestingServerRunner.setPackageRootDir(firstConf); | |
| 78 for (var conf in configurations) { | 76 for (var conf in configurations) { |
| 77 if (!listTests && runningBrowserTests) { | |
| 78 // Start global http servers that serve the entire dart repo. | |
| 79 // The http server is available on window.location.port, and a second | |
| 80 // server for cross-domain tests can be found by calling | |
| 81 // getCrossOriginPortNumber(). | |
| 82 var servers = new TestingServers(new Path(TestUtils.buildDir(conf))); | |
| 83 servers.startServers('127.0.0.1', 9876); | |
|
Emily Fortuna
2013/02/22 17:45:30
we can get rid of the 9876 argument, since we can
kustermann
2013/02/22 18:16:38
Well, I didn't know why this magic number was here
Emily Fortuna
2013/02/22 18:42:51
The magic number was there from when Mads original
| |
| 84 conf['_servers_'] = servers; | |
| 85 } | |
| 86 | |
| 79 if (selectors.containsKey('co19')) { | 87 if (selectors.containsKey('co19')) { |
| 80 testSuites.add(new Co19TestSuite(conf)); | 88 testSuites.add(new Co19TestSuite(conf)); |
| 81 } | 89 } |
| 90 | |
| 82 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { | 91 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { |
| 83 // vm tests contain both cc tests (added here) and dart tests (added in | 92 // vm tests contain both cc tests (added here) and dart tests (added in |
| 84 // [TEST_SUITE_DIRECTORIES]). | 93 // [TEST_SUITE_DIRECTORIES]). |
| 85 testSuites.add(new VMTestSuite(conf)); | 94 testSuites.add(new VMTestSuite(conf)); |
| 86 } | 95 } |
| 87 | 96 |
| 88 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 97 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 89 final name = testSuiteDir.filename; | 98 final name = testSuiteDir.filename; |
| 90 if (selectors.containsKey(name)) { | 99 if (selectors.containsKey(name)) { |
| 91 testSuites.add(new StandardTestSuite.forDirectory(conf, testSuiteDir)); | 100 testSuites.add(new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 92 } | 101 } |
| 93 } | 102 } |
| 94 } | 103 } |
| 95 | 104 |
| 96 // Start global http server that serves the entire dart repo. | 105 void allTestsFinished() { |
| 97 // The http server is available on localhost:9876 for any | 106 for (var conf in configurations) { |
| 98 // test that needs to load resources from the repo over http. | 107 if (conf.containsKey('_servers_')) { |
| 99 if (!listTests) { | 108 conf['_servers_'].stopServers(); |
| 100 // Only start the server if we are running browser tests. | 109 } |
| 101 var runningBrowserTests = configurations.any((config) { | 110 } |
| 102 return TestUtils.isBrowserRuntime(config['runtime']); | 111 DebugLogger.close(); |
| 103 }); | |
| 104 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); | |
| 105 } | 112 } |
| 106 | 113 |
| 107 var maxBrowserProcesses = maxProcesses; | 114 var maxBrowserProcesses = maxProcesses; |
| 108 | 115 |
| 109 // Start process queue. | 116 // Start process queue. |
| 110 new ProcessQueue( | 117 new ProcessQueue( |
| 111 maxProcesses, | 118 maxProcesses, |
| 112 maxBrowserProcesses, | 119 maxBrowserProcesses, |
| 113 progressIndicator, | 120 progressIndicator, |
| 114 startTime, | 121 startTime, |
| 115 printTiming, | 122 printTiming, |
| 116 testSuites, | 123 testSuites, |
| 117 () => TestingServerRunner.terminateHttpServers(), | 124 allTestsFinished, |
| 118 verbose, | 125 verbose, |
| 119 listTests); | 126 listTests); |
| 120 } | 127 } |
| OLD | NEW |