cc_prebuilt_library_shared converted via bp2build
Bug: b/203699063 Test: bp2build/cc_prebuilt_library_shared_test.go Test: USE_BAZEL_ANALYSIS=1 m nothing Test: mixed_{libc,droid}.sh Change-Id: I4c58224e88c31507a4b285f8c55bdc066bd47232
This commit is contained in:
parent
2a524318e4
commit
7fa0696eb7
65
bp2build/cc_prebuilt_library_shared_test.go
Normal file
65
bp2build/cc_prebuilt_library_shared_test.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package bp2build
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"android/soong/cc"
|
||||
)
|
||||
|
||||
func TestSharedPrebuiltLibrary(t *testing.T) {
|
||||
runBp2BuildTestCaseSimple(t,
|
||||
bp2buildTestCase{
|
||||
description: "prebuilt library shared simple",
|
||||
moduleTypeUnderTest: "cc_prebuilt_library_shared",
|
||||
moduleTypeUnderTestFactory: cc.PrebuiltSharedLibraryFactory,
|
||||
moduleTypeUnderTestBp2BuildMutator: cc.PrebuiltLibrarySharedBp2Build,
|
||||
filesystem: map[string]string{
|
||||
"libf.so": "",
|
||||
},
|
||||
blueprint: `
|
||||
cc_prebuilt_library_shared {
|
||||
name: "libtest",
|
||||
srcs: ["libf.so"],
|
||||
bazel_module: { bp2build_available: true },
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
`prebuilt_library_shared(
|
||||
name = "libtest",
|
||||
shared_library = "libf.so",
|
||||
)`,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func TestSharedPrebuiltLibraryWithArchVariance(t *testing.T) {
|
||||
runBp2BuildTestCaseSimple(t,
|
||||
bp2buildTestCase{
|
||||
description: "prebuilt library shared with arch variance",
|
||||
moduleTypeUnderTest: "cc_prebuilt_library_shared",
|
||||
moduleTypeUnderTestFactory: cc.PrebuiltSharedLibraryFactory,
|
||||
moduleTypeUnderTestBp2BuildMutator: cc.PrebuiltLibrarySharedBp2Build,
|
||||
filesystem: map[string]string{
|
||||
"libf.so": "",
|
||||
"libg.so": "",
|
||||
},
|
||||
blueprint: `
|
||||
cc_prebuilt_library_shared {
|
||||
name: "libtest",
|
||||
arch: {
|
||||
arm64: { srcs: ["libf.so"], },
|
||||
arm: { srcs: ["libg.so"], },
|
||||
},
|
||||
bazel_module: { bp2build_available: true },
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
`prebuilt_library_shared(
|
||||
name = "libtest",
|
||||
shared_library = select({
|
||||
"//build/bazel/platforms/arch:arm": "libg.so",
|
||||
"//build/bazel/platforms/arch:arm64": "libf.so",
|
||||
"//conditions:default": None,
|
||||
}),
|
||||
)`,
|
||||
},
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user