Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: tools/testing/dart/test_suite.dart

Issue 196213005: Enable cross compiled outputs in the testing scripts (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698