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

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

Issue 11299206: Call dart2js directly from sdk/bin. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed build changes Created 8 years, 1 month 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 | « dart/tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/test_suite.dart
diff --git a/dart/tools/testing/dart/test_suite.dart b/dart/tools/testing/dart/test_suite.dart
index ba8fb62d33dd567675ca76cab6418fa295bb4cdb..63cc23cb77ee8768accfccf59a04a7c68f6dabbe 100644
--- a/dart/tools/testing/dart/test_suite.dart
+++ b/dart/tools/testing/dart/test_suite.dart
@@ -115,26 +115,33 @@ abstract class TestSuite {
if (configuration['compiler'] == 'none') {
return null; // No separate compiler for dartium tests.
}
- var name = '$buildDir/${compilerName}';
- if (!(new File(name)).existsSync() && !configuration['list']) {
- throw "Executable '$name' does not exist";
- }
- return name;
- }
-
- /**
- * The name of the compiler for this suite's configuration. Throws an error
- * if the configuration does not use a compiler.
- */
- String get compilerName {
+ var name;
switch (configuration['compiler']) {
case 'dartc':
+ name = '$buildDir/$executableName';
case 'dart2js':
case 'dart2dart':
- return executableName;
+ var prefix = 'sdk/bin/';
+ String suffix = getExecutableSuffix(configuration['compiler']);
+ if (configuration['host_checked']) {
+ // The script dart2js_developer is not included in the
+ // shipped SDK, that is the script is not installed in
+ // "$buildDir/dart-sdk/bin/"
+ name = '$prefix/dart2js_developer$suffix';
+ } else {
+ if (configuration['use_sdk']) {
+ prefix = '$buildDir/dart-sdk/bin/';
+ }
+ name = '${prefix}dart2js$suffix';
+ }
+ break;
default:
throw "Unknown compiler for: ${configuration['compiler']}";
}
+ if (!(new File(name)).existsSync() && !configuration['list']) {
+ throw "Executable '$name' does not exist";
+ }
+ return name;
}
/**
@@ -147,19 +154,6 @@ abstract class TestSuite {
return 'dart$suffix';
case 'dartc':
return 'analyzer/bin/dart_analyzer$suffix';
- case 'dart2js':
- case 'dart2dart':
- var prefix = '';
- if (configuration['use_sdk']) {
- prefix = 'dart-sdk/bin/';
- }
- if (configuration['host_checked']) {
- // The script dart2js_developer is not in the SDK.
- return 'dart2js_developer$suffix';
- } else {
- return '${prefix}dart2js$suffix';
- }
- break;
default:
throw "Unknown executable for: ${configuration['compiler']}";
}
@@ -695,7 +689,7 @@ class StandardTestSuite extends TestSuite {
args = new List.from(args);
String tempDir = createOutputDirectory(info.filePath, '');
args.add('--out=$tempDir/out.js');
- List<Command> commands = <Command>[new Command(dartShellFileName, args)];
+ List<Command> commands = <Command>[new Command(compilerPath, args)];
if (info.hasCompileError) {
// Do not attempt to run the compiled result. A compilation
// error should be reported by the compilation command.
@@ -712,7 +706,7 @@ class StandardTestSuite extends TestSuite {
String tempDir = createOutputDirectory(info.filePath, '');
compilerArguments.add('--out=$tempDir/out.dart');
List<Command> commands =
- <Command>[new Command(dartShellFileName, compilerArguments)];
+ <Command>[new Command(compilerPath, compilerArguments)];
if (info.hasCompileError) {
// Do not attempt to run the compiled result. A compilation
// error should be reported by the compilation command.
@@ -1614,9 +1608,13 @@ class TestUtils {
} else if (system == 'windows') {
outputDir = 'build/';
}
+ return "$outputDir${configurationDir(configuration)}";
+ }
+
+ static String configurationDir(Map configuration) {
var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release';
var arch = configuration['arch'].toUpperCase();
- return "$outputDir$mode$arch";
+ return '$mode$arch';
}
}
« no previous file with comments | « dart/tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698