Merge changes from topic "tvts-test-host-jni"

* changes:
  Add jni_libs property to java tests
  Add Target to cc.SharedLibraryInfo
This commit is contained in:
Treehugger Robot
2021-04-17 04:35:24 +00:00
committed by Gerrit Code Review
9 changed files with 67 additions and 0 deletions

View File

@@ -462,6 +462,32 @@ func TestBinary(t *testing.T) {
}
}
func TestTest(t *testing.T) {
ctx, _ := testJava(t, `
java_test_host {
name: "foo",
srcs: ["a.java"],
jni_libs: ["libjni"],
}
cc_library_shared {
name: "libjni",
host_supported: true,
device_supported: false,
stl: "none",
}
`)
buildOS := android.BuildOs.String()
foo := ctx.ModuleForTests("foo", buildOS+"_common").Module().(*TestHost)
fooTestData := foo.data
if len(fooTestData) != 1 || fooTestData[0].Rel() != "lib64/libjni.so" {
t.Errorf(`expected foo test data relative path ["lib64/libjni.so"], got %q`, fooTestData.Strings())
}
}
func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) {
bp := `
java_library {