diff options
author | 2025-02-21 15:31:29 -0800 | |
---|---|---|
committer | 2025-02-21 15:31:29 -0800 | |
commit | ff5a9c36f906accadb520cd479f876daf1d4587d (patch) | |
tree | 5f55e2d0b02a90ddc9f598ec33bd1f7a54f196c2 /java/java_test.go | |
parent | 2cb77e066ae2548db00cfaba95665141aa3cfc02 (diff) | |
parent | b361442aa66c644efba22c6c3da846ac0644d86a (diff) |
Merge "Implement host_common_data property for cc, java, rust and sh test modules" into main
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go index 636a0c891..a6290a628 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -585,6 +585,29 @@ func TestTest(t *testing.T) { } } +func TestHostCommonData(t *testing.T) { + t.Parallel() + ctx, _ := testJava(t, ` + java_library_host { + name: "host", + srcs: ["a.java"], + } + + java_test { + name: "foo", + srcs: ["a.java"], + host_common_data: [":host"], + } + `) + + foo := ctx.ModuleForTests(t, "foo", "android_common").Module().(*Test) + host := ctx.ModuleForTests(t, "host", ctx.Config().BuildOSCommonTarget.String()).Module().(*Library) + + if g, w := foo.data.RelativeToTop().Strings(), []string{host.outputFile.RelativeToTop().String()}; !slices.Equal(g, w) { + t.Errorf("expected test data %q, got %q\n", w, g) + } +} + func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) { t.Parallel() bp := ` |