diff options
| -rw-r--r-- | bp2build/apex_conversion_test.go | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/bp2build/apex_conversion_test.go b/bp2build/apex_conversion_test.go index 233fce4c0..4fd6e43cf 100644 --- a/bp2build/apex_conversion_test.go +++ b/bp2build/apex_conversion_test.go @@ -277,23 +277,23 @@ filegroup { ExpectedBazelTargets: []string{ MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{ "native_shared_libs_32": `[ - ":native_shared_lib_1", - ":native_shared_lib_3", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib32", ] + select({ - "//build/bazel/platforms/arch:arm": [":native_shared_lib_2"], - "//build/bazel/platforms/arch:x86": [":native_shared_lib_2"], + "//build/bazel/platforms/arch:arm": [":native_shared_lib_for_first"], + "//build/bazel/platforms/arch:x86": [":native_shared_lib_for_first"], "//conditions:default": [], })`, "native_shared_libs_64": `select({ "//build/bazel/platforms/arch:arm64": [ - ":native_shared_lib_1", - ":native_shared_lib_4", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib64", + ":native_shared_lib_for_first", ], "//build/bazel/platforms/arch:x86_64": [ - ":native_shared_lib_1", - ":native_shared_lib_4", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib64", + ":native_shared_lib_for_first", ], "//conditions:default": [], })`, @@ -322,27 +322,27 @@ filegroup { MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{ "native_shared_libs_32": `select({ "//build/bazel/platforms/arch:arm": [ - ":native_shared_lib_1", - ":native_shared_lib_3", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib32", + ":native_shared_lib_for_first", ], "//build/bazel/platforms/arch:x86": [ - ":native_shared_lib_1", - ":native_shared_lib_3", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib32", + ":native_shared_lib_for_first", ], "//conditions:default": [], })`, "native_shared_libs_64": `select({ "//build/bazel/platforms/arch:arm64": [ - ":native_shared_lib_1", - ":native_shared_lib_4", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib64", + ":native_shared_lib_for_first", ], "//build/bazel/platforms/arch:x86_64": [ - ":native_shared_lib_1", - ":native_shared_lib_4", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib64", + ":native_shared_lib_for_first", ], "//conditions:default": [], })`, @@ -370,11 +370,11 @@ filegroup { ExpectedBazelTargets: []string{ MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{ "native_shared_libs_32": `[ - ":native_shared_lib_1", - ":native_shared_lib_3", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib32", ] + select({ - "//build/bazel/platforms/arch:arm": [":native_shared_lib_2"], - "//build/bazel/platforms/arch:x86": [":native_shared_lib_2"], + "//build/bazel/platforms/arch:arm": [":native_shared_lib_for_first"], + "//build/bazel/platforms/arch:x86": [":native_shared_lib_for_first"], "//conditions:default": [], })`, "file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`, @@ -402,14 +402,14 @@ filegroup { MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{ "native_shared_libs_64": `select({ "//build/bazel/platforms/arch:arm64": [ - ":native_shared_lib_1", - ":native_shared_lib_4", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib64", + ":native_shared_lib_for_first", ], "//build/bazel/platforms/arch:x86_64": [ - ":native_shared_lib_1", - ":native_shared_lib_4", - ":native_shared_lib_2", + ":native_shared_lib_for_both", + ":native_shared_lib_for_lib64", + ":native_shared_lib_for_first", ], "//conditions:default": [], })`, @@ -419,6 +419,56 @@ filegroup { }}) } +func createMultilibBlueprint(compile_multilib string) string { + return ` +cc_library { + name: "native_shared_lib_for_both", + bazel_module: { bp2build_available: false }, +} + +cc_library { + name: "native_shared_lib_for_first", + bazel_module: { bp2build_available: false }, +} + +cc_library { + name: "native_shared_lib_for_lib32", + bazel_module: { bp2build_available: false }, +} + +cc_library { + name: "native_shared_lib_for_lib64", + bazel_module: { bp2build_available: false }, +} + +apex { + name: "com.android.apogee", + compile_multilib: "` + compile_multilib + `", + multilib: { + both: { + native_shared_libs: [ + "native_shared_lib_for_both", + ], + }, + first: { + native_shared_libs: [ + "native_shared_lib_for_first", + ], + }, + lib32: { + native_shared_libs: [ + "native_shared_lib_for_lib32", + ], + }, + lib64: { + native_shared_libs: [ + "native_shared_lib_for_lib64", + ], + }, + }, +}` +} + func TestApexBundleDefaultPropertyValues(t *testing.T) { runApexTestCase(t, Bp2buildTestCase{ Description: "apex - default property values", @@ -474,56 +524,6 @@ apex { }}) } -func createMultilibBlueprint(compile_multilib string) string { - return ` -cc_library { - name: "native_shared_lib_1", - bazel_module: { bp2build_available: false }, -} - -cc_library { - name: "native_shared_lib_2", - bazel_module: { bp2build_available: false }, -} - -cc_library { - name: "native_shared_lib_3", - bazel_module: { bp2build_available: false }, -} - -cc_library { - name: "native_shared_lib_4", - bazel_module: { bp2build_available: false }, -} - -apex { - name: "com.android.apogee", - compile_multilib: "` + compile_multilib + `", - multilib: { - both: { - native_shared_libs: [ - "native_shared_lib_1", - ], - }, - first: { - native_shared_libs: [ - "native_shared_lib_2", - ], - }, - lib32: { - native_shared_libs: [ - "native_shared_lib_3", - ], - }, - lib64: { - native_shared_libs: [ - "native_shared_lib_4", - ], - }, - }, -}` -} - func TestBp2BuildOverrideApex(t *testing.T) { runOverrideApexTestCase(t, Bp2buildTestCase{ Description: "override_apex", |