OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test_configurations; | 5 library test_configurations; |
6 | 6 |
7 import "dart:async"; | 7 import "dart:async"; |
8 import 'dart:convert'; | 8 import 'dart:convert'; |
9 import 'dart:io'; | 9 import 'dart:io'; |
10 import "dart:math" as math; | 10 import "dart:math" as math; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 Browser.resetBrowserConfiguration = firstConf['reset_browser_configuration']; | 77 Browser.resetBrowserConfiguration = firstConf['reset_browser_configuration']; |
78 | 78 |
79 if (recordingPath != null && recordingOutputPath != null) { | 79 if (recordingPath != null && recordingOutputPath != null) { |
80 print("Fatal: Can't have the '--record_to_file' and '--replay_from_file'" | 80 print("Fatal: Can't have the '--record_to_file' and '--replay_from_file'" |
81 "at the same time. Exiting ..."); | 81 "at the same time. Exiting ..."); |
82 exit(1); | 82 exit(1); |
83 } | 83 } |
84 | 84 |
85 if (!firstConf['append_logs']) { | 85 if (!firstConf['append_logs']) { |
86 var files = [ | 86 var files = [ |
87 new File(TestUtils.flakyFileName()), | 87 new File(TestUtils.flakyFileName), |
88 new File(TestUtils.testOutcomeFileName()) | 88 new File(TestUtils.testOutcomeFileName) |
89 ]; | 89 ]; |
90 for (var file in files) { | 90 for (var file in files) { |
91 if (file.existsSync()) { | 91 if (file.existsSync()) { |
92 file.deleteSync(); | 92 file.deleteSync(); |
93 } | 93 } |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 DebugLogger.init( | 97 DebugLogger.init( |
98 firstConf['write_debug_log'] ? TestUtils.debugLogfile() : null, | 98 firstConf['write_debug_log'] ? TestUtils.debugLogFilePath : null, |
99 append: firstConf['append_logs']); | 99 append: firstConf['append_logs']); |
100 | 100 |
101 // Print the configurations being run by this execution of | 101 // Print the configurations being run by this execution of |
102 // test.dart. However, don't do it if the silent progress indicator | 102 // test.dart. However, don't do it if the silent progress indicator |
103 // is used. This is only needed because of the junit tests. | 103 // is used. This is only needed because of the junit tests. |
104 if (progressIndicator != 'silent') { | 104 if (progressIndicator != 'silent') { |
105 List output_words = configurations.length > 1 | 105 List output_words = configurations.length > 1 |
106 ? ['Test configurations:'] | 106 ? ['Test configurations:'] |
107 : ['Test configuration:']; | 107 : ['Test configuration:']; |
108 for (Map conf in configurations) { | 108 for (Map conf in configurations) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 conf['runtime'], | 144 conf['runtime'], |
145 null, | 145 null, |
146 conf['package_root'], | 146 conf['package_root'], |
147 conf['packages']); | 147 conf['packages']); |
148 serverFutures.add(servers.startServers(conf['local_ip'], | 148 serverFutures.add(servers.startServers(conf['local_ip'], |
149 port: conf['test_server_port'], | 149 port: conf['test_server_port'], |
150 crossOriginPort: conf['test_server_cross_origin_port'])); | 150 crossOriginPort: conf['test_server_cross_origin_port'])); |
151 conf['_servers_'] = servers; | 151 conf['_servers_'] = servers; |
152 if (verbose) { | 152 if (verbose) { |
153 serverFutures.last.then((_) { | 153 serverFutures.last.then((_) { |
154 var commandline = servers.httpServerCommandline(); | 154 var commandline = servers.httpServerCommandLine(); |
155 print('Started HttpServers: $commandline'); | 155 print('Started HttpServers: $commandline'); |
156 }); | 156 }); |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 if (conf['runtime'].startsWith('ie')) { | 160 if (conf['runtime'].startsWith('ie')) { |
161 // NOTE: We've experienced random timeouts of tests on ie9/ie10. The | 161 // NOTE: We've experienced random timeouts of tests on ie9/ie10. The |
162 // underlying issue has not been determined yet. Our current hypothesis | 162 // underlying issue has not been determined yet. Our current hypothesis |
163 // is that windows does not handle the IE processes independently. | 163 // is that windows does not handle the IE processes independently. |
164 // If we have more than one browser and kill a browser we are seeing | 164 // If we have more than one browser and kill a browser we are seeing |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 void allTestsFinished() { | 217 void allTestsFinished() { |
218 for (var conf in configurations) { | 218 for (var conf in configurations) { |
219 if (conf.containsKey('_servers_')) { | 219 if (conf.containsKey('_servers_')) { |
220 conf['_servers_'].stopServers(); | 220 conf['_servers_'].stopServers(); |
221 } | 221 } |
222 } | 222 } |
223 DebugLogger.close(); | 223 DebugLogger.close(); |
224 TestUtils.deleteTempSnapshotDirectory(configurations[0]); | 224 TestUtils.deleteTempSnapshotDirectory(configurations[0]); |
225 } | 225 } |
226 | 226 |
227 var eventListener = []; | 227 var eventListener = <EventListener>[]; |
228 | 228 |
229 // We don't print progress if we list tests. | 229 // We don't print progress if we list tests. |
230 if (progressIndicator != 'silent' && !listTests) { | 230 if (progressIndicator != 'silent' && !listTests) { |
231 var printFailures = true; | 231 var printFailures = true; |
232 var formatter = new Formatter(); | 232 var formatter = Formatter.normal; |
233 if (progressIndicator == 'color') { | 233 if (progressIndicator == 'color') { |
234 progressIndicator = 'compact'; | 234 progressIndicator = 'compact'; |
235 formatter = new ColorFormatter(); | 235 formatter = Formatter.color; |
236 } | 236 } |
237 if (progressIndicator == 'diff') { | 237 if (progressIndicator == 'diff') { |
238 progressIndicator = 'compact'; | 238 progressIndicator = 'compact'; |
239 formatter = new ColorFormatter(); | 239 formatter = Formatter.color; |
240 printFailures = false; | 240 printFailures = false; |
241 eventListener.add(new StatusFileUpdatePrinter()); | 241 eventListener.add(new StatusFileUpdatePrinter()); |
242 } | 242 } |
243 eventListener.add(new SummaryPrinter()); | 243 eventListener.add(new SummaryPrinter()); |
244 eventListener.add(new FlakyLogWriter()); | 244 eventListener.add(new FlakyLogWriter()); |
245 if (printFailures) { | 245 if (printFailures) { |
246 // The buildbot has it's own failure summary since it needs to wrap it | 246 // The buildbot has it's own failure summary since it needs to wrap it |
247 // into '@@@'-annotated sections. | 247 // into '@@@'-annotated sections. |
248 var printFailureSummary = progressIndicator != 'buildbot'; | 248 var printFailureSummary = progressIndicator != 'buildbot'; |
249 eventListener.add(new TestFailurePrinter(printFailureSummary, formatter)); | 249 eventListener.add(new TestFailurePrinter(printFailureSummary, formatter)); |
250 } | 250 } |
251 eventListener.add( | 251 eventListener.add( |
252 progressIndicatorFromName(progressIndicator, startTime, formatter)); | 252 ProgressIndicator.fromName(progressIndicator, startTime, formatter)); |
253 if (printTiming) { | 253 if (printTiming) { |
254 eventListener.add(new TimingPrinter(startTime)); | 254 eventListener.add(new TimingPrinter(startTime)); |
255 } | 255 } |
256 eventListener.add(new SkippedCompilationsPrinter()); | 256 eventListener.add(new SkippedCompilationsPrinter()); |
257 } | 257 } |
258 if (firstConf['write_test_outcome_log']) { | 258 if (firstConf['write_test_outcome_log']) { |
259 eventListener.add(new TestOutcomeLogWriter()); | 259 eventListener.add(new TestOutcomeLogWriter()); |
260 } | 260 } |
261 if (firstConf['copy_coredumps']) { | 261 if (firstConf['copy_coredumps']) { |
262 eventListener.add(new UnexpectedCrashLogger()); | 262 eventListener.add(new UnexpectedCrashLogger()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 maxBrowserProcesses, | 307 maxBrowserProcesses, |
308 startTime, | 308 startTime, |
309 testSuites, | 309 testSuites, |
310 eventListener, | 310 eventListener, |
311 allTestsFinished, | 311 allTestsFinished, |
312 verbose, | 312 verbose, |
313 recordingPath, | 313 recordingPath, |
314 recordingOutputPath, | 314 recordingOutputPath, |
315 adbDevicePool); | 315 adbDevicePool); |
316 } | 316 } |
OLD | NEW |