summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2021-04-19 21:31:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-04-19 21:31:08 +0000
commit91fc8cbc73c0d59d8a82dcdb1d8cb566f47bc112 (patch)
tree136f8174c12295c9aa67eea771ea0957c9e0732a /java/java_test.go
parent62b9c5bd99c8d92ad72e4449bbb25c299c59617a (diff)
parentf8d9c499d49469a2df88bb34ba84632c90468c27 (diff)
Merge "Reland: Add jni_libs property to java tests"
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index 052345871..e7ea4ef54 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -20,6 +20,7 @@ import (
"path/filepath"
"reflect"
"regexp"
+ "runtime"
"strconv"
"strings"
"testing"
@@ -462,6 +463,38 @@ 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)
+
+ expected := "lib64/libjni.so"
+ if runtime.GOOS == "darwin" {
+ expected = "lib64/libjni.dylib"
+ }
+
+ fooTestData := foo.data
+ if len(fooTestData) != 1 || fooTestData[0].Rel() != expected {
+ t.Errorf(`expected foo test data relative path [%q], got %q`,
+ expected, fooTestData.Strings())
+ }
+}
+
func TestHostBinaryNoJavaDebugInfoOverride(t *testing.T) {
bp := `
java_library {