Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index 812206a60678e042b699bfb5a68b630045a03117..b573c6140930567071d326b04c9ef62d9552504e 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -776,7 +776,7 @@ class StandardTestSuite extends TestSuite { |
| switch (compiler) { |
| case 'dart2js': |
| args = new List.from(args); |
| - String tempDir = createOutputDirectory(info.filePath, ''); |
| + String tempDir = createCompilationOutputDirectory(info.filePath); |
| args.add('--out=$tempDir/out.js'); |
| var command = CommandBuilder.instance.getCompilationCommand( |
| @@ -795,11 +795,10 @@ class StandardTestSuite extends TestSuite { |
| "jsshell", jsShellFileName, ['$tempDir/out.js'], configurationDir)); |
| } |
| return commands; |
| - |
| case 'dart2dart': |
| args = new List.from(args); |
| args.add('--output-type=dart'); |
| - String tempDir = createOutputDirectory(info.filePath, ''); |
| + String tempDir = createCompilationOutputDirectory(info.filePath); |
| args.add('--out=$tempDir/out.dart'); |
| List<Command> commands = |
| @@ -961,11 +960,14 @@ class StandardTestSuite extends TestSuite { |
| .replaceAll('=','') |
| .replaceAll('/',''); |
| } |
| + final String compilationTempDir = |
| + createCompilationOutputDirectory(info.filePath); |
| final String tempDir = createOutputDirectory(info.filePath, optionsName); |
| String dartWrapperFilename = '$tempDir/test.dart'; |
| - String compiledDartWrapperFilename = '$tempDir/test.js'; |
| - String precompiledDartWrapperFilename = '$tempDir/test.precompiled.js'; |
| + String compiledDartWrapperFilename = '$compilationTempDir/test.js'; |
| + String precompiledDartWrapperFilename = |
| + '$compilationTempDir/test.precompiled.js'; |
| String content = null; |
| Path dir = filePath.directoryPath; |
| @@ -1234,6 +1236,27 @@ class StandardTestSuite extends TestSuite { |
| .replaceAll('\\', '/'); |
| } |
| + String createCompilationOutputDirectory(Path testPath) { |
| + Path relative = testPath.relativeTo(TestUtils.dartDir()); |
|
ricow1
2013/10/15 11:03:24
how about extracting these 3 lines into a method a
kustermann
2013/10/15 11:50:23
Done.
|
| + relative = relative.directoryPath.append(relative.filenameWithoutExtension); |
| + String testUniqueName = relative.toString().replaceAll('/', '_'); |
| + |
| + // Create |
| + // '[build dir]/generated_compilations/$compiler-$flags/$testUniqueName', |
| + // including any intermediate directories that don't exist. |
| + var checked = configuration['checked'] ? '-checked' : ''; |
| + var minified = configuration['minified'] ? '-minified' : ''; |
| + var dirName = "${configuration['compiler']}$checked$minified"; |
| + Path generatedTestPath = new Path(buildDir) |
| + .append('generated_compilations') |
| + .append(dirName) |
| + .append(testUniqueName); |
| + |
| + TestUtils.mkdirRecursive(new Path('.'), generatedTestPath); |
| + return new File(generatedTestPath.toNativePath()).fullPathSync() |
| + .replaceAll('\\', '/'); |
| + } |
| + |
| String get scriptType { |
| switch (configuration['compiler']) { |
| case 'none': |