aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/lib
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2016-06-13 18:00:27 +0000
committerGravatar Yue Gan <yueg@google.com>2016-06-14 08:14:33 +0000
commit0005bbcba9b3564d9e4490725973a68674aa9455 (patch)
treed54304e8080c73f7079bdeed7252560149541fa9 /src/test/java/com/google/devtools/build/lib
parentf812a2f8dfebf21645cbb559a29357b627edddde (diff)
Optimize hotspot in DependencySet.process().
-- MOS_MIGRATED_REVID=124744073
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r--src/test/java/com/google/devtools/build/lib/util/DependencySetTest.java33
-rw-r--r--src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java2
2 files changed, 34 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/util/DependencySetTest.java b/src/test/java/com/google/devtools/build/lib/util/DependencySetTest.java
index fd33d34bc6..ad0590186f 100644
--- a/src/test/java/com/google/devtools/build/lib/util/DependencySetTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/DependencySetTest.java
@@ -191,6 +191,39 @@ public class DependencySetTest {
}
}
+ /*
+ * Test compatibility with --config=nvcc, which writes an extra space before the colon.
+ */
+ @Test
+ public void dotDParser_spaceBeforeColon() throws Exception {
+ Path file1 = fileSystem.getPath("/usr/local/blah/blah/genhello/hello.cc");
+ Path file2 = fileSystem.getPath("/usr/local/blah/blah/genhello/hello.h");
+ String filename = "hello.o";
+ Path dotd = scratch.file("/tmp/foo.d",
+ filename + " : \\",
+ " " + file1 + " \\",
+ " " + file2 + " ");
+ DependencySet depset = newDependencySet().read(dotd);
+ assertThat(depset.getDependencies()).containsExactlyElementsIn(Sets.newHashSet(file1, file2));
+ assertEquals(depset.getOutputFileName(), filename);
+ }
+
+ /*
+ * Bug-for-bug compatibility with --config=msvc, which writes malformed .d files.
+ */
+ @Test
+ public void dotDParser_missingBackslash() throws Exception {
+ Path file1 = fileSystem.getPath("/usr/local/blah/blah/genhello/hello.cc");
+ Path file2 = fileSystem.getPath("/usr/local/blah/blah/genhello/hello.h");
+ String filename = "hello.o";
+ Path dotd = scratch.file("/tmp/foo.d",
+ filename + ": ",
+ " " + file1 + " \\",
+ " " + file2 + " ");
+ DependencySet depset = newDependencySet().read(dotd);
+ assertThat(depset.getDependencies()).isEmpty();
+ }
+
@Test
public void writeSet() throws Exception {
Path file1 = fileSystem.getPath("/usr/local/blah/blah/genhello/hello.cc");
diff --git a/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java b/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java
index 129692bae8..15e32e0cff 100644
--- a/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/util/DependencySetWindowsTest.java
@@ -90,7 +90,7 @@ public class DependencySetWindowsTest {
}
@Test
- public void dotDParser_caseInsenstivie() throws Exception {
+ public void dotDParser_caseInsensitive() throws Exception {
Path file1 = fileSystem.getPath("C:/blah/blah/genhello/hello.cc");
Path file2 = fileSystem.getPath("C:/blah/blah/genhello/hello.h");
Path file2DiffCase = fileSystem.getPath("C:/Blah/blah/Genhello/hello.h");