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..b5fb74863383132233033ba1bc8f8d7b368d0d08 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -301,7 +301,7 @@ 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 testUniqueName = TestUtils.getShortName(relative.toString()); |
| if (!optionsName.isEmpty) { |
| testUniqueName = '$testUniqueName-$optionsName'; |
| } |
| @@ -1355,25 +1355,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 +2115,49 @@ class TestUtils { |
| } |
| return extraVmOptions; |
| } |
| + |
| + static String getShortName(String path) { |
| + final PATH_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_", |
| + "pkg_polymer_example_canonicalization_test_canonicalization": "polycanon" |
|
kustermann
2014/04/07 14:04:12
Would we hit the limit if you prefixed it with co1
Bill Hesse
2014/04/07 14:47:12
Done.
|
| + }; |
| + |
| + // Some tests are already in [build_dir]/generated_tests. |
| + String GEN_TESTS = 'generated_tests/'; |
| + if (path.contains(GEN_TESTS)) { |
| + int index = path.indexOf(GEN_TESTS) + GEN_TESTS.length; |
| + path = 'gen/${path.substring(index)}'; |
|
kustermann
2014/04/07 14:04:12
Why not multitest as before?
[would make it obviou
Bill Hesse
2014/04/07 14:47:12
Done.
|
| + } |
| + path = path.replaceAll('/', '_'); |
| + final int WINDOWS_SHORTEN_PATH_LIMIT = 70; |
| + if (Platform.operatingSystem == 'windows' && |
| + path.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
| + for (var key in PATH_REPLACEMENTS.keys) { |
| + if (path.startsWith(key)) { |
| + path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
| + break; |
| + } |
| + } |
| + } |
| + return path; |
| + } |
| } |
| class SummaryReport { |
| @@ -2203,5 +2227,5 @@ class SummaryReport { |
| * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| """; |
| print(report); |
| - } |
| + } |
| } |