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 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2380 throw "You can't have both $normalDir and $crossDir, we don't know which" | 2380 throw "You can't have both $normalDir and $crossDir, we don't know which" |
2381 " binary to use"; | 2381 " binary to use"; |
2382 } | 2382 } |
2383 if (crossDir.existsSync()) { | 2383 if (crossDir.existsSync()) { |
2384 return cross; | 2384 return cross; |
2385 } | 2385 } |
2386 return normal; | 2386 return normal; |
2387 } | 2387 } |
2388 | 2388 |
2389 /** | 2389 /** |
2390 * Returns the path to the dart binary checked into the repo, used for | |
2391 * bootstrapping test.dart. | |
2392 */ | |
2393 static Path get dartTestExecutable { | |
2394 var path = '$dartDir/tools/testing/bin/' | |
2395 '${Platform.operatingSystem}/dart'; | |
2396 if (Platform.operatingSystem == 'windows') { | |
2397 path = '$path.exe'; | |
2398 } | |
2399 return new Path(path); | |
2400 } | |
2401 | |
2402 /** | |
2403 * Gets extra options under [key] passed to the testing script. | 2390 * Gets extra options under [key] passed to the testing script. |
2404 */ | 2391 */ |
2405 static List<String> getExtraOptions(Map configuration, String key) { | 2392 static List<String> getExtraOptions(Map configuration, String key) { |
2406 if (configuration[key] == null) return <String>[]; | 2393 if (configuration[key] == null) return <String>[]; |
2407 return configuration[key] | 2394 return configuration[key] |
2408 .split(" ") | 2395 .split(" ") |
2409 .map((s) => s.trim()) | 2396 .map((s) => s.trim()) |
2410 .where((s) => s.isNotEmpty) | 2397 .where((s) => s.isNotEmpty) |
2411 .toList(); | 2398 .toList(); |
2412 } | 2399 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 for (var key in PATH_REPLACEMENTS.keys) { | 2474 for (var key in PATH_REPLACEMENTS.keys) { |
2488 if (path.startsWith(key)) { | 2475 if (path.startsWith(key)) { |
2489 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2476 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
2490 break; | 2477 break; |
2491 } | 2478 } |
2492 } | 2479 } |
2493 } | 2480 } |
2494 return path; | 2481 return path; |
2495 } | 2482 } |
2496 } | 2483 } |
OLD | NEW |