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

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

Issue 900443004: Fix bad code in test_suite.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index bf79c8ecec44b218e64e142bceba95f024e7e86b..3e03fa137f1ef155e48637938fa21916d1a83d77 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -131,9 +131,11 @@ abstract class TestSuite {
Map<String, String> _environmentOverrides;
TestSuite(this.configuration, this.suiteName) {
- _environmentOverrides = {
+ if (configuration['build_directory'] == '') {
+ _environmentOverrides = {
'DART_CONFIGURATION' : TestUtils.configurationDir(configuration)
- };
+ };
+ }
}
Map<String, String> get environmentOverrides => _environmentOverrides;
@@ -2265,11 +2267,22 @@ class TestUtils {
return "${outputDir(configuration)}${configurationDir(configuration)}";
}
- static getValidOutputDir(Map configuration, String mode, String arch) {
+ static String configurationDir(Map configuration) {
+ // This returns the correct configuration directory (the last component
+ // of the output directory path) for regular dart checkouts.
+ // Do not call this function if the --build-directory option is used.
+ // Dartium checkouts use the --build-directory option to pass in the
+ // correct build directory explicitly.
// 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).
+ if (configuration['build_directory'] != '') {
+ throw "Internal test.dart error: Don't call TestUtils.configurationDir "
+ "if the --build-directory option is used.";
+ }
+ var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release';
+ var arch = configuration['arch'].toUpperCase();
var normal = '$mode$arch';
var cross = '${mode}X$arch';
var outDir = outputDir(configuration);
@@ -2285,20 +2298,6 @@ class TestUtils {
return normal;
}
- static String configurationDir(Map configuration) {
- // For regular dart checkouts, the configDir by default is mode+arch.
- // For Dartium, the configDir by default is mode (as defined by the Chrome
- // build setup). We can detect this because in the dartium checkout, the
- // "output" directory is a sibling of the dart directory instead of a child.
- var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release';
- var arch = configuration['arch'].toUpperCase();
- if (currentWorkingDirectory != dartDir) {
- return getValidOutputDir(configuration, mode, arch);
- } else {
- return mode;
- }
- }
-
/**
* Returns the path to the dart binary checked into the repo, used for
* bootstrapping test.dart.
« 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