Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| =================================================================== |
| --- tools/testing/dart/test_suite.dart (revision 33642) |
| +++ tools/testing/dart/test_suite.dart (working copy) |
| @@ -2068,16 +2068,28 @@ |
| if (configuration['build_directory'] != '') { |
| return configuration['build_directory']; |
| } |
| - var outputDir = ''; |
| - var system = configuration['system']; |
| - if (system == 'linux') { |
| - outputDir = 'out/'; |
| - } else if (system == 'macos') { |
| - outputDir = 'xcodebuild/'; |
| - } else if (system == 'windows') { |
| - outputDir = 'build/'; |
| + |
| + return "${outputDir(configuration)}${configurationDir(configuration)}"; |
| + } |
| + |
| + static getValidOutputDir(Map configuration, String mode, String arch) { |
| + // We allow our code to have been cross compiled, i.e., that there |
| + // is an X in front of the arch. We don't allow both a cross compiled |
| + // and a normal version to be present (except if you specifically pass |
| + // in the build_directory). |
| + var normal = '$mode$arch'; |
| + var cross = '${mode}X$arch'; |
| + var outDir = outputDir(configuration); |
| + var normalDir = new Directory(new Path('$outDir$normal').toNativePath()); |
| + var crossDir = new Directory(new Path('$outDir$cross').toNativePath()); |
| + if (normalDir.existsSync() && crossDir.existsSync()) { |
|
Bill Hesse
2014/03/13 11:59:39
Why not
if normal
if cross
error both
else
ricow1
2014/03/13 12:04:39
That would change the current semantics in the com
|
| + throw "You can't have both $normalDir and $crossDir, we don't know which" |
| + " binary to use"; |
| } |
| - return "$outputDir${configurationDir(configuration)}"; |
| + if (crossDir.existsSync()) { |
| + return cross; |
| + } |
| + return normal; |
| } |
| static String configurationDir(Map configuration) { |
| @@ -2088,7 +2100,7 @@ |
| var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; |
| var arch = configuration['arch'].toUpperCase(); |
| if (currentWorkingDirectory != dartDir()) { |
| - return '$mode$arch'; |
| + return getValidOutputDir(configuration, mode, arch); |
| } else { |
| return mode; |
| } |