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

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

Issue 26229005: Fixed (currently harmless) bug in test_runner and implemented separate dart2js compilation cache (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « 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: 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':
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698