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 12 matching lines...) Expand all Loading... |
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 import "testing/dart/http_server.dart"; |
| 33 import "testing/dart/utils.dart"; |
33 | 34 |
34 import "../compiler/tests/dartc/test_config.dart"; | 35 import "../compiler/tests/dartc/test_config.dart"; |
35 import "../runtime/tests/vm/test_config.dart"; | 36 import "../runtime/tests/vm/test_config.dart"; |
36 import "../samples/tests/dartc/test_config.dart"; | 37 import "../samples/tests/dartc/test_config.dart"; |
37 import "../tests/co19/test_config.dart"; | 38 import "../tests/co19/test_config.dart"; |
38 | 39 |
39 /** | 40 /** |
40 * The directories that contain test suites which follow the conventions | 41 * The directories that contain test suites which follow the conventions |
41 * required by [StandardTestSuite]'s forDirectory constructor. | 42 * required by [StandardTestSuite]'s forDirectory constructor. |
42 * New test suites should follow this convention because it makes it much | 43 * New test suites should follow this convention because it makes it much |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Extract global options from first configuration. | 76 // Extract global options from first configuration. |
76 var firstConf = configurations[0]; | 77 var firstConf = configurations[0]; |
77 Map<String, RegExp> selectors = firstConf['selectors']; | 78 Map<String, RegExp> selectors = firstConf['selectors']; |
78 var maxProcesses = firstConf['tasks']; | 79 var maxProcesses = firstConf['tasks']; |
79 var progressIndicator = firstConf['progress']; | 80 var progressIndicator = firstConf['progress']; |
80 BuildbotProgressIndicator.stepName = firstConf['step_name']; | 81 BuildbotProgressIndicator.stepName = firstConf['step_name']; |
81 var verbose = firstConf['verbose']; | 82 var verbose = firstConf['verbose']; |
82 var printTiming = firstConf['time']; | 83 var printTiming = firstConf['time']; |
83 var listTests = firstConf['list']; | 84 var listTests = firstConf['list']; |
84 | 85 |
85 if (!firstConf['append_flaky_log']) { | 86 if (!firstConf['append_logs']) { |
86 var file = new File(TestUtils.flakyFileName()); | 87 var file = new File(TestUtils.flakyFileName()); |
87 if (file.existsSync()) { | 88 if (file.existsSync()) { |
88 file.deleteSync(); | 89 file.deleteSync(); |
89 } | 90 } |
90 } | 91 } |
91 | 92 |
| 93 DebugLogger.init(firstConf['write_debug_log'] ? |
| 94 TestUtils.debugLogfile() : null, append: firstConf['append_logs']); |
| 95 |
92 // Print the configurations being run by this execution of | 96 // Print the configurations being run by this execution of |
93 // test.dart. However, don't do it if the silent progress indicator | 97 // test.dart. However, don't do it if the silent progress indicator |
94 // is used. This is only needed because of the junit tests. | 98 // is used. This is only needed because of the junit tests. |
95 if (progressIndicator != 'silent') { | 99 if (progressIndicator != 'silent') { |
96 List output_words = configurations.length > 1 ? | 100 List output_words = configurations.length > 1 ? |
97 ['Test configurations:'] : ['Test configuration:']; | 101 ['Test configurations:'] : ['Test configuration:']; |
98 for (Map conf in configurations) { | 102 for (Map conf in configurations) { |
99 List settings = ['compiler', 'runtime', 'mode', 'arch'] | 103 List settings = ['compiler', 'runtime', 'mode', 'arch'] |
100 .mappedBy((name) => conf[name]).toList(); | 104 .mappedBy((name) => conf[name]).toList(); |
101 if (conf['checked']) settings.add('checked'); | 105 if (conf['checked']) settings.add('checked'); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { | 143 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { |
140 final name = testSuiteDir.filename; | 144 final name = testSuiteDir.filename; |
141 if (selectors.containsKey(name)) { | 145 if (selectors.containsKey(name)) { |
142 testSuites.add( | 146 testSuites.add( |
143 new StandardTestSuite.forDirectory(conf, testSuiteDir, | 147 new StandardTestSuite.forDirectory(conf, testSuiteDir, |
144 serverList: TestingServerRunner.serverList)); | 148 serverList: TestingServerRunner.serverList)); |
145 } | 149 } |
146 } | 150 } |
147 } | 151 } |
148 | 152 |
| 153 void allTestsFinished() { |
| 154 TestingServerRunner.terminateHttpServers(); |
| 155 DebugLogger.close(); |
| 156 } |
| 157 |
149 // Start process queue. | 158 // Start process queue. |
150 new ProcessQueue(maxProcesses, | 159 new ProcessQueue(maxProcesses, |
151 progressIndicator, | 160 progressIndicator, |
152 startTime, | 161 startTime, |
153 printTiming, | 162 printTiming, |
154 testSuites, | 163 testSuites, |
155 () => TestingServerRunner.terminateHttpServers(), | 164 allTestsFinished, |
156 verbose, | 165 verbose, |
157 listTests); | 166 listTests); |
158 } | 167 } |
OLD | NEW |