Chromium Code Reviews| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 String get dartVmBinaryFileName { | 200 String get dartVmBinaryFileName { |
| 201 // Controlled by user with the option "--dart". | 201 // Controlled by user with the option "--dart". |
| 202 String dartExecutable = configuration['dart']; | 202 String dartExecutable = configuration['dart']; |
| 203 | 203 |
| 204 if (dartExecutable == '') { | 204 if (dartExecutable == '') { |
| 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 | |
|
Ivan Posva
2015/02/05 14:46:20
?
ricow1
2015/02/05 15:08:34
removed
| |
| 211 TestUtils.ensureExists(dartExecutable, configuration); | 210 TestUtils.ensureExists(dartExecutable, configuration); |
| 212 return dartExecutable; | 211 return dartExecutable; |
| 213 } | 212 } |
| 214 | 213 |
| 215 String get d8FileName { | 214 String get d8FileName { |
| 216 var suffix = getExecutableSuffix('d8'); | 215 var suffix = getExecutableSuffix('d8'); |
| 217 var d8Dir = TestUtils.dartDir.append('third_party/d8'); | 216 var d8Dir = TestUtils.dartDir.append('third_party/d8'); |
| 218 var d8Path = d8Dir.append('${Platform.operatingSystem}/d8$suffix'); | 217 var d8Path = d8Dir.append('${Platform.operatingSystem}/d8$suffix'); |
| 219 var d8 = d8Path.toNativePath(); | 218 var d8 = d8Path.toNativePath(); |
| 220 TestUtils.ensureExists(d8, configuration); | 219 TestUtils.ensureExists(d8, configuration); |
| (...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1544 configuration["compiler"] == "dart2analyzer") && | 1543 configuration["compiler"] == "dart2analyzer") && |
| 1545 (filePath.filename.contains("dart2js") || | 1544 (filePath.filename.contains("dart2js") || |
| 1546 filePath.directoryPath.segments().last.contains('html_common'))) { | 1545 filePath.directoryPath.segments().last.contains('html_common'))) { |
| 1547 args.add("--use-dart2js-libraries"); | 1546 args.add("--use-dart2js-libraries"); |
| 1548 } | 1547 } |
| 1549 | 1548 |
| 1550 bool isMultitest = optionsFromFile["isMultitest"]; | 1549 bool isMultitest = optionsFromFile["isMultitest"]; |
| 1551 List<String> dartOptions = optionsFromFile["dartOptions"]; | 1550 List<String> dartOptions = optionsFromFile["dartOptions"]; |
| 1552 | 1551 |
| 1553 assert(!isMultitest || dartOptions == null); | 1552 assert(!isMultitest || dartOptions == null); |
| 1554 if (dartOptions == null) { | 1553 args.add(filePath.toNativePath()); |
| 1555 args.add(filePath.toNativePath()); | 1554 if (dartOptions != null) { |
| 1556 } else { | |
| 1557 var executable_name = dartOptions[0]; | |
| 1558 // TODO(ager): Get rid of this hack when the runtime checkout goes away. | |
| 1559 var file = new File(executable_name); | |
| 1560 if (!file.existsSync()) { | |
| 1561 executable_name = '../$executable_name'; | |
| 1562 assert(new File(executable_name).existsSync()); | |
| 1563 dartOptions[0] = executable_name; | |
| 1564 } | |
| 1565 args.addAll(dartOptions); | 1555 args.addAll(dartOptions); |
| 1566 } | 1556 } |
| 1567 | 1557 |
| 1568 return args; | 1558 return args; |
| 1569 } | 1559 } |
| 1570 | 1560 |
| 1571 String packageRoot(String packageRootFromFile) { | 1561 String packageRoot(String packageRootFromFile) { |
| 1572 if (packageRootFromFile == "none") { | 1562 if (packageRootFromFile == "none") { |
| 1573 return null; | 1563 return null; |
| 1574 } | 1564 } |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2397 for (var key in PATH_REPLACEMENTS.keys) { | 2387 for (var key in PATH_REPLACEMENTS.keys) { |
| 2398 if (path.startsWith(key)) { | 2388 if (path.startsWith(key)) { |
| 2399 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2389 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
| 2400 break; | 2390 break; |
| 2401 } | 2391 } |
| 2402 } | 2392 } |
| 2403 } | 2393 } |
| 2404 return path; | 2394 return path; |
| 2405 } | 2395 } |
| 2406 } | 2396 } |
| OLD | NEW |