aboutsummaryrefslogtreecommitdiff
path: root/apex/apex_test.go
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-12-05 05:47:08 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-12-05 05:47:08 +0000
commitfedbb5c3beed35c10c6e14f38d54148c560bc7b5 (patch)
treeadb8872f24fcaef693d823c4070dc2d08c94f87f /apex/apex_test.go
parent31783628ff3972e3cde69a8899edfff5d79a6478 (diff)
parent9582159c4d07fa1c277e4592f9a20143773693c0 (diff)
Merge changes from topics "libz-no-stubs-for-vendor", "vendor-etc-linker-config" into main
* changes: Generate vendor specific STUB_LIBRARIES Add cc_library.target.vendor.no_stubs
Diffstat (limited to 'apex/apex_test.go')
-rw-r--r--apex/apex_test.go66
1 files changed, 66 insertions, 0 deletions
diff --git a/apex/apex_test.go b/apex/apex_test.go
index f0fd73073..f14ab8a67 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -4710,6 +4710,72 @@ func TestTestApex(t *testing.T) {
ensureListContains(t, ctx.ModuleVariantsForTests("mylib_common_test"), "android_arm64_armv8-a_shared")
}
+func TestLibzVendorIsntStable(t *testing.T) {
+ ctx := testApex(t, `
+ apex {
+ name: "myapex",
+ key: "myapex.key",
+ updatable: false,
+ binaries: ["mybin"],
+ }
+ apex {
+ name: "myvendorapex",
+ key: "myapex.key",
+ file_contexts: "myvendorapex_file_contexts",
+ vendor: true,
+ updatable: false,
+ binaries: ["mybin"],
+ }
+ apex_key {
+ name: "myapex.key",
+ public_key: "testkey.avbpubkey",
+ private_key: "testkey.pem",
+ }
+ cc_binary {
+ name: "mybin",
+ vendor_available: true,
+ system_shared_libs: [],
+ stl: "none",
+ shared_libs: ["libz"],
+ apex_available: ["//apex_available:anyapex"],
+ }
+ cc_library {
+ name: "libz",
+ vendor_available: true,
+ system_shared_libs: [],
+ stl: "none",
+ stubs: {
+ versions: ["28", "30"],
+ },
+ target: {
+ vendor: {
+ no_stubs: true,
+ },
+ },
+ }
+ `, withFiles(map[string][]byte{
+ "myvendorapex_file_contexts": nil,
+ }))
+
+ // libz provides stubs for core variant.
+ {
+ ensureExactContents(t, ctx, "myapex", "android_common_myapex", []string{
+ "bin/mybin",
+ })
+ apexManifestRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("apexManifestRule")
+ android.AssertStringEquals(t, "should require libz", apexManifestRule.Args["requireNativeLibs"], "libz.so")
+ }
+ // libz doesn't provide stubs for vendor variant.
+ {
+ ensureExactContents(t, ctx, "myvendorapex", "android_common_myvendorapex", []string{
+ "bin/mybin",
+ "lib64/libz.so",
+ })
+ apexManifestRule := ctx.ModuleForTests("myvendorapex", "android_common_myvendorapex").Rule("apexManifestRule")
+ android.AssertStringEquals(t, "should not require libz", apexManifestRule.Args["requireNativeLibs"], "")
+ }
+}
+
func TestApexWithTarget(t *testing.T) {
ctx := testApex(t, `
apex {