| 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) 2013, 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 import "testing/dart/http_server.dart"; |
| 18 #import("testing/dart/utils.dart"); | 18 import "testing/dart/utils.dart"; |
| 19 | 19 |
| 20 #import("../tests/co19/test_config.dart"); | 20 import "../tests/co19/test_config.dart"; |
| 21 #import("../runtime/tests/vm/test_config.dart"); | 21 import "../runtime/tests/vm/test_config.dart"; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * The directories that contain test suites which follow the conventions | 24 * The directories that contain test suites which follow the conventions |
| 25 * required by [StandardTestSuite]'s forDirectory constructor. | 25 * required by [StandardTestSuite]'s forDirectory constructor. |
| 26 * New test suites should follow this convention because it makes it much | 26 * New test suites should follow this convention because it makes it much |
| 27 * simpler to add them to test.dart. Existing test suites should be | 27 * simpler to add them to test.dart. Existing test suites should be |
| 28 * moved to here, if possible. | 28 * moved to here, if possible. |
| 29 */ | 29 */ |
| 30 final TEST_SUITE_DIRECTORIES = [ | 30 final TEST_SUITE_DIRECTORIES = [ |
| 31 new Path('runtime/tests/vm'), | 31 new Path('runtime/tests/vm'), |
| 32 new Path('tests/corelib'), | 32 new Path('tests/corelib'), |
| 33 new Path('tests/isolate'), | 33 new Path('tests/isolate'), |
| 34 new Path('tests/language'), | 34 new Path('tests/language'), |
| 35 new Path('tests/lib'), | 35 new Path('tests/lib'), |
| 36 new Path('tests/standalone'), | 36 new Path('tests/standalone'), |
| 37 new Path('tests/utils'), | 37 new Path('tests/utils'), |
| 38 ]; | 38 ]; |
| 39 | 39 |
| 40 main() { | 40 main() { |
| 41 var startTime = new Date.now(); | 41 var startTime = new DateTime.now(); |
| 42 var optionsParser = new TestOptionsParser(); | 42 var optionsParser = new TestOptionsParser(); |
| 43 List<Map> configurations = optionsParser.parse(new Options().arguments); | 43 List<Map> configurations = optionsParser.parse(new Options().arguments); |
| 44 if (configurations == null) return; | 44 if (configurations == null) return; |
| 45 | 45 |
| 46 // Extract global options from first configuration. | 46 // Extract global options from first configuration. |
| 47 var firstConf = configurations[0]; | 47 var firstConf = configurations[0]; |
| 48 Map<String, RegExp> selectors = firstConf['selectors']; | 48 Map<String, RegExp> selectors = firstConf['selectors']; |
| 49 var maxProcesses = firstConf['tasks']; | 49 var maxProcesses = firstConf['tasks']; |
| 50 var progressIndicator = firstConf['progress']; | 50 var progressIndicator = firstConf['progress']; |
| 51 var verbose = firstConf['verbose']; | 51 var verbose = firstConf['verbose']; |
| 52 var printTiming = firstConf['time']; | 52 var printTiming = firstConf['time']; |
| 53 var listTests = firstConf['list']; | 53 var listTests = firstConf['list']; |
| 54 | 54 |
| 55 if (!firstConf['append_logs']) { | 55 if (!firstConf['append_logs']) { |
| 56 var file = new File(TestUtils.flakyFileName()); | 56 var file = new File(TestUtils.flakyFileName()); |
| 57 if (file.existsSync()) { | 57 if (file.existsSync()) { |
| 58 file.deleteSync(); | 58 file.deleteSync(); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 // Print the configurations being run by this execution of | 61 // Print the configurations being run by this execution of |
| 62 // test.dart. However, don't do it if the silent progress indicator | 62 // test.dart. However, don't do it if the silent progress indicator |
| 63 // is used. This is only needed because of the junit tests. | 63 // is used. This is only needed because of the junit tests. |
| 64 if (progressIndicator != 'silent') { | 64 if (progressIndicator != 'silent') { |
| 65 List output_words = configurations.length > 1 ? | 65 List output_words = configurations.length > 1 ? |
| 66 ['Test configurations:'] : ['Test configuration:']; | 66 ['Test configurations:'] : ['Test configuration:']; |
| 67 for (Map conf in configurations) { | 67 for (Map conf in configurations) { |
| 68 List settings = ['compiler', 'runtime', 'mode', 'arch'] | 68 List settings = ['compiler', 'runtime', 'mode', 'arch'] |
| 69 .mappedBy((name) => conf[name]).toList(); | 69 .map((name) => conf[name]).toList(); |
| 70 if (conf['checked']) settings.add('checked'); | 70 if (conf['checked']) settings.add('checked'); |
| 71 output_words.add(settings.join('_')); | 71 output_words.add(settings.join('_')); |
| 72 } | 72 } |
| 73 print(output_words.join(' ')); | 73 print(output_words.join(' ')); |
| 74 } | 74 } |
| 75 | 75 |
| 76 var testSuites = new List<TestSuite>(); | 76 var testSuites = new List<TestSuite>(); |
| 77 for (var conf in configurations) { | 77 for (var conf in configurations) { |
| 78 if (selectors.containsKey('co19')) { | 78 if (selectors.containsKey('co19')) { |
| 79 testSuites.add(new Co19TestSuite(conf)); | 79 testSuites.add(new Co19TestSuite(conf)); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 new ProcessQueue( | 133 new ProcessQueue( |
| 134 maxProcesses, | 134 maxProcesses, |
| 135 maxBrowserProcesses, | 135 maxBrowserProcesses, |
| 136 startTime, | 136 startTime, |
| 137 testSuites, | 137 testSuites, |
| 138 eventListener, | 138 eventListener, |
| 139 allTestsFinished, | 139 allTestsFinished, |
| 140 verbose, | 140 verbose, |
| 141 listTests); | 141 listTests); |
| 142 } | 142 } |
| OLD | NEW |