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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2061 compiler == 'dartanalyzer' || compiler == 'dart2analyzer'; 2061 compiler == 'dartanalyzer' || compiler == 'dart2analyzer';
2062 2062
2063 static String buildDir(Map configuration) { 2063 static String buildDir(Map configuration) {
2064 // FIXME(kustermann,ricow): Our code assumes that the returned 'buildDir' 2064 // FIXME(kustermann,ricow): Our code assumes that the returned 'buildDir'
2065 // is relative to the current working directory. 2065 // is relative to the current working directory.
2066 // Thus, if we pass in an absolute path (e.g. '--build-directory=/tmp/out') 2066 // Thus, if we pass in an absolute path (e.g. '--build-directory=/tmp/out')
2067 // we get into trouble. 2067 // we get into trouble.
2068 if (configuration['build_directory'] != '') { 2068 if (configuration['build_directory'] != '') {
2069 return configuration['build_directory']; 2069 return configuration['build_directory'];
2070 } 2070 }
2071 var outputDir = ''; 2071
2072 var system = configuration['system']; 2072 return "${outputDir(configuration)}${configurationDir(configuration)}";
2073 if (system == 'linux') { 2073 }
2074 outputDir = 'out/'; 2074
2075 } else if (system == 'macos') { 2075 static getValidOutputDir(Map configuration, String mode, String arch) {
2076 outputDir = 'xcodebuild/'; 2076 // We allow our code to have been cross compiled, i.e., that there
2077 } else if (system == 'windows') { 2077 // is an X in front of the arch. We don't allow both a cross compiled
2078 outputDir = 'build/'; 2078 // and a normal version to be present (except if you specifically pass
2079 // in the build_directory).
2080 var normal = '$mode$arch';
2081 var cross = '${mode}X$arch';
2082 var outDir = outputDir(configuration);
2083 var normalDir = new Directory(new Path('$outDir$normal').toNativePath());
2084 var crossDir = new Directory(new Path('$outDir$cross').toNativePath());
2085 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
2086 throw "You can't have both $normalDir and $crossDir, we don't know which"
2087 " binary to use";
2079 } 2088 }
2080 return "$outputDir${configurationDir(configuration)}"; 2089 if (crossDir.existsSync()) {
2090 return cross;
2091 }
2092 return normal;
2081 } 2093 }
2082 2094
2083 static String configurationDir(Map configuration) { 2095 static String configurationDir(Map configuration) {
2084 // For regular dart checkouts, the configDir by default is mode+arch. 2096 // For regular dart checkouts, the configDir by default is mode+arch.
2085 // For Dartium, the configDir by default is mode (as defined by the Chrome 2097 // For Dartium, the configDir by default is mode (as defined by the Chrome
2086 // build setup). We can detect this because in the dartium checkout, the 2098 // build setup). We can detect this because in the dartium checkout, the
2087 // "output" directory is a sibling of the dart directory instead of a child. 2099 // "output" directory is a sibling of the dart directory instead of a child.
2088 var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; 2100 var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release';
2089 var arch = configuration['arch'].toUpperCase(); 2101 var arch = configuration['arch'].toUpperCase();
2090 if (currentWorkingDirectory != dartDir()) { 2102 if (currentWorkingDirectory != dartDir()) {
2091 return '$mode$arch'; 2103 return getValidOutputDir(configuration, mode, arch);
2092 } else { 2104 } else {
2093 return mode; 2105 return mode;
2094 } 2106 }
2095 } 2107 }
2096 2108
2097 /** 2109 /**
2098 * Returns the path to the dart binary checked into the repo, used for 2110 * Returns the path to the dart binary checked into the repo, used for
2099 * bootstrapping test.dart. 2111 * bootstrapping test.dart.
2100 */ 2112 */
2101 static Path get dartTestExecutable { 2113 static Path get dartTestExecutable {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2182 * $pass tests are expected to pass 2194 * $pass tests are expected to pass
2183 * $failOk tests are expected to fail that we won't fix 2195 * $failOk tests are expected to fail that we won't fix
2184 * $fail tests are expected to fail that we should fix 2196 * $fail tests are expected to fail that we should fix
2185 * $crash tests are expected to crash that we should fix 2197 * $crash tests are expected to crash that we should fix
2186 * $timeout tests are allowed to timeout 2198 * $timeout tests are allowed to timeout
2187 * $compileErrorSkip tests are skipped on browsers due to compile-time error 2199 * $compileErrorSkip tests are skipped on browsers due to compile-time error
2188 """; 2200 """;
2189 print(report); 2201 print(report);
2190 } 2202 }
2191 } 2203 }
OLDNEW
« 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