Chromium Code Reviews| 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..be54f57e19434646565c89bfa82d5a30f7104dad 100644 |
| --- a/dart/tools/testing/dart/test_suite.dart |
| +++ b/dart/tools/testing/dart/test_suite.dart |
| @@ -115,26 +115,31 @@ 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 in the SDK. |
|
ricow1
2012/11/27 18:28:35
this comment is slightly confusing, above we set p
ahe
2012/11/28 11:53:25
Done.
|
| + 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 +152,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 +687,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 +704,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 +1606,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'; |
| } |
| } |