summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2021-03-24 10:34:35 +0000
committerPaul Duffin <paulduffin@google.com>2021-03-25 13:14:37 +0000
commit4dd6cdb3bce897e074d31cd2ea8ed4114a46e625 (patch)
treed56b101a1aaa22c80f1d1b07edae53e6fb2d9cb3 /java/java_test.go
parent85d8f0dcd9c18922dca9d57070dd14e66cef34cb (diff)
Fix TestDroiddoc's reliance on absolute paths
TestDroiddoc compares the value returned by OutputFiles(""), which will usually be absolute paths including the temporary buildDir, against paths returned from TestingBuildParam.RelativeToTop(), which does not currently change the Path contents and so will include absolute temporary paths. However, a follow up change to this will make the TestingBuildParam.RelativeToTop() also change the Path contents at which point this test would be comparing relative to absolute paths. So, this change makes sure that they are all converted to relative to top paths before comparison. Bug: 183650682 Test: m droid Change-Id: Ia4478f527af27a920945f5849525e5031cc5b8b6
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 9924be7bf..13b3e2a90 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1429,7 +1429,7 @@ func TestDroiddoc(t *testing.T) {
barStubsOutput := barStubsOutputs[0]
barDoc := ctx.ModuleForTests("bar-doc", "android_common")
javaDoc := barDoc.Rule("javadoc").RelativeToTop()
- if g, w := javaDoc.Implicits.Strings(), barStubsOutput.String(); !inList(w, g) {
+ if g, w := android.PathsRelativeToTop(javaDoc.Implicits), android.PathRelativeToTop(barStubsOutput); !inList(w, g) {
t.Errorf("implicits of bar-doc must contain %q, but was %q.", w, g)
}
@@ -1439,7 +1439,7 @@ func TestDroiddoc(t *testing.T) {
}
aidl := barDoc.Rule("aidl")
- if g, w := javaDoc.Implicits.Strings(), aidl.Output.String(); !inList(w, g) {
+ if g, w := android.PathsRelativeToTop(javaDoc.Implicits), android.PathRelativeToTop(aidl.Output); !inList(w, g) {
t.Errorf("implicits of bar-doc must contain %q, but was %q.", w, g)
}