OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'configuration.dart'; | 7 import 'configuration.dart'; |
8 import 'drt_updater.dart'; | |
9 import 'path.dart'; | 8 import 'path.dart'; |
| 9 import 'runtime_updater.dart'; |
10 import 'utils.dart'; | 10 import 'utils.dart'; |
11 | 11 |
12 const _defaultTestSelectors = const [ | 12 const _defaultTestSelectors = const [ |
13 'samples', | 13 'samples', |
14 'standalone', | 14 'standalone', |
15 'corelib', | 15 'corelib', |
16 'corelib_2', | 16 'corelib_2', |
17 'co19', | 17 'co19', |
18 'language', | 18 'language', |
19 'language_2', | 19 'language_2', |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 standalone dart VM lacking a JIT. | 123 standalone dart VM lacking a JIT. |
124 | 124 |
125 d8: Run JavaScript from the command line using v8. | 125 d8: Run JavaScript from the command line using v8. |
126 | 126 |
127 jsshell: Run JavaScript from the command line using | 127 jsshell: Run JavaScript from the command line using |
128 Firefox js-shell. | 128 Firefox js-shell. |
129 | 129 |
130 drt: Run Dart or JavaScript in the headless version | 130 drt: Run Dart or JavaScript in the headless version |
131 of Chrome, Content shell. | 131 of Chrome, Content shell. |
132 | 132 |
133 dartium: Run Dart or JavaScript in Dartium. | 133 ContentShellOnAndroid: Run Dart or JavaScript in content shell |
134 | 134 on Android. |
135 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content | |
136 shell on Android. | |
137 | |
138 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. | |
139 | 135 |
140 ff: | 136 ff: |
141 chrome: | 137 chrome: |
142 safari: | 138 safari: |
143 ie9: | 139 ie9: |
144 ie10: | 140 ie10: |
145 ie11: | 141 ie11: |
146 opera: | 142 opera: |
147 chromeOnAndroid: Run JavaScript in the specified browser. | 143 chromeOnAndroid: Run JavaScript in the specified browser. |
148 | 144 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 new _Option.bool('verbose', 'Verbose output.', 'v'), | 211 new _Option.bool('verbose', 'Verbose output.', 'v'), |
216 new _Option.bool('verify-ir', 'Verify kernel IR.'), | 212 new _Option.bool('verify-ir', 'Verify kernel IR.'), |
217 new _Option.bool('no-tree-shake', 'Disable kernel IR tree shaking.'), | 213 new _Option.bool('no-tree-shake', 'Disable kernel IR tree shaking.'), |
218 new _Option.bool('list', 'List tests only, do not run them.'), | 214 new _Option.bool('list', 'List tests only, do not run them.'), |
219 new _Option.bool('report_in_json', | 215 new _Option.bool('report_in_json', |
220 'When listing with --list, output result summary in JSON.'), | 216 'When listing with --list, output result summary in JSON.'), |
221 new _Option.bool('time', 'Print timing information after running tests.'), | 217 new _Option.bool('time', 'Print timing information after running tests.'), |
222 new _Option('dart', 'Path to dart executable.'), | 218 new _Option('dart', 'Path to dart executable.'), |
223 new _Option('flutter', 'Path to flutter executable.'), | 219 new _Option('flutter', 'Path to flutter executable.'), |
224 new _Option('drt', 'Path to content shell executable.'), | 220 new _Option('drt', 'Path to content shell executable.'), |
225 new _Option('dartium', 'Path to Dartium Chrome executable.'), | |
226 new _Option('firefox', 'Path to firefox browser executable.'), | 221 new _Option('firefox', 'Path to firefox browser executable.'), |
227 new _Option('chrome', 'Path to chrome browser executable.'), | 222 new _Option('chrome', 'Path to chrome browser executable.'), |
228 new _Option('safari', 'Path to safari browser executable.'), | 223 new _Option('safari', 'Path to safari browser executable.'), |
229 new _Option.bool( | 224 new _Option.bool('use_sdk', '''Use compiler or runtime from the SDK. |
230 'use_sdk', | |
231 '''Use compiler or runtime from the SDK. | |
232 | 225 |
233 Normally, the compiler or runtimes in PRODUCT_DIR is tested, with | 226 Normally, the compiler or runtimes in PRODUCT_DIR is tested, with |
234 this option, the compiler or runtime in PRODUCT_DIR/dart-sdk/bin | 227 this option, the compiler or runtime in PRODUCT_DIR/dart-sdk/bin |
235 is tested. | 228 is tested. |
236 | 229 |
237 (Note: currently only implemented for dart2js.)'''), | 230 (Note: currently only implemented for dart2js.)'''), |
238 // TODO(rnystrom): This does not appear to be used. Remove? | 231 // TODO(rnystrom): This does not appear to be used. Remove? |
239 new _Option('build_directory', | 232 new _Option('build_directory', |
240 'The name of the build directory, where products are placed.'), | 233 'The name of the build directory, where products are placed.'), |
241 new _Option.bool('noBatch', 'Do not run tests in batch mode.', 'n'), | 234 new _Option.bool('noBatch', 'Do not run tests in batch mode.', 'n'), |
242 new _Option.bool('dart2js_batch', 'Run dart2js tests in batch mode.'), | 235 new _Option.bool('dart2js_batch', 'Run dart2js tests in batch mode.'), |
243 new _Option.bool( | 236 new _Option.bool( |
244 'append_logs', 'Do not delete old logs but rather append to them.'), | 237 'append_logs', 'Do not delete old logs but rather append to them.'), |
245 new _Option.bool('write_debug_log', | 238 new _Option.bool('write_debug_log', |
246 'Don\'t write debug messages to stdout but rather to a logfile.'), | 239 'Don\'t write debug messages to stdout but rather to a logfile.'), |
247 new _Option.bool('write_test_outcome_log', | 240 new _Option.bool('write_test_outcome_log', |
248 'Write test outcomes to a "${TestUtils.testOutcomeFileName}" file.'), | 241 'Write test outcomes to a "${TestUtils.testOutcomeFileName}" file.'), |
249 new _Option.bool( | 242 new _Option.bool('reset_browser_configuration', |
250 'reset_browser_configuration', | |
251 '''Browser specific reset of configuration. | 243 '''Browser specific reset of configuration. |
252 | 244 |
253 Warning: Using this option may remove your bookmarks and other | 245 Warning: Using this option may remove your bookmarks and other |
254 settings.'''), | 246 settings.'''), |
255 new _Option.bool( | 247 new _Option.bool('copy_coredumps', |
256 'copy_coredumps', | |
257 '''If we see a crash that we did not expect, copy the core dumps to | 248 '''If we see a crash that we did not expect, copy the core dumps to |
258 "/tmp".'''), | 249 "/tmp".'''), |
259 new _Option( | 250 new _Option( |
260 'local_ip', | 251 'local_ip', |
261 '''IP address the HTTP servers should listen on. This address is also | 252 '''IP address the HTTP servers should listen on. This address is also |
262 used for browsers to connect to.''', | 253 used for browsers to connect to.''', |
263 defaultsTo: '127.0.0.1'), | 254 defaultsTo: '127.0.0.1'), |
264 new _Option.int('test_server_port', 'Port for test http server.', | 255 new _Option.int('test_server_port', 'Port for test http server.', |
265 defaultsTo: 0), | 256 defaultsTo: 0), |
266 new _Option.int('test_server_cross_origin_port', | 257 new _Option.int('test_server_cross_origin_port', |
267 'Port for test http server cross origin.', | 258 'Port for test http server cross origin.', |
268 defaultsTo: 0), | 259 defaultsTo: 0), |
269 new _Option.int('test_driver_port', 'Port for http test driver server.', | 260 new _Option.int('test_driver_port', 'Port for http test driver server.', |
270 defaultsTo: 0), | 261 defaultsTo: 0), |
271 new _Option.int( | 262 new _Option.int( |
272 'test_driver_error_port', 'Port for http test driver server errors.', | 263 'test_driver_error_port', 'Port for http test driver server errors.', |
273 defaultsTo: 0), | 264 defaultsTo: 0), |
274 new _Option( | 265 new _Option('builder_tag', |
275 'builder_tag', | |
276 '''Machine specific options that is not captured by the regular test | 266 '''Machine specific options that is not captured by the regular test |
277 options. Used to be able to make sane updates to the status files.'''), | 267 options. Used to be able to make sane updates to the status files.'''), |
278 new _Option('vm_options', 'Extra options to send to the vm when running.'), | 268 new _Option('vm_options', 'Extra options to send to the vm when running.'), |
279 new _Option( | 269 new _Option( |
280 'dart2js_options', 'Extra options for dart2js compilation step.'), | 270 'dart2js_options', 'Extra options for dart2js compilation step.'), |
281 new _Option( | 271 new _Option( |
282 'suite_dir', 'Additional directory to add to the testing matrix.'), | 272 'suite_dir', 'Additional directory to add to the testing matrix.'), |
283 new _Option('package_root', 'The package root to use for testing.'), | 273 new _Option('package_root', 'The package root to use for testing.'), |
284 new _Option('packages', 'The package spec file to use for testing.'), | 274 new _Option('packages', 'The package spec file to use for testing.'), |
285 new _Option( | 275 new _Option('exclude_suite', |
286 'exclude_suite', | |
287 '''Exclude suites from default selector, only works when no selector | 276 '''Exclude suites from default selector, only works when no selector |
288 has been specified on the command line.'''), | 277 has been specified on the command line.'''), |
289 new _Option.bool( | 278 new _Option.bool('skip_compilation', ''' |
290 'skip_compilation', | |
291 ''' | |
292 Skip the compilation step, using the compilation artifacts left in | 279 Skip the compilation step, using the compilation artifacts left in |
293 the output folder from a previous run. This flag will often cause | 280 the output folder from a previous run. This flag will often cause |
294 false positves and negatives, but can be useful for quick and | 281 false positves and negatives, but can be useful for quick and |
295 dirty offline testing when not making changes that affect the | 282 dirty offline testing when not making changes that affect the |
296 compiler.''') | 283 compiler.''') |
297 ]; | 284 ]; |
298 | 285 |
299 /// For printing out reproducing command lines, we don't want to add these | 286 /// For printing out reproducing command lines, we don't want to add these |
300 /// options. | 287 /// options. |
301 static final _blacklistedOptions = [ | 288 static final _blacklistedOptions = [ |
302 'append_logs', | 289 'append_logs', |
303 'build_directory', | 290 'build_directory', |
304 'chrome', | 291 'chrome', |
305 'copy_coredumps', | 292 'copy_coredumps', |
306 'dart', | 293 'dart', |
307 'flutter', | 294 'flutter', |
308 'dartium', | |
309 'drt', | 295 'drt', |
310 'exclude_suite', | 296 'exclude_suite', |
311 'firefox', | 297 'firefox', |
312 'local_ip', | 298 'local_ip', |
313 'progress', | 299 'progress', |
314 'report', | 300 'report', |
315 'safari', | 301 'safari', |
316 'shard', | 302 'shard', |
317 'shards', | 303 'shards', |
318 'step_name', | 304 'step_name', |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 // progress indication is requested. | 531 // progress indication is requested. |
546 if ((data['verbose'] as bool) && | 532 if ((data['verbose'] as bool) && |
547 (data['progress'] as String) != 'buildbot') { | 533 (data['progress'] as String) != 'buildbot') { |
548 data['progress'] = 'verbose'; | 534 data['progress'] = 'verbose'; |
549 } | 535 } |
550 | 536 |
551 // Expand runtimes. | 537 // Expand runtimes. |
552 for (var runtimeName in (data["runtime"] as String).split(",")) { | 538 for (var runtimeName in (data["runtime"] as String).split(",")) { |
553 var runtime = Runtime.find(runtimeName); | 539 var runtime = Runtime.find(runtimeName); |
554 | 540 |
555 // Install the runtime if needed. | 541 // Start installing the runtime if needed. |
556 var updater = runtimeUpdater( | 542 if (!(data["list"] as bool)) { |
557 runtime, data["drt"] as String, data["dartium"] as String); | 543 updateContentShell(runtime, data["drt"] as String); |
558 if (updater != null) { | |
559 updater.update(); | |
560 } | 544 } |
561 | 545 |
562 // Expand architectures. | 546 // Expand architectures. |
563 var architectures = data["arch"] as String; | 547 var architectures = data["arch"] as String; |
564 if (architectures == "all") { | 548 if (architectures == "all") { |
565 architectures = "ia32,x64,simarm,simarm64,simdbc64"; | 549 architectures = "ia32,x64,simarm,simarm64,simdbc64"; |
566 } | 550 } |
567 | 551 |
568 for (var architectureName in architectures.split(",")) { | 552 for (var architectureName in architectures.split(",")) { |
569 var architecture = Architecture.find(architectureName); | 553 var architecture = Architecture.find(architectureName); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 resetBrowser: data["reset_browser_configuration"] as bool, | 590 resetBrowser: data["reset_browser_configuration"] as bool, |
607 skipCompilation: data["skip_compilation"] as bool, | 591 skipCompilation: data["skip_compilation"] as bool, |
608 useBlobs: data["use_blobs"] as bool, | 592 useBlobs: data["use_blobs"] as bool, |
609 useSdk: data["use_sdk"] as bool, | 593 useSdk: data["use_sdk"] as bool, |
610 useFastStartup: data["fast_startup"] as bool, | 594 useFastStartup: data["fast_startup"] as bool, |
611 useEnableAsserts: data["enable_asserts"] as bool, | 595 useEnableAsserts: data["enable_asserts"] as bool, |
612 useDart2JSWithKernel: data["dart2js_with_kernel"] as bool, | 596 useDart2JSWithKernel: data["dart2js_with_kernel"] as bool, |
613 writeDebugLog: data["write_debug_log"] as bool, | 597 writeDebugLog: data["write_debug_log"] as bool, |
614 writeTestOutcomeLog: data["write_test_outcome_log"] as bool, | 598 writeTestOutcomeLog: data["write_test_outcome_log"] as bool, |
615 drtPath: data["drt"] as String, | 599 drtPath: data["drt"] as String, |
616 dartiumPath: data["dartium"] as String, | |
617 chromePath: data["chrome"] as String, | 600 chromePath: data["chrome"] as String, |
618 safariPath: data["safari"] as String, | 601 safariPath: data["safari"] as String, |
619 firefoxPath: data["firefox"] as String, | 602 firefoxPath: data["firefox"] as String, |
620 dartPath: data["dart"] as String, | 603 dartPath: data["dart"] as String, |
621 dartPrecompiledPath: data["dart_precompiled"] as String, | 604 dartPrecompiledPath: data["dart_precompiled"] as String, |
622 flutterPath: data["flutter"] as String, | 605 flutterPath: data["flutter"] as String, |
623 taskCount: data["tasks"] as int, | 606 taskCount: data["tasks"] as int, |
624 timeout: data["timeout"] as int, | 607 timeout: data["timeout"] as int, |
625 shardCount: data["shards"] as int, | 608 shardCount: data["shards"] as int, |
626 shard: data["shard"] as int, | 609 shard: data["shard"] as int, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 if (name == option.name) return option; | 752 if (name == option.name) return option; |
770 | 753 |
771 // Allow hyphens instead of underscores as the separator since they are | 754 // Allow hyphens instead of underscores as the separator since they are |
772 // more common for command line flags. | 755 // more common for command line flags. |
773 if (name == option.name.replaceAll("_", "-")) return option; | 756 if (name == option.name.replaceAll("_", "-")) return option; |
774 } | 757 } |
775 | 758 |
776 return null; | 759 return null; |
777 } | 760 } |
778 } | 761 } |
OLD | NEW |