Refactor bp2build tests
Moves to specifying attributes as a map, such at it is possible to add additional attributes conditionally. This is in particular useful once supporting the `enabled` property which will add `target_compatible_with` Test: go test soong tests Change-Id: Iade8eed1ce3acb1d1712a9ee3119d9ae59675624
This commit is contained in:
@@ -23,10 +23,9 @@ cc_prebuilt_library_shared {
|
||||
bazel_module: { bp2build_available: true },
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
`prebuilt_library_shared(
|
||||
name = "libtest",
|
||||
shared_library = "libf.so",
|
||||
)`,
|
||||
makeBazelTarget("prebuilt_library_shared", "libtest", attrNameToString{
|
||||
"shared_library": `"libf.so"`,
|
||||
}),
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -52,14 +51,13 @@ cc_prebuilt_library_shared {
|
||||
bazel_module: { bp2build_available: true },
|
||||
}`,
|
||||
expectedBazelTargets: []string{
|
||||
`prebuilt_library_shared(
|
||||
name = "libtest",
|
||||
shared_library = select({
|
||||
makeBazelTarget("prebuilt_library_shared", "libtest", attrNameToString{
|
||||
"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