summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-01-26 11:01:43 -0800
committerColin Cross <ccross@android.com>2021-04-16 21:59:23 +0000
commit246164a055a529e081a7690cc9043b496757a30c (patch)
tree5e2b18ae8b252ee452fc347643b42dbbf7838ce0 /java/java_test.go
parent2df817757575026d937b0ad6e814419a5976d4fa (diff)
Add jni_libs property to java tests
Add jni_libs property to java tests and treat it as test data that should be copied to the lib or lib64 directory in the test directory. Fixes: 176593487 Test: java_test.go Change-Id: I3a118b933ab30dcd731c6dc2708da9bc63ab5520
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 7b8984810..73734feb1 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -499,6 +499,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 {