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

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

Issue 2270413002: Add relative path to test when creating generated multitest directory (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Change capitalization Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/multitest.dart
diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart
index eb85c1a0d86f58626bd7f4991f92f1ce699fb12a..b714e718e84412fefbadc5c2110b410677346906 100644
--- a/tools/testing/dart/multitest.dart
+++ b/tools/testing/dart/multitest.dart
@@ -245,7 +245,7 @@ Future doMultitest(
ExtractTestsFromMultitest(filePath, tests, outcomes);
Path sourceDir = filePath.directoryPath;
- Path targetDir = CreateMultitestDirectory(outputDir, suiteDir);
+ Path targetDir = createMultitestDirectory(outputDir, suiteDir, sourceDir);
assert(targetDir != null);
// Copy all the relative imports of the multitest.
@@ -295,24 +295,19 @@ Future doMultitest(
});
}
-Path CreateMultitestDirectory(String outputDir, Path suiteDir) {
- Directory generatedTestDir = new Directory('$outputDir/generated_tests');
- if (!new Directory(outputDir).existsSync()) {
- new Directory(outputDir).createSync();
- }
- if (!generatedTestDir.existsSync()) {
- generatedTestDir.createSync();
- }
+String suiteNameFromPath(Path suiteDir) {
var split = suiteDir.segments();
+ // co19 test suite is at tests/co19/src.
if (split.last == 'src') {
- // TODO(sigmund): remove this once all tests are migrated to use
- // TestSuite.forDirectory.
split.removeLast();
}
- String path = '${generatedTestDir.path}/${split.last}';
- Directory dir = new Directory(path);
- if (!dir.existsSync()) {
- dir.createSync();
- }
- return new Path(new File(path).absolute.path);
+ return split.last;
+}
+
+Path createMultitestDirectory(String outputDir, Path suiteDir, Path sourceDir) {
+ Path relative = sourceDir.relativeTo(suiteDir);
+ Path path = new Path(outputDir).append('generated_tests')
+ .append(suiteNameFromPath(suiteDir)).join(relative);
+ TestUtils.mkdirRecursive(TestUtils.currentWorkingDirectory, path);
+ return new Path(new File(path.toNativePath()).absolute.path);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698