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 c9f2d7bd818766775ffa7adf995169a21f215e11..30300548259a256111df0b858e1d126e59843a6a 100644 |
| --- a/dart/tools/testing/dart/test_suite.dart |
| +++ b/dart/tools/testing/dart/test_suite.dart |
| @@ -425,7 +425,7 @@ class StandardTestSuite implements TestSuite { |
| for (var args in argumentLists) { |
| doTest(new TestCase('$suiteName/$testName', |
| - [new Command(shellPath(), args)], |
| + makeCommands(info, args), |
| configuration, |
| completeHandler, |
| expectations, |
| @@ -434,6 +434,24 @@ class StandardTestSuite implements TestSuite { |
| } |
| } |
| + List<Command> makeCommands(TestInformation info, var args) { |
| + if (configuration['compiler'] == 'dart2js') { |
| + args = new List.from(args); |
| + String testPath = info.filename.replaceAll('\\', '/'); |
| + Directory tempDir = createOutputDirectory(testPath, ''); |
| + args.add('--out=${tempDir.path}/out.js'); |
| + List<Command> commands = <Command>[new Command(shellPath(), args)]; |
| + if (configuration['runtime'] == 'd8') { |
| + var d8 = '${TestUtils.buildDir(configuration)}/' |
|
Bill Hesse
2012/04/25 12:46:26
I'd like to see the constructor of the d8 path in
ahe
2012/04/25 13:49:41
Done.
|
| + 'd8${TestUtils.executableSuffix("d8")}'; |
|
kasperl
2012/04/25 12:23:47
Maybe TestUtils.executableSuffix("d8") into a loca
ahe
2012/04/25 13:49:41
Done.
|
| + commands.add(new Command(d8, ['${tempDir.path}/out.js'])); |
| + } |
| + return commands; |
| + } else { |
| + return <Command>[new Command(shellPath(), args)]; |
| + } |
| + } |
| + |
| Function makeTestCaseCreator(Map optionsFromFile) { |
| return (String filename, |
| bool isNegative, |
| @@ -700,10 +718,12 @@ class StandardTestSuite implements TestSuite { |
| String testUniqueName = |
| testPath.substring(dartDir.length + 1, testPath.length - 5); |
| testUniqueName = testUniqueName.replaceAll('/', '_'); |
| - testUniqueName += '-$optionsName'; |
| + if (!optionsName.isEmpty()) { |
| + testUniqueName += '-$optionsName'; |
|
Bill Hesse
2012/04/25 12:46:26
Thanks. I wrote this, and it was ugly seeing the
|
| + } |
| // Create '[build dir]/generated_tests/$compiler-$runtime/$testUniqueName', |
| - // including any intermediate directories that don't exist. |
| + // including any intermediate directories that don't exist. |
| var generatedTestPath = ['generated_tests', |
| configuration['compiler'] + '-' + |
| configuration['runtime'], |
| @@ -827,8 +847,7 @@ class StandardTestSuite implements TestSuite { |
| args.add('--error_format'); |
| args.add('machine'); |
| } |
| - if ((configuration['compiler'] == 'frog' |
| - || configuration['compiler'] == 'dart2js') |
| + if ((configuration['compiler'] == 'frog') |
| && (configuration['runtime'] == 'none')) { |
| args.add('--compile-only'); |
| } |
| @@ -836,6 +855,9 @@ class StandardTestSuite implements TestSuite { |
| bool isMultitest = optionsFromFile["isMultitest"]; |
| List<String> dartOptions = optionsFromFile["dartOptions"]; |
| List<List<String>> vmOptionsList = optionsFromFile["vmOptions"]; |
| + if (configuration['compiler'] == 'dart2js') { |
| + vmOptionsList = [[]]; |
| + } |
| Expect.isTrue(!isMultitest || dartOptions == null); |
| if (dartOptions == null) { |
| args.add(filename); |
| @@ -1240,8 +1262,13 @@ class TestUtils { |
| return 'dart$suffix'; |
| case 'dartc': |
| return 'compiler/bin/dartc$suffix'; |
| - case 'frog': |
| case 'dart2js': |
| + if (configuration['host_checked']) { |
| + return 'dart2js_developer$suffix'; |
| + } else { |
| + return 'dart2js$suffix'; |
| + } |
| + case 'frog': |
| return 'frog/bin/frog$suffix'; |
| default: |
| throw "Unknown executable for: ${configuration['compiler']}"; |
| @@ -1253,8 +1280,13 @@ class TestUtils { |
| switch (configuration['compiler']) { |
| case 'dartc': |
| return 'compiler/bin/dartc$suffix'; |
| - case 'frog': |
| case 'dart2js': |
| + if (configuration['host_checked']) { |
| + return 'dart2js_developer$suffix'; |
| + } else { |
| + return 'dart2js$suffix'; |
| + } |
| + case 'frog': |
| return 'frog/bin/frog$suffix'; |
| default: |
| throw "Unknown compiler for: ${configuration['compiler']}"; |
| @@ -1317,11 +1349,8 @@ class TestUtils { |
| args.add("--enable_type_checks"); |
| } |
| if (configuration["compiler"] == "dart2js") { |
| + args = []; |
| args.add("--verbose"); |
| - args.add("--leg"); |
| - if (configuration["host_checked"]) { |
| - args.add("--vm_flags=--enable_asserts --enable_type_checks"); |
| - } |
| if (!isBrowserRuntime(configuration['runtime'])) { |
| args.add("--allow-mock-compilation"); |
| } |