summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2023-05-19 00:12:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-05-19 00:12:22 +0000
commit0393174fe78afa42a6bac036b96cd4a690563535 (patch)
treec940964087402b50ca87a4243e47c0fdc7f60cd6 /java/java_test.go
parenta38fb02a25f68cc050aef808bc180a782ca2e83b (diff)
parent795319fadb84b4e65c9fb3defbaf25b612acd53b (diff)
Merge "Disallow missing api source files for java_api_library module"
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 2a4913ecd..ea89e6eb8 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -2252,6 +2252,29 @@ func TestJavaApiLibraryDepApiSrcs(t *testing.T) {
android.AssertStringDoesContain(t, "Command expected to contain output files list text file flag", manifestCommand, "--out __SBOX_SANDBOX_DIR__/out/sources.txt")
}
+func TestJavaApiLibraryFilegroupInput(t *testing.T) {
+ ctx, _ := testJavaWithFS(t, `
+ filegroup {
+ name: "default_current.txt",
+ srcs: ["current.txt"],
+ }
+
+ java_api_library {
+ name: "foo",
+ api_files: [":default_current.txt"],
+ }
+ `,
+ map[string][]byte{
+ "current.txt": nil,
+ })
+
+ m := ctx.ModuleForTests("foo", "android_common")
+ outputs := fmt.Sprint(m.AllOutputs())
+ if !strings.Contains(outputs, "foo/foo.jar") {
+ t.Errorf("Module output does not contain expected jar %s", "foo/foo.jar")
+ }
+}
+
func TestTradefedOptions(t *testing.T) {
result := PrepareForTestWithJavaBuildComponents.RunTestWithBp(t, `
java_test_host {