diff options
author | Colin Cross <ccross@android.com> | 2020-10-13 03:33:10 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-10-13 03:33:10 +0000 |
commit | 9ebc22cf2d2bd8cbe2f5dbdf0fd1eb1ce341b477 (patch) | |
tree | 69ec785e32b746947f44a0d48ecd4c04d1fe6efd /java/java_test.go | |
parent | ff8838cb86883d6759afd2f325b1ac80be5559a6 (diff) | |
parent | 89226d9ef94040215ff9d97212d997a656f5d508 (diff) |
Merge changes Ieeca3c39,Iddeea2d0,I8d66a5d3
* changes:
Add jni_libs to host java binaries
Make java_binary common variant a dependency
Replace jniDependencyTag with a value
Diffstat (limited to 'java/java_test.go')
-rw-r--r-- | java/java_test.go | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/java/java_test.go b/java/java_test.go index 53053df0e..c751ea4e7 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -460,6 +460,14 @@ func TestBinary(t *testing.T) { name: "bar", srcs: ["b.java"], static_libs: ["foo"], + jni_libs: ["libjni"], + } + + cc_library_shared { + name: "libjni", + host_supported: true, + device_supported: false, + stl: "none", } `) @@ -470,10 +478,17 @@ func TestBinary(t *testing.T) { barWrapper := ctx.ModuleForTests("bar", buildOS+"_x86_64") barWrapperDeps := barWrapper.Output("bar").Implicits.Strings() + libjni := ctx.ModuleForTests("libjni", buildOS+"_x86_64_shared") + libjniSO := libjni.Rule("Cp").Output.String() + // Test that the install binary wrapper depends on the installed jar file - if len(barWrapperDeps) != 1 || barWrapperDeps[0] != barJar { - t.Errorf("expected binary wrapper implicits [%q], got %v", - barJar, barWrapperDeps) + if g, w := barWrapperDeps, barJar; !android.InList(w, g) { + t.Errorf("expected binary wrapper implicits to contain %q, got %q", w, g) + } + + // Test that the install binary wrapper depends on the installed JNI libraries + if g, w := barWrapperDeps, libjniSO; !android.InList(w, g) { + t.Errorf("expected binary wrapper implicits to contain %q, got %q", w, g) } } |