| 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(Strings.join(settings, '_')); | 70 output_words.add(Strings.join(settings, '_')); |
| 71 } | 71 } |
| 72 print(Strings.join(output_words, ' ')); | 72 print(Strings.join(output_words, ' ')); |
| 73 } | 73 } |
| 74 | 74 |
| 75 var configurationIterator = configurations.iterator; | 75 var testSuites = new List<TestSuite>(); |
| 76 void enqueueConfiguration(ProcessQueue queue) { | 76 for (var conf in configurations) { |
| 77 if (!configurationIterator.moveNext()) return; | |
| 78 | |
| 79 var conf = configurationIterator.current; | |
| 80 if (selectors.containsKey('co19')) { | 77 if (selectors.containsKey('co19')) { |
| 81 queue.addTestSuite(new Co19TestSuite(conf)); | 78 testSuites.add(new Co19TestSuite(conf)); |
| 82 } | 79 } |
| 83 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { | 80 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { |
| 84 // vm tests contain both cc tests (added here) and dart tests (added in | 81 // vm tests contain both cc tests (added here) and dart tests (added in |
| 85 // [TEST_SUITE_DIRECTORIES]). | 82 // [TEST_SUITE_DIRECTORIES]). |
| 86 queue.addTestSuite(new VMTestSuite(conf)); | 83 testSuites.add(new VMTestSuite(conf)); |
| 87 } | 84 } |
| 88 | 85 |
| 89 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 86 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 90 final name = testSuiteDir.filename; | 87 final name = testSuiteDir.filename; |
| 91 if (selectors.containsKey(name)) { | 88 if (selectors.containsKey(name)) { |
| 92 queue.addTestSuite( | 89 testSuites.add(new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 93 new StandardTestSuite.forDirectory(conf, testSuiteDir)); | |
| 94 } | 90 } |
| 95 } | 91 } |
| 96 } | 92 } |
| 97 | 93 |
| 98 // Start global http server that serves the entire dart repo. | 94 // Start global http server that serves the entire dart repo. |
| 99 // The http server is available on localhost:9876 for any | 95 // The http server is available on localhost:9876 for any |
| 100 // test that needs to load resources from the repo over http. | 96 // test that needs to load resources from the repo over http. |
| 101 if (!listTests) { | 97 if (!listTests) { |
| 102 // Only start the server if we are running browser tests. | 98 // Only start the server if we are running browser tests. |
| 103 var runningBrowserTests = configurations.any((config) { | 99 var runningBrowserTests = configurations.any((config) { |
| 104 return TestUtils.isBrowserRuntime(config['runtime']); | 100 return TestUtils.isBrowserRuntime(config['runtime']); |
| 105 }); | 101 }); |
| 106 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); | 102 if (runningBrowserTests) startHttpServer('127.0.0.1', 9876); |
| 107 } | 103 } |
| 108 | 104 |
| 109 // Start process queue. | 105 // Start process queue. |
| 110 new ProcessQueue( | 106 new ProcessQueue( |
| 111 maxProcesses, | 107 maxProcesses, |
| 112 progressIndicator, | 108 progressIndicator, |
| 113 startTime, | 109 startTime, |
| 114 printTiming, | 110 printTiming, |
| 115 enqueueConfiguration, | 111 testSuites, |
| 116 () => terminateHttpServer(), | 112 () => terminateHttpServer(), |
| 117 verbose, | 113 verbose, |
| 118 listTests); | 114 listTests); |
| 119 } | 115 } |
| OLD | NEW |