Chromium Code Reviews| Index: tools/testing/dart/multitest.dart |
| diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart |
| index eb85c1a0d86f58626bd7f4991f92f1ce699fb12a..85d24e3557f05522d3daedbf51dccbe6ca7ecb84 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) { |
|
kustermann
2016/08/24 12:09:00
CreateM... -> createM...
Bill Hesse
2016/08/24 12:16:27
Done.
|
| + Path relative = sourceDir.relativeTo(suiteDir); |
| + Path path = new Path(outputDir).append('generated_tests') |
| + .append(suiteNameFromPath(suiteDir)).join(relative); |
|
kustermann
2016/08/24 12:09:00
Don't we have some TestUtils.* helpers for generat
Bill Hesse
2016/08/24 12:16:27
Those are for generating the directories for compi
|
| + TestUtils.mkdirRecursive(TestUtils.currentWorkingDirectory, path); |
| + return new Path(new File(path.toNativePath()).absolute.path); |
| } |