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

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

Issue 11884029: Upload new Dart binaries and re-enable unit tests for test scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change Futures.wait to Future.wait in two test script files. Created 7 years, 11 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
« no previous file with comments | « tools/testing/dart/http_server.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 Path importDir = importPath.directoryPath; 209 Path importDir = importPath.directoryPath;
210 if (!importDir.isEmpty) { 210 if (!importDir.isEmpty) {
211 TestUtils.mkdirRecursive(targetDir, importDir); 211 TestUtils.mkdirRecursive(targetDir, importDir);
212 } 212 }
213 // Copy file. 213 // Copy file.
214 futureCopies.add(TestUtils.copyFile(sourceDir.join(importPath), 214 futureCopies.add(TestUtils.copyFile(sourceDir.join(importPath),
215 targetDir.join(importPath))); 215 targetDir.join(importPath)));
216 } 216 }
217 217
218 // Wait until all imports are copied before scheduling test cases. 218 // Wait until all imports are copied before scheduling test cases.
219 return Futures.wait(futureCopies).then((_) { 219 return Future.wait(futureCopies).then((_) {
220 String baseFilename = filePath.filenameWithoutExtension; 220 String baseFilename = filePath.filenameWithoutExtension;
221 for (String key in tests.keys) { 221 for (String key in tests.keys) {
222 final Path multitestFilename = 222 final Path multitestFilename =
223 targetDir.append('${baseFilename}_$key.dart'); 223 targetDir.append('${baseFilename}_$key.dart');
224 final File file = new File.fromPath(multitestFilename); 224 final File file = new File.fromPath(multitestFilename);
225 225
226 file.createSync(); 226 file.createSync();
227 RandomAccessFile openedFile = file.openSync(FileMode.WRITE); 227 RandomAccessFile openedFile = file.openSync(FileMode.WRITE);
228 var bytes = tests[key].charCodes; 228 var bytes = tests[key].charCodes;
229 openedFile.writeListSync(bytes, 0, bytes.length); 229 openedFile.writeListSync(bytes, 0, bytes.length);
(...skipping 29 matching lines...) Expand all
259 if (split.last == 'src') { 259 if (split.last == 'src') {
260 // TODO(sigmund): remove this once all tests are migrated to use 260 // TODO(sigmund): remove this once all tests are migrated to use
261 // TestSuite.forDirectory. 261 // TestSuite.forDirectory.
262 split.removeLast(); 262 split.removeLast();
263 } 263 }
264 String path = '${generatedTestDir.path}/${split.last}'; 264 String path = '${generatedTestDir.path}/${split.last}';
265 Directory dir = new Directory(path); 265 Directory dir = new Directory(path);
266 if (!dir.existsSync()) { 266 if (!dir.existsSync()) {
267 dir.createSync(); 267 dir.createSync();
268 } 268 }
269 return new Path.fromNative(new File(path).fullPathSync()); 269 return new Path(new File(path).fullPathSync());
270 } 270 }
OLDNEW
« no previous file with comments | « tools/testing/dart/http_server.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698