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

Side by Side Diff: tools/testing/dart/multitest.dart

Issue 256743009: Cache output of dart2js compilations that went wrong on disk. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library multitest; 5 library multitest;
6 6
7 import "dart:async"; 7 import "dart:async";
8 import "dart:io"; 8 import "dart:io";
9 import "test_suite.dart"; 9 import "test_suite.dart";
10 import "utils.dart"; 10 import "utils.dart";
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // Copy all the relative imports of the multitest. 241 // Copy all the relative imports of the multitest.
242 Set<String> importsToCopy = _findAllRelativeImports(filePath); 242 Set<String> importsToCopy = _findAllRelativeImports(filePath);
243 List<Future> futureCopies = []; 243 List<Future> futureCopies = [];
244 for (String relativeImport in importsToCopy) { 244 for (String relativeImport in importsToCopy) {
245 Path importPath = new Path(relativeImport); 245 Path importPath = new Path(relativeImport);
246 // Make sure the target directory exists. 246 // Make sure the target directory exists.
247 Path importDir = importPath.directoryPath; 247 Path importDir = importPath.directoryPath;
248 if (!importDir.isEmpty) { 248 if (!importDir.isEmpty) {
249 TestUtils.mkdirRecursive(targetDir, importDir); 249 TestUtils.mkdirRecursive(targetDir, importDir);
250 } 250 }
251 Path srcPath = sourceDir.join(importPath);
252 Path targetPath = targetDir.join(importPath);
251 // Copy file. 253 // Copy file.
252 futureCopies.add(TestUtils.copyFile(sourceDir.join(importPath), 254 futureCopies.add(TestUtils.copyIfDifferent(srcPath, targetPath));
253 targetDir.join(importPath)));
254 } 255 }
255 256
256 // Wait until all imports are copied before scheduling test cases. 257 // Wait until all imports are copied before scheduling test cases.
257 return Future.wait(futureCopies).then((_) { 258 return Future.wait(futureCopies).then((_) {
258 String baseFilename = filePath.filenameWithoutExtension; 259 String baseFilename = filePath.filenameWithoutExtension;
259 for (String key in tests.keys) { 260 for (String key in tests.keys) {
260 final Path multitestFilename = 261 final Path multitestFilename =
261 targetDir.append('${baseFilename}_$key.dart'); 262 targetDir.append('${baseFilename}_$key.dart');
262 writeFile(multitestFilename.toNativePath(), tests[key]); 263 writeFile(multitestFilename.toNativePath(), tests[key]);
263 Set<String> outcome = outcomes[key]; 264 Set<String> outcome = outcomes[key];
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // TestSuite.forDirectory. 297 // TestSuite.forDirectory.
297 split.removeLast(); 298 split.removeLast();
298 } 299 }
299 String path = '${generatedTestDir.path}/${split.last}'; 300 String path = '${generatedTestDir.path}/${split.last}';
300 Directory dir = new Directory(path); 301 Directory dir = new Directory(path);
301 if (!dir.existsSync()) { 302 if (!dir.existsSync()) {
302 dir.createSync(); 303 dir.createSync();
303 } 304 }
304 return new Path(new File(path).absolute.path); 305 return new Path(new File(path).absolute.path);
305 } 306 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698