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 /** | 5 /** |
6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
7 * | 7 * |
8 * This library includes: | 8 * This library includes: |
9 * | 9 * |
10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 String suffix = executableBinarySuffix; | 205 String suffix = executableBinarySuffix; |
206 dartExecutable = useSdk | 206 dartExecutable = useSdk |
207 ? '$buildDir/dart-sdk/bin/dart$suffix' | 207 ? '$buildDir/dart-sdk/bin/dart$suffix' |
208 : '$buildDir/dart$suffix'; | 208 : '$buildDir/dart$suffix'; |
209 } | 209 } |
210 | 210 |
211 TestUtils.ensureExists(dartExecutable, configuration); | 211 TestUtils.ensureExists(dartExecutable, configuration); |
212 return dartExecutable; | 212 return dartExecutable; |
213 } | 213 } |
214 | 214 |
| 215 String get dartPrecompiledBinaryFileName { |
| 216 // Controlled by user with the option "--dart_precompiled". |
| 217 String dartExecutable = configuration['dart_precompiled']; |
| 218 |
| 219 if (dartExecutable == null || dartExecutable == '') { |
| 220 String suffix = executableBinarySuffix; |
| 221 dartExecutable = '$buildDir/dart_precompiled$suffix'; |
| 222 } |
| 223 |
| 224 TestUtils.ensureExists(dartExecutable, configuration); |
| 225 return dartExecutable; |
| 226 } |
| 227 |
215 String get d8FileName { | 228 String get d8FileName { |
216 var suffix = getExecutableSuffix('d8'); | 229 var suffix = getExecutableSuffix('d8'); |
217 var d8Dir = TestUtils.dartDir.append('third_party/d8'); | 230 var d8Dir = TestUtils.dartDir.append('third_party/d8'); |
218 var d8Path = d8Dir.append('${Platform.operatingSystem}/d8$suffix'); | 231 var d8Path = d8Dir.append('${Platform.operatingSystem}/d8$suffix'); |
219 var d8 = d8Path.toNativePath(); | 232 var d8 = d8Path.toNativePath(); |
220 TestUtils.ensureExists(d8, configuration); | 233 TestUtils.ensureExists(d8, configuration); |
221 return d8; | 234 return d8; |
222 } | 235 } |
223 | 236 |
224 String get jsShellFileName { | 237 String get jsShellFileName { |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 | 1016 |
1004 List<Command> makeCommands(TestInformation info, var vmOptions, var args) { | 1017 List<Command> makeCommands(TestInformation info, var vmOptions, var args) { |
1005 List<Command> commands = <Command>[]; | 1018 List<Command> commands = <Command>[]; |
1006 CompilerConfiguration compilerConfiguration = | 1019 CompilerConfiguration compilerConfiguration = |
1007 new CompilerConfiguration(configuration); | 1020 new CompilerConfiguration(configuration); |
1008 List<String> sharedOptions = info.optionsFromFile['sharedOptions']; | 1021 List<String> sharedOptions = info.optionsFromFile['sharedOptions']; |
1009 | 1022 |
1010 List<String> compileTimeArguments = <String>[]; | 1023 List<String> compileTimeArguments = <String>[]; |
1011 String tempDir; | 1024 String tempDir; |
1012 if (compilerConfiguration.hasCompiler) { | 1025 if (compilerConfiguration.hasCompiler) { |
1013 compileTimeArguments | 1026 compileTimeArguments = |
1014 ..addAll(sharedOptions) | 1027 compilerConfiguration.computeCompilerArguments(vmOptions, |
1015 ..addAll(args); | 1028 sharedOptions, |
| 1029 args); |
1016 // Avoid doing this for analyzer. | 1030 // Avoid doing this for analyzer. |
1017 tempDir = createCompilationOutputDirectory(info.filePath); | 1031 tempDir = createCompilationOutputDirectory(info.filePath); |
1018 } | 1032 } |
1019 | 1033 |
1020 CommandArtifact compilationArtifact = | 1034 CommandArtifact compilationArtifact = |
1021 compilerConfiguration.computeCompilationArtifact( | 1035 compilerConfiguration.computeCompilationArtifact( |
1022 buildDir, | 1036 buildDir, |
1023 tempDir, | 1037 tempDir, |
1024 CommandBuilder.instance, | 1038 CommandBuilder.instance, |
1025 compileTimeArguments, | 1039 compileTimeArguments, |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1768 "hasStaticWarning" : false, | 1782 "hasStaticWarning" : false, |
1769 "otherScripts": otherScripts, | 1783 "otherScripts": otherScripts, |
1770 "isMultitest": isMultitest, | 1784 "isMultitest": isMultitest, |
1771 "isMultiHtmlTest": isMultiHtmlTest, | 1785 "isMultiHtmlTest": isMultiHtmlTest, |
1772 "subtestNames": subtestNames, | 1786 "subtestNames": subtestNames, |
1773 "isolateStubs": isolateStubs, | 1787 "isolateStubs": isolateStubs, |
1774 "containsDomImport": containsDomImport }; | 1788 "containsDomImport": containsDomImport }; |
1775 } | 1789 } |
1776 | 1790 |
1777 List<List<String>> getVmOptions(Map optionsFromFile) { | 1791 List<List<String>> getVmOptions(Map optionsFromFile) { |
1778 var COMPILERS = const ['none']; | 1792 var COMPILERS = const ['none', 'precompiler']; |
1779 var RUNTIMES = const ['none', 'vm', 'drt', 'dartium', | 1793 var RUNTIMES = const ['none', 'dart_precompiled', 'vm', 'drt', 'dartium', |
1780 'ContentShellOnAndroid', 'DartiumOnAndroid']; | 1794 'ContentShellOnAndroid', 'DartiumOnAndroid']; |
1781 var needsVmOptions = COMPILERS.contains(configuration['compiler']) && | 1795 var needsVmOptions = COMPILERS.contains(configuration['compiler']) && |
1782 RUNTIMES.contains(configuration['runtime']); | 1796 RUNTIMES.contains(configuration['runtime']); |
1783 if (!needsVmOptions) return [[]]; | 1797 if (!needsVmOptions) return [[]]; |
1784 final vmOptions = optionsFromFile['vmOptions']; | 1798 final vmOptions = optionsFromFile['vmOptions']; |
1785 return vmOptions; | 1799 return vmOptions; |
1786 } | 1800 } |
1787 | 1801 |
1788 /** | 1802 /** |
1789 * Read options from a co19 test file. | 1803 * Read options from a co19 test file. |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 for (var key in PATH_REPLACEMENTS.keys) { | 2434 for (var key in PATH_REPLACEMENTS.keys) { |
2421 if (path.startsWith(key)) { | 2435 if (path.startsWith(key)) { |
2422 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2436 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
2423 break; | 2437 break; |
2424 } | 2438 } |
2425 } | 2439 } |
2426 } | 2440 } |
2427 return path; | 2441 return path; |
2428 } | 2442 } |
2429 } | 2443 } |
OLD | NEW |