diff options
author | Steve Kim <kwstephenkim@google.com> | 2020-09-01 17:58:01 +0000 |
---|---|---|
committer | Steve Kim <kwstephenkim@google.com> | 2020-09-01 17:58:01 +0000 |
commit | 3666c7023f129fa4c38a11918e6e9e9a3a554b31 (patch) | |
tree | 4fc8ba61e8a12ad3c4098426831e2df396b67d30 /java/java_test.go | |
parent | 3a55c91f9de31fdb2a7bba2360ddba347c11112e (diff) |
Revert "Remove create_stubs and checkapi from droiddoc"
This reverts commit 3a55c91f9de31fdb2a7bba2360ddba347c11112e.
Reason for revert: build failed. Guess this is the cause but needs to confirm. Creating a revert per instructions
Change-Id: I30f1c8cd63e5ab84dba5d21ed354a42695c24ec4
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 66 |
1 files changed, 20 insertions, 46 deletions
diff --git a/java/java_test.go b/java/java_test.go index d75be1817..0e936118c 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -1082,26 +1082,16 @@ func TestDroiddoc(t *testing.T) { srcs: ["bar-doc/IBar.aidl"], path: "bar-doc", } - droidstubs { - name: "bar-stubs", - srcs: [ - "bar-doc/a.java", - ], - exclude_srcs: [ - "bar-doc/b.java" - ], - api_levels_annotations_dirs: [ - "droiddoc-templates-sdk", - ], - api_levels_annotations_enabled: true, - } droiddoc { name: "bar-doc", srcs: [ - ":bar-stubs", + "bar-doc/a.java", "bar-doc/IFoo.aidl", ":bar-doc-aidl-srcs", ], + exclude_srcs: [ + "bar-doc/b.java" + ], custom_template: "droiddoc-templates-sdk", hdf: [ "android.whichdoc offline", @@ -1118,29 +1108,23 @@ func TestDroiddoc(t *testing.T) { "bar-doc/a.java": nil, "bar-doc/b.java": nil, }) - barStubs := ctx.ModuleForTests("bar-stubs", "android_common") - barStubsOutputs, err := barStubs.Module().(*Droidstubs).OutputFiles("") - if err != nil { - t.Errorf("Unexpected error %q retrieving \"bar-stubs\" output file", err) - } - if len(barStubsOutputs) != 1 { - t.Errorf("Expected one output from \"bar-stubs\" got %s", barStubsOutputs) + barDocModule := ctx.ModuleForTests("bar-doc", "android_common") + barDoc := barDocModule.Rule("javadoc") + notExpected := " -stubs " + if strings.Contains(barDoc.RuleParams.Command, notExpected) { + t.Errorf("bar-doc command contains flag %q to create stubs, but should not", notExpected) } - barStubsOutput := barStubsOutputs[0] - barDoc := ctx.ModuleForTests("bar-doc", "android_common") - javaDoc := barDoc.Rule("javadoc") - if g, w := javaDoc.Implicits.Strings(), barStubsOutput.String(); !inList(w, g) { - t.Errorf("implicits of bar-doc must contain %q, but was %q.", w, g) + var javaSrcs []string + for _, i := range barDoc.Inputs { + javaSrcs = append(javaSrcs, i.Base()) } - - expected := "-sourcepath " + buildDir + "/.intermediates/bar-doc/android_common/srcjars " - if !strings.Contains(javaDoc.RuleParams.Command, expected) { - t.Errorf("bar-doc command does not contain flag %q, but should\n%q", expected, javaDoc.RuleParams.Command) + if len(javaSrcs) != 1 || javaSrcs[0] != "a.java" { + t.Errorf("inputs of bar-doc must be []string{\"a.java\"}, but was %#v.", javaSrcs) } - aidl := barDoc.Rule("aidl") - if g, w := javaDoc.Implicits.Strings(), aidl.Output.String(); !inList(w, g) { + aidl := barDocModule.Rule("aidl") + if g, w := barDoc.Implicits.Strings(), aidl.Output.String(); !inList(w, g) { t.Errorf("implicits of bar-doc must contain %q, but was %q.", w, g) } @@ -1160,26 +1144,16 @@ func TestDroiddocArgsAndFlagsCausesError(t *testing.T) { srcs: ["bar-doc/IBar.aidl"], path: "bar-doc", } - droidstubs { - name: "bar-stubs", - srcs: [ - "bar-doc/a.java", - ], - exclude_srcs: [ - "bar-doc/b.java" - ], - api_levels_annotations_dirs: [ - "droiddoc-templates-sdk", - ], - api_levels_annotations_enabled: true, - } droiddoc { name: "bar-doc", srcs: [ - ":bar-stubs", + "bar-doc/a.java", "bar-doc/IFoo.aidl", ":bar-doc-aidl-srcs", ], + exclude_srcs: [ + "bar-doc/b.java" + ], custom_template: "droiddoc-templates-sdk", hdf: [ "android.whichdoc offline", |