Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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:async'; | 5 import 'dart:async'; |
| 6 import 'dart:convert'; | 6 import 'dart:convert'; |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'compiler_configuration.dart'; | 9 import 'compiler_configuration.dart'; |
| 10 import 'http_server.dart'; | 10 import 'http_server.dart'; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 this.resetBrowser, | 45 this.resetBrowser, |
| 46 this.skipCompilation, | 46 this.skipCompilation, |
| 47 this.useBlobs, | 47 this.useBlobs, |
| 48 this.useSdk, | 48 this.useSdk, |
| 49 this.useFastStartup, | 49 this.useFastStartup, |
| 50 this.useEnableAsserts, | 50 this.useEnableAsserts, |
| 51 this.useDart2JSWithKernel, | 51 this.useDart2JSWithKernel, |
| 52 this.useDart2JSWithKernelInSsa, | 52 this.useDart2JSWithKernelInSsa, |
| 53 this.writeDebugLog, | 53 this.writeDebugLog, |
| 54 this.writeTestOutcomeLog, | 54 this.writeTestOutcomeLog, |
| 55 this.writeResultJsonLog, | |
|
Bill Hesse
2017/09/01 11:56:13
Just writeResultLog, I think.
mkroghj
2017/09/04 10:43:34
Done.
| |
| 55 this.drtPath, | 56 this.drtPath, |
| 56 this.chromePath, | 57 this.chromePath, |
| 57 this.safariPath, | 58 this.safariPath, |
| 58 this.firefoxPath, | 59 this.firefoxPath, |
| 59 this.dartPath, | 60 this.dartPath, |
| 60 this.dartPrecompiledPath, | 61 this.dartPrecompiledPath, |
| 61 this.flutterPath, | 62 this.flutterPath, |
| 62 this.taskCount, | 63 this.taskCount, |
| 63 int timeout, | 64 int timeout, |
| 64 this.shardCount, | 65 this.shardCount, |
| 65 this.shard, | 66 this.shard, |
| 66 this.stepName, | 67 this.stepName, |
| 67 this.testServerPort, | 68 this.testServerPort, |
| 68 this.testServerCrossOriginPort, | 69 this.testServerCrossOriginPort, |
| 69 this.testDriverErrorPort, | 70 this.testDriverErrorPort, |
| 70 this.localIP, | 71 this.localIP, |
| 71 this.dart2jsOptions, | 72 this.dart2jsOptions, |
| 72 this.vmOptions, | 73 this.vmOptions, |
| 73 String packages, | 74 String packages, |
| 74 this.packageRoot, | 75 this.packageRoot, |
| 75 this.suiteDirectory, | 76 this.suiteDirectory, |
| 76 this.builderTag, | 77 this.builderTag, |
| 78 this.debugOutputDirectory, | |
|
Bill Hesse
2017/09/01 11:56:13
I wouldn't call it debugOutput, just output.
mkroghj
2017/09/04 10:43:34
Done.
| |
| 77 this.reproducingArguments}) | 79 this.reproducingArguments}) |
| 78 : _packages = packages, | 80 : _packages = packages, |
| 79 _timeout = timeout; | 81 _timeout = timeout; |
| 80 | 82 |
| 81 final Architecture architecture; | 83 final Architecture architecture; |
| 82 final Compiler compiler; | 84 final Compiler compiler; |
| 83 final Mode mode; | 85 final Mode mode; |
| 84 final Progress progress; | 86 final Progress progress; |
| 85 final Runtime runtime; | 87 final Runtime runtime; |
| 86 final System system; | 88 final System system; |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 108 final bool resetBrowser; | 110 final bool resetBrowser; |
| 109 final bool skipCompilation; | 111 final bool skipCompilation; |
| 110 final bool useBlobs; | 112 final bool useBlobs; |
| 111 final bool useSdk; | 113 final bool useSdk; |
| 112 final bool useFastStartup; | 114 final bool useFastStartup; |
| 113 final bool useEnableAsserts; | 115 final bool useEnableAsserts; |
| 114 final bool useDart2JSWithKernel; | 116 final bool useDart2JSWithKernel; |
| 115 final bool useDart2JSWithKernelInSsa; | 117 final bool useDart2JSWithKernelInSsa; |
| 116 final bool writeDebugLog; | 118 final bool writeDebugLog; |
| 117 final bool writeTestOutcomeLog; | 119 final bool writeTestOutcomeLog; |
| 120 final bool writeResultJsonLog; | |
| 118 | 121 |
| 119 // Various file paths. | 122 // Various file paths. |
| 120 | 123 |
| 121 final String drtPath; | 124 final String drtPath; |
| 122 final String chromePath; | 125 final String chromePath; |
| 123 final String safariPath; | 126 final String safariPath; |
| 124 final String firefoxPath; | 127 final String firefoxPath; |
| 125 final String dartPath; | 128 final String dartPath; |
| 126 final String dartPrecompiledPath; | 129 final String dartPrecompiledPath; |
| 127 final String flutterPath; | 130 final String flutterPath; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 145 String _packages; | 148 String _packages; |
| 146 String get packages { | 149 String get packages { |
| 147 // If the .packages file path wasn't given, find it. | 150 // If the .packages file path wasn't given, find it. |
| 148 if (packageRoot == null && _packages == null) { | 151 if (packageRoot == null && _packages == null) { |
| 149 _packages = TestUtils.dartDirUri.resolve('.packages').toFilePath(); | 152 _packages = TestUtils.dartDirUri.resolve('.packages').toFilePath(); |
| 150 } | 153 } |
| 151 | 154 |
| 152 return _packages; | 155 return _packages; |
| 153 } | 156 } |
| 154 | 157 |
| 158 final String debugOutputDirectory; | |
| 155 final String packageRoot; | 159 final String packageRoot; |
| 156 final String suiteDirectory; | 160 final String suiteDirectory; |
| 157 final String builderTag; | 161 final String builderTag; |
| 158 final List<String> reproducingArguments; | 162 final List<String> reproducingArguments; |
| 159 | 163 |
| 160 TestingServers _servers; | 164 TestingServers _servers; |
| 161 TestingServers get servers { | 165 TestingServers get servers { |
| 162 if (_servers == null) { | 166 if (_servers == null) { |
| 163 throw new StateError("Servers have not been started yet."); | 167 throw new StateError("Servers have not been started yet."); |
| 164 } | 168 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 | 416 |
| 413 if (normalDir.existsSync() && crossDir.existsSync()) { | 417 if (normalDir.existsSync() && crossDir.existsSync()) { |
| 414 throw "You can't have both $normalDir and $crossDir. We don't know which" | 418 throw "You can't have both $normalDir and $crossDir. We don't know which" |
| 415 " binary to use."; | 419 " binary to use."; |
| 416 } | 420 } |
| 417 | 421 |
| 418 if (crossDir.existsSync()) return cross; | 422 if (crossDir.existsSync()) return cross; |
| 419 | 423 |
| 420 return normal; | 424 return normal; |
| 421 } | 425 } |
| 426 | |
| 427 /// [toSummaryMap] returns a map of configurations important to the running | |
| 428 /// of a test. Flags and properties used for output is not included. | |
|
Bill Hesse
2017/09/01 11:56:13
are not included
mkroghj
2017/09/04 10:43:34
Done.
| |
| 429 /// Boolean flags that are false are not included in the map. The summary map | |
| 430 /// can be used to serialize to json for test-output logging. | |
| 431 Map toSummaryMap() { | |
| 432 return { | |
| 433 'mode': mode.name, | |
| 434 'arch': architecture.name, | |
| 435 'compiler': compiler.name, | |
| 436 'runtime': runtime.name, | |
| 437 'checked': isChecked, | |
| 438 'strong': isStrong, | |
| 439 'host_checked': isHostChecked, | |
| 440 'minified': isMinified, | |
| 441 'csp': isCsp, | |
| 442 'system': system.name, | |
| 443 'vm_options': vmOptions, | |
| 444 'use_sdk': useSdk, | |
| 445 'builder_tag': builderTag, | |
| 446 'fast_startup': useFastStartup, | |
| 447 'timeout': timeout | |
| 448 }; | |
| 449 } | |
| 422 } | 450 } |
| 423 | 451 |
| 424 class Architecture { | 452 class Architecture { |
| 425 static const ia32 = const Architecture._('ia32'); | 453 static const ia32 = const Architecture._('ia32'); |
| 426 static const x64 = const Architecture._('x64'); | 454 static const x64 = const Architecture._('x64'); |
| 427 static const arm = const Architecture._('arm'); | 455 static const arm = const Architecture._('arm'); |
| 428 static const armv6 = const Architecture._('armv6'); | 456 static const armv6 = const Architecture._('armv6'); |
| 429 static const armv5te = const Architecture._('armv5te'); | 457 static const armv5te = const Architecture._('armv5te'); |
| 430 static const arm64 = const Architecture._('arm64'); | 458 static const arm64 = const Architecture._('arm64'); |
| 431 static const simarm = const Architecture._('simarm'); | 459 static const simarm = const Architecture._('simarm'); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 732 | 760 |
| 733 case macos: | 761 case macos: |
| 734 return 'xcodebuild/'; | 762 return 'xcodebuild/'; |
| 735 } | 763 } |
| 736 | 764 |
| 737 throw "unreachable"; | 765 throw "unreachable"; |
| 738 } | 766 } |
| 739 | 767 |
| 740 String toString() => "System($name)"; | 768 String toString() => "System($name)"; |
| 741 } | 769 } |
| OLD | NEW |