| 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 |
| 11 #library("test"); | 11 #library("test"); |
| 12 | 12 |
| 13 #import("dart:io"); | 13 #import("dart:io"); |
| 14 #import("testing/dart/test_runner.dart"); | 14 #import("testing/dart/test_runner.dart"); |
| 15 #import("testing/dart/test_options.dart"); | 15 #import("testing/dart/test_options.dart"); |
| 16 #import("testing/dart/test_suite.dart"); | 16 #import("testing/dart/test_suite.dart"); |
| 17 #import("testing/dart/http_server.dart"); |
| 17 | 18 |
| 18 #import("../tests/co19/test_config.dart"); | 19 #import("../tests/co19/test_config.dart"); |
| 19 #import("../runtime/tests/vm/test_config.dart"); | 20 #import("../runtime/tests/vm/test_config.dart"); |
| 20 | 21 |
| 21 /** | 22 /** |
| 22 * The directories that contain test suites which follow the conventions | 23 * The directories that contain test suites which follow the conventions |
| 23 * required by [StandardTestSuite]'s forDirectory constructor. | 24 * required by [StandardTestSuite]'s forDirectory constructor. |
| 24 * New test suites should follow this convention because it makes it much | 25 * New test suites should follow this convention because it makes it much |
| 25 * simpler to add them to test.dart. Existing test suites should be | 26 * simpler to add them to test.dart. Existing test suites should be |
| 26 * moved to here, if possible. | 27 * moved to here, if possible. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 for (Map conf in configurations) { | 60 for (Map conf in configurations) { |
| 60 List settings = | 61 List settings = |
| 61 ['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]); | 62 ['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]); |
| 62 if (conf['checked']) settings.add('checked'); | 63 if (conf['checked']) settings.add('checked'); |
| 63 output_words.add(Strings.join(settings, '_')); | 64 output_words.add(Strings.join(settings, '_')); |
| 64 } | 65 } |
| 65 print(Strings.join(output_words, ' ')); | 66 print(Strings.join(output_words, ' ')); |
| 66 } | 67 } |
| 67 | 68 |
| 68 var configurationIterator = configurations.iterator(); | 69 var configurationIterator = configurations.iterator(); |
| 69 bool enqueueConfiguration(ProcessQueue queue) { | 70 void enqueueConfiguration(ProcessQueue queue) { |
| 70 if (!configurationIterator.hasNext()) { | 71 if (!configurationIterator.hasNext()) return; |
| 71 return false; | |
| 72 } | |
| 73 | 72 |
| 74 var conf = configurationIterator.next(); | 73 var conf = configurationIterator.next(); |
| 75 if (selectors.containsKey('co19')) { | 74 if (selectors.containsKey('co19')) { |
| 76 queue.addTestSuite(new Co19TestSuite(conf)); | 75 queue.addTestSuite(new Co19TestSuite(conf)); |
| 77 } | 76 } |
| 78 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { | 77 if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) { |
| 79 // vm tests contain both cc tests (added here) and dart tests (added in | 78 // vm tests contain both cc tests (added here) and dart tests (added in |
| 80 // [TEST_SUITE_DIRECTORIES]). | 79 // [TEST_SUITE_DIRECTORIES]). |
| 81 queue.addTestSuite(new VMTestSuite(conf)); | 80 queue.addTestSuite(new VMTestSuite(conf)); |
| 82 } | 81 } |
| 83 | 82 |
| 84 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 83 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
| 85 final name = testSuiteDir.filename; | 84 final name = testSuiteDir.filename; |
| 86 if (selectors.containsKey(name)) { | 85 if (selectors.containsKey(name)) { |
| 87 queue.addTestSuite( | 86 queue.addTestSuite( |
| 88 new StandardTestSuite.forDirectory(conf, testSuiteDir)); | 87 new StandardTestSuite.forDirectory(conf, testSuiteDir)); |
| 89 } | 88 } |
| 90 } | 89 } |
| 91 | |
| 92 return true; | |
| 93 } | 90 } |
| 94 | 91 |
| 92 // Start global http server that serves the entire dart repo. |
| 93 // The http server is available on localhost:9876 for any |
| 94 // test that needs to load resources from the repo over http. |
| 95 startHttpServer('127.0.0.1', 9876); |
| 96 |
| 95 // Start process queue. | 97 // Start process queue. |
| 96 var queue = new ProcessQueue(maxProcesses, | 98 new ProcessQueue( |
| 97 progressIndicator, | 99 maxProcesses, |
| 98 startTime, | 100 progressIndicator, |
| 99 printTiming, | 101 startTime, |
| 100 enqueueConfiguration, | 102 printTiming, |
| 101 verbose, | 103 enqueueConfiguration, |
| 102 listTests); | 104 () => terminateHttpServer(), |
| 105 verbose, |
| 106 listTests); |
| 103 } | 107 } |
| OLD | NEW |