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