diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2018-03-02 05:24:13 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-02 05:25:44 -0800 |
commit | 3b446a28d210c83932e47df2452b4b6224a1834b (patch) | |
tree | 19458368d017a98c579e2d44b432ddcacf7a032f /src/test/java/com/google/devtools/build/lib | |
parent | 7c5000944c8264115792ebb82c008ad95493ec68 (diff) |
ci,windows: fix "bazel-rules-tests"
Fix the failing test in
//src/test/java/com/google/devtools/build/lib:bazel-rules-tests
on Windows.
The problem was that the test setup read a
resource file and assumed line endings to be "\n",
but on Windows this resource file was generated
with "\r\n" endings.
The test setup code then put those strings into a
set.
Finally, the test tried to match a string in this
set, but because the entries had an invisible "\r"
at the end, the matching failed.
This commit trims the entries before putting them
in the set.
Fixes https://github.com/bazelbuild/bazel/issues/4752
Closes #4754.
PiperOrigin-RevId: 187608803
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/bazel/rules/android/ndkcrosstools/AndroidNdkCrosstoolsTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/bazel/rules/android/ndkcrosstools/AndroidNdkCrosstoolsTest.java b/src/test/java/com/google/devtools/build/lib/bazel/rules/android/ndkcrosstools/AndroidNdkCrosstoolsTest.java index a4f24c6d45..1de3c4405b 100644 --- a/src/test/java/com/google/devtools/build/lib/bazel/rules/android/ndkcrosstools/AndroidNdkCrosstoolsTest.java +++ b/src/test/java/com/google/devtools/build/lib/bazel/rules/android/ndkcrosstools/AndroidNdkCrosstoolsTest.java @@ -85,7 +85,7 @@ public class AndroidNdkCrosstoolsTest { // The contents of the NDK are placed at "external/%repositoryName%/ndk". // The "external/%repositoryName%" part is removed using NdkPaths.stripRepositoryPrefix, // but to make it easier the "ndk/" part is added here. - ndkFiles.add("ndk/" + line); + ndkFiles.add("ndk/" + line.trim()); } return ndkFiles.build(); } @@ -95,7 +95,7 @@ public class AndroidNdkCrosstoolsTest { ResourceFileLoader.loadResource(AndroidNdkCrosstoolsTest.class, ndkDirectoriesFilename); ImmutableSet.Builder<String> ndkDirectories = ImmutableSet.builder(); for (String line : ndkFilesFileContent.split("\n")) { - ndkDirectories.add("ndk/" + line); + ndkDirectories.add("ndk/" + line.trim()); } return ndkDirectories.build(); } |