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 11 matching lines...) Expand all Loading... | |
| 22 * | 22 * |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #library("test"); | 25 #library("test"); |
| 26 | 26 |
| 27 #import("dart:io"); | 27 #import("dart:io"); |
| 28 #import("testing/dart/test_runner.dart"); | 28 #import("testing/dart/test_runner.dart"); |
| 29 #import("testing/dart/test_options.dart"); | 29 #import("testing/dart/test_options.dart"); |
| 30 #import("testing/dart/test_suite.dart"); | 30 #import("testing/dart/test_suite.dart"); |
| 31 #import("testing/dart/test_progress.dart"); | 31 #import("testing/dart/test_progress.dart"); |
| 32 #import("testing/dart/http_server.dart"); | |
| 32 | 33 |
| 33 #import("../compiler/tests/dartc/test_config.dart"); | 34 #import("../compiler/tests/dartc/test_config.dart"); |
| 34 #import("../runtime/tests/vm/test_config.dart"); | 35 #import("../runtime/tests/vm/test_config.dart"); |
| 35 #import("../samples/tests/dartc/test_config.dart"); | 36 #import("../samples/tests/dartc/test_config.dart"); |
| 36 #import("../tests/co19/test_config.dart"); | 37 #import("../tests/co19/test_config.dart"); |
| 37 | 38 |
| 38 /** | 39 /** |
| 39 * The directories that contain test suites which follow the conventions | 40 * The directories that contain test suites which follow the conventions |
| 40 * required by [StandardTestSuite]'s forDirectory constructor. | 41 * required by [StandardTestSuite]'s forDirectory constructor. |
| 41 * New test suites should follow this convention because it makes it much | 42 * New test suites should follow this convention because it makes it much |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 for (Map conf in configurations) { | 91 for (Map conf in configurations) { |
| 91 List settings = | 92 List settings = |
| 92 ['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]); | 93 ['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]); |
| 93 if (conf['checked']) settings.add('checked'); | 94 if (conf['checked']) settings.add('checked'); |
| 94 output_words.add(Strings.join(settings, '_')); | 95 output_words.add(Strings.join(settings, '_')); |
| 95 } | 96 } |
| 96 print(Strings.join(output_words, ' ')); | 97 print(Strings.join(output_words, ' ')); |
| 97 } | 98 } |
| 98 | 99 |
| 99 var configurationIterator = configurations.iterator(); | 100 var configurationIterator = configurations.iterator(); |
| 100 bool enqueueConfiguration(ProcessQueue queue) { | 101 void enqueueConfiguration(ProcessQueue queue) { |
| 101 if (!configurationIterator.hasNext()) { | 102 if (!configurationIterator.hasNext()) return; |
| 102 return false; | |
| 103 } | |
| 104 | 103 |
| 105 var conf = configurationIterator.next(); | 104 var conf = configurationIterator.next(); |
| 106 for (String key in selectors.getKeys()) { | 105 for (String key in selectors.getKeys()) { |
| 107 if (key == 'co19') { | 106 if (key == 'co19') { |
| 108 queue.addTestSuite(new Co19TestSuite(conf)); | 107 queue.addTestSuite(new Co19TestSuite(conf)); |
| 109 } else if (conf['runtime'] == 'vm' && key == 'vm') { | 108 } else if (conf['runtime'] == 'vm' && key == 'vm') { |
| 110 // vm tests contain both cc tests (added here) and dart tests (added in | 109 // vm tests contain both cc tests (added here) and dart tests (added in |
| 111 // [TEST_SUITE_DIRECTORIES]). | 110 // [TEST_SUITE_DIRECTORIES]). |
| 112 queue.addTestSuite(new VMTestSuite(conf)); | 111 queue.addTestSuite(new VMTestSuite(conf)); |
| 113 } else if (conf['compiler'] == 'dartc' && key == 'dartc') { | 112 } else if (conf['compiler'] == 'dartc' && key == 'dartc') { |
| 114 queue.addTestSuite(new SamplesDartcTestSuite(conf)); | 113 queue.addTestSuite(new SamplesDartcTestSuite(conf)); |
| 115 queue.addTestSuite(new JUnitDartcTestSuite(conf)); | 114 queue.addTestSuite(new JUnitDartcTestSuite(conf)); |
| 116 } | 115 } |
| 117 } | 116 } |
| 118 | 117 |
| 119 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 118 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 120 final name = testSuiteDir.filename; | 119 final name = testSuiteDir.filename; |
| 121 if (selectors.containsKey(name)) { | 120 if (selectors.containsKey(name)) { |
| 122 queue.addTestSuite( | 121 queue.addTestSuite( |
| 123 new StandardTestSuite.forDirectory(conf, testSuiteDir)); | 122 new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 124 } | 123 } |
| 125 } | 124 } |
| 126 | |
| 127 return true; | |
| 128 } | 125 } |
| 129 | 126 |
| 127 // Start global http server that serves the entire dart repo. | |
| 128 // The http server is available on localhost:9876 for any | |
| 129 // test that needs to load resources from the repo over http. | |
| 130 startHttpServer('127.0.0.1', 9876); | |
|
Ivan Posva
2012/10/30 21:27:04
How is this supposed to work when two people on th
| |
| 131 | |
| 130 // Start process queue. | 132 // Start process queue. |
| 131 var queue = new ProcessQueue(maxProcesses, | 133 new ProcessQueue( |
| 132 progressIndicator, | 134 maxProcesses, |
| 133 startTime, | 135 progressIndicator, |
| 134 printTiming, | 136 startTime, |
| 135 enqueueConfiguration, | 137 printTiming, |
| 136 verbose, | 138 enqueueConfiguration, |
| 137 listTests); | 139 () => terminateHttpServer(), |
| 140 verbose, | |
| 141 listTests); | |
| 138 } | 142 } |
| OLD | NEW |