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

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

Issue 2104333002: Ensure short path names for generated tests on Windows, in test runner. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index ce30a7362eeb69ef33907a72bead29eae239b263..c73dc7c28841b77b49774be1b91550146699059b 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -2394,6 +2394,8 @@ class TestUtils {
static List<String> getExtraVmOptions(Map configuration) =>
getExtraOptions(configuration, 'vm_options');
+ static int shortNameCounter = 0; // Make unique short file names on Windows.
+
static String getShortName(String path) {
final PATH_REPLACEMENTS = const {
"pkg_polymer_e2e_test_bad_import_test": "polymer_bi",
@@ -2457,6 +2459,7 @@ class TestUtils {
}
path = path.replaceAll('/', '_');
final int WINDOWS_SHORTEN_PATH_LIMIT = 58;
+ final int WINDOWS_PATH_END_LENGTH = 30;
if (Platform.operatingSystem == 'windows' &&
path.length > WINDOWS_SHORTEN_PATH_LIMIT) {
for (var key in PATH_REPLACEMENTS.keys) {
@@ -2465,6 +2468,11 @@ class TestUtils {
break;
}
}
+ if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) {
+ ++shortNameCounter;
+ var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH);
+ path = "short${shortNameCounter}_$pathEnd";
Søren Gjesse 2016/06/29 15:35:56 Maybe add __ in front as well to lower the probabi
+ }
}
return 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