Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index 2936366f59f51f41170e86eedcb2b7a6eef02833..2255904cbc7a170f36ce15d28306a18f3239a9e0 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -301,10 +301,20 @@ abstract class TestSuite { |
| String name, String dirname, Path testPath, String optionsName) { |
| Path relative = testPath.relativeTo(TestUtils.dartDir()); |
| relative = relative.directoryPath.append(relative.filenameWithoutExtension); |
| - String testUniqueName = relative.toString().replaceAll('/', '_'); |
| + String testPathString = relative.toString(); |
| + if (testPathString.startsWith('$buildDir/generated_tests')) { |
| + testPathString = |
| + testPathString.replaceFirst('$buildDir/generated_tests', 'multitest'); |
| + } |
| + String testUniqueName = testPathString.replaceAll('/', '_'); |
| if (!optionsName.isEmpty) { |
| testUniqueName = '$testUniqueName-$optionsName'; |
| } |
| + final int WINDOWS_SHORTEN_PATH_LIMIT = 70; |
| + if (Platform.operatingSystem == 'windows' && |
| + testUniqueName.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
| + testUniqueName = TestUtils.getPersistentWindowsShortPath(testUniqueName); |
| + } |
|
kustermann
2014/04/07 09:02:23
Just call the function always. I'd encapsulate all
|
| Path generatedTestPath = new Path(buildDir) |
| .append('generated_$name') |
| @@ -1355,25 +1365,6 @@ class StandardTestSuite extends TestSuite { |
| 'polymer_deploy', dartVmBinaryFileName, args, environmentOverrides); |
| } |
| - String createGeneratedTestDirectoryHelper( |
| - String name, String dirname, Path testPath, String optionsName) { |
| - Path relative = testPath.relativeTo(TestUtils.dartDir()); |
| - relative = relative.directoryPath.append(relative.filenameWithoutExtension); |
| - String testUniqueName = relative.toString().replaceAll('/', '_'); |
| - if (!optionsName.isEmpty) { |
| - testUniqueName = '$testUniqueName-$optionsName'; |
| - } |
| - |
| - Path generatedTestPath = new Path(buildDir) |
| - .append('generated_$name') |
| - .append(dirname) |
| - .append(testUniqueName); |
| - |
| - TestUtils.mkdirRecursive(new Path('.'), generatedTestPath); |
| - return new File(generatedTestPath.toNativePath()).absolute.path |
| - .replaceAll('\\', '/'); |
| - } |
| - |
| String get scriptType { |
| switch (configuration['compiler']) { |
| case 'none': |
| @@ -2134,6 +2125,34 @@ class TestUtils { |
| } |
| return extraVmOptions; |
| } |
| + |
| + static String getPersistentWindowsShortPath(String path) { |
| + final replacements = const { |
| + "tests_co19_src_WebPlatformTest1_shadow-dom_shadow-trees_": |
| + "shadow-trees_", |
| + "tests_co19_src_WebPlatformTest1_shadow-dom_elements-and-dom-objects_": |
| + "shadowdom_", |
| + "tests_co19_src_WebPlatformTest1_html-templates_parsing-html-templates_additions-to-": |
| + "htmltemplates_add_", |
| + "tests_co19_src_WebPlatformTest1_html-templates_parsing-html-templates_appending-to-a-template_": |
| + "htmltemplates_append_", |
| + "tests_co19_src_WebPlatformTest1_html-templates_parsing-html-templates_clearing-the-stack-back-to-a-given-context_": |
| + "htmltemplates_clearstack_", |
| + "tests_co19_src_WebPlatformTest1_html-templates_parsing-html-templates_creating-an-element-for-the-token_": |
| + "htmltemplates_create_", |
| + "tests_co19_src_WebPlatformTest1_html-templates_additions-to-the-steps-to-clone-a-node_": |
| + "htmltemplates_clone_", |
| + "tests_co19_src_LayoutTests_fast_dom_Document_CaretRangeFromPoint_caretRangeFromPoint-": |
| + "caretrangefrompoint_" |
| + }; |
| + |
| + for (var key in replacements.keys) { |
| + if (path.startsWith(key)) { |
| + return path.replaceFirst(key, replacements[key]); |
| + } |
| + } |
| + return path; |
| + } |
| } |
| class SummaryReport { |
| @@ -2203,5 +2222,5 @@ class SummaryReport { |
| * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| """; |
| print(report); |
| - } |
| + } |
| } |