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 2307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2318 | 2318 |
2319 static String configurationDir(Map configuration) { | 2319 static String configurationDir(Map configuration) { |
2320 // This returns the correct configuration directory (the last component | 2320 // This returns the correct configuration directory (the last component |
2321 // of the output directory path) for regular dart checkouts. | 2321 // of the output directory path) for regular dart checkouts. |
2322 // Dartium checkouts use the --build-directory option to pass in the | 2322 // Dartium checkouts use the --build-directory option to pass in the |
2323 // correct build directory explicitly. | 2323 // correct build directory explicitly. |
2324 // We allow our code to have been cross compiled, i.e., that there | 2324 // We allow our code to have been cross compiled, i.e., that there |
2325 // is an X in front of the arch. We don't allow both a cross compiled | 2325 // is an X in front of the arch. We don't allow both a cross compiled |
2326 // and a normal version to be present (except if you specifically pass | 2326 // and a normal version to be present (except if you specifically pass |
2327 // in the build_directory). | 2327 // in the build_directory). |
2328 var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; | 2328 var mode; |
2329 switch (configuration['mode']) { | |
2330 case 'debug': mode = 'Debug'; | |
Cutch
2016/02/03 17:09:01
newline
Ivan Posva
2016/02/03 22:11:08
Done.
| |
2331 break; | |
2332 case 'release': | |
2333 mode = 'Release'; | |
2334 break; | |
2335 case 'product': | |
2336 mode = 'Product'; | |
2337 break; | |
2338 default: | |
2339 throw 'Unrecognized mode configuration: ${configuration['mode']}'; | |
2340 } | |
2329 var arch = configuration['arch'].toUpperCase(); | 2341 var arch = configuration['arch'].toUpperCase(); |
2330 var normal = '$mode$arch'; | 2342 var normal = '$mode$arch'; |
2331 var cross = '${mode}X$arch'; | 2343 var cross = '${mode}X$arch'; |
2332 var outDir = outputDir(configuration); | 2344 var outDir = outputDir(configuration); |
2333 var normalDir = new Directory(new Path('$outDir$normal').toNativePath()); | 2345 var normalDir = new Directory(new Path('$outDir$normal').toNativePath()); |
2334 var crossDir = new Directory(new Path('$outDir$cross').toNativePath()); | 2346 var crossDir = new Directory(new Path('$outDir$cross').toNativePath()); |
2335 if (normalDir.existsSync() && crossDir.existsSync()) { | 2347 if (normalDir.existsSync() && crossDir.existsSync()) { |
2336 throw "You can't have both $normalDir and $crossDir, we don't know which" | 2348 throw "You can't have both $normalDir and $crossDir, we don't know which" |
2337 " binary to use"; | 2349 " binary to use"; |
2338 } | 2350 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2443 for (var key in PATH_REPLACEMENTS.keys) { | 2455 for (var key in PATH_REPLACEMENTS.keys) { |
2444 if (path.startsWith(key)) { | 2456 if (path.startsWith(key)) { |
2445 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2457 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
2446 break; | 2458 break; |
2447 } | 2459 } |
2448 } | 2460 } |
2449 } | 2461 } |
2450 return path; | 2462 return path; |
2451 } | 2463 } |
2452 } | 2464 } |
OLD | NEW |