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

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

Issue 10247004: test rename overhaul: step 6 - isolate tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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:io"); 7 #import("dart:io");
8 #import("test_suite.dart"); 8 #import("test_suite.dart");
9 9
10 // Multitests are Dart test scripts containing lines of the form 10 // Multitests are Dart test scripts containing lines of the form
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 String CreateMultitestDirectory(String outputDir, String testDir) { 256 String CreateMultitestDirectory(String outputDir, String testDir) {
257 final String generatedTestDirectory = 'generated_tests'; 257 final String generatedTestDirectory = 'generated_tests';
258 Directory generatedTestDir = new Directory('$outputDir/generated_tests'); 258 Directory generatedTestDir = new Directory('$outputDir/generated_tests');
259 if (!new Directory(outputDir).existsSync()) { 259 if (!new Directory(outputDir).existsSync()) {
260 new Directory(outputDir).createSync(); 260 new Directory(outputDir).createSync();
261 } 261 }
262 if (!generatedTestDir.existsSync()) { 262 if (!generatedTestDir.existsSync()) {
263 generatedTestDir.createSync(); 263 generatedTestDir.createSync();
264 } 264 }
265 var split = testDir.split('/'); 265 var split = testDir.split('/');
266 var lastComponent = split.removeLast(); 266 if (split.last() == 'src') {
267 Expect.isTrue(lastComponent == 'src'); 267 // TODO(sigmund): remove this once all tests are migrated to use
268 // TestSuite.forDirectory.
269 split.removeLast();
270 }
268 String path = '${generatedTestDir.path}/${split.last()}'; 271 String path = '${generatedTestDir.path}/${split.last()}';
269 Directory dir = new Directory(path); 272 Directory dir = new Directory(path);
270 if (!dir.existsSync()) { 273 if (!dir.existsSync()) {
271 dir.createSync(); 274 dir.createSync();
272 } 275 }
273 return path; 276 return path;
274 } 277 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698