Update tests for cc_* converters
Forgot to update these tests when doing aosp/2233406 Bug: 249175838 Test: Unit tests Change-Id: I50fbf7c232d0a7aec72af83bcbe805d785f82897
This commit is contained in:
@@ -201,20 +201,27 @@ func TestCcBinaryWithLinkStatic(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCcBinaryVersionScript(t *testing.T) {
|
func TestCcBinaryVersionScriptAndDynamicList(t *testing.T) {
|
||||||
runCcBinaryTests(t, ccBinaryBp2buildTestCase{
|
runCcBinaryTests(t, ccBinaryBp2buildTestCase{
|
||||||
description: `version script`,
|
description: `version script and dynamic list`,
|
||||||
blueprint: `
|
blueprint: `
|
||||||
{rule_name} {
|
{rule_name} {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
include_build_directory: false,
|
include_build_directory: false,
|
||||||
version_script: "vs",
|
version_script: "vs",
|
||||||
|
dynamic_list: "dynamic.list",
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
targets: []testBazelTarget{
|
targets: []testBazelTarget{
|
||||||
{"cc_binary", "foo", AttrNameToString{
|
{"cc_binary", "foo", AttrNameToString{
|
||||||
"additional_linker_inputs": `["vs"]`,
|
"additional_linker_inputs": `[
|
||||||
"linkopts": `["-Wl,--version-script,$(location vs)"]`,
|
"vs",
|
||||||
|
"dynamic.list",
|
||||||
|
]`,
|
||||||
|
"linkopts": `[
|
||||||
|
"-Wl,--version-script,$(location vs)",
|
||||||
|
"-Wl,--dynamic-list,$(location dynamic.list)",
|
||||||
|
]`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -870,9 +870,9 @@ filegroup {
|
|||||||
})}})
|
})}})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCcLibraryNonConfiguredVersionScript(t *testing.T) {
|
func TestCcLibraryNonConfiguredVersionScriptAndDynamicList(t *testing.T) {
|
||||||
runCcLibraryTestCase(t, Bp2buildTestCase{
|
runCcLibraryTestCase(t, Bp2buildTestCase{
|
||||||
Description: "cc_library non-configured version script",
|
Description: "cc_library non-configured version script and dynamic list",
|
||||||
ModuleTypeUnderTest: "cc_library",
|
ModuleTypeUnderTest: "cc_library",
|
||||||
ModuleTypeUnderTestFactory: cc.LibraryFactory,
|
ModuleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
Dir: "foo/bar",
|
Dir: "foo/bar",
|
||||||
@@ -882,6 +882,7 @@ cc_library {
|
|||||||
name: "a",
|
name: "a",
|
||||||
srcs: ["a.cpp"],
|
srcs: ["a.cpp"],
|
||||||
version_script: "v.map",
|
version_script: "v.map",
|
||||||
|
dynamic_list: "dynamic.list",
|
||||||
bazel_module: { bp2build_available: true },
|
bazel_module: { bp2build_available: true },
|
||||||
include_build_directory: false,
|
include_build_directory: false,
|
||||||
}
|
}
|
||||||
@@ -889,17 +890,23 @@ cc_library {
|
|||||||
},
|
},
|
||||||
Blueprint: soongCcLibraryPreamble,
|
Blueprint: soongCcLibraryPreamble,
|
||||||
ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
|
ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
|
||||||
"additional_linker_inputs": `["v.map"]`,
|
"additional_linker_inputs": `[
|
||||||
"linkopts": `["-Wl,--version-script,$(location v.map)"]`,
|
"v.map",
|
||||||
"srcs": `["a.cpp"]`,
|
"dynamic.list",
|
||||||
|
]`,
|
||||||
|
"linkopts": `[
|
||||||
|
"-Wl,--version-script,$(location v.map)",
|
||||||
|
"-Wl,--dynamic-list,$(location dynamic.list)",
|
||||||
|
]`,
|
||||||
|
"srcs": `["a.cpp"]`,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCcLibraryConfiguredVersionScript(t *testing.T) {
|
func TestCcLibraryConfiguredVersionScriptAndDynamicList(t *testing.T) {
|
||||||
runCcLibraryTestCase(t, Bp2buildTestCase{
|
runCcLibraryTestCase(t, Bp2buildTestCase{
|
||||||
Description: "cc_library configured version script",
|
Description: "cc_library configured version script and dynamic list",
|
||||||
ModuleTypeUnderTest: "cc_library",
|
ModuleTypeUnderTest: "cc_library",
|
||||||
ModuleTypeUnderTestFactory: cc.LibraryFactory,
|
ModuleTypeUnderTestFactory: cc.LibraryFactory,
|
||||||
Dir: "foo/bar",
|
Dir: "foo/bar",
|
||||||
@@ -911,9 +918,11 @@ cc_library {
|
|||||||
arch: {
|
arch: {
|
||||||
arm: {
|
arm: {
|
||||||
version_script: "arm.map",
|
version_script: "arm.map",
|
||||||
|
dynamic_list: "dynamic_arm.list",
|
||||||
},
|
},
|
||||||
arm64: {
|
arm64: {
|
||||||
version_script: "arm64.map",
|
version_script: "arm64.map",
|
||||||
|
dynamic_list: "dynamic_arm64.list",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -925,13 +934,25 @@ cc_library {
|
|||||||
Blueprint: soongCcLibraryPreamble,
|
Blueprint: soongCcLibraryPreamble,
|
||||||
ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
|
ExpectedBazelTargets: makeCcLibraryTargets("a", AttrNameToString{
|
||||||
"additional_linker_inputs": `select({
|
"additional_linker_inputs": `select({
|
||||||
"//build/bazel/platforms/arch:arm": ["arm.map"],
|
"//build/bazel/platforms/arch:arm": [
|
||||||
"//build/bazel/platforms/arch:arm64": ["arm64.map"],
|
"arm.map",
|
||||||
|
"dynamic_arm.list",
|
||||||
|
],
|
||||||
|
"//build/bazel/platforms/arch:arm64": [
|
||||||
|
"arm64.map",
|
||||||
|
"dynamic_arm64.list",
|
||||||
|
],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})`,
|
})`,
|
||||||
"linkopts": `select({
|
"linkopts": `select({
|
||||||
"//build/bazel/platforms/arch:arm": ["-Wl,--version-script,$(location arm.map)"],
|
"//build/bazel/platforms/arch:arm": [
|
||||||
"//build/bazel/platforms/arch:arm64": ["-Wl,--version-script,$(location arm64.map)"],
|
"-Wl,--version-script,$(location arm.map)",
|
||||||
|
"-Wl,--dynamic-list,$(location dynamic_arm.list)",
|
||||||
|
],
|
||||||
|
"//build/bazel/platforms/arch:arm64": [
|
||||||
|
"-Wl,--version-script,$(location arm64.map)",
|
||||||
|
"-Wl,--dynamic-list,$(location dynamic_arm64.list)",
|
||||||
|
],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})`,
|
})`,
|
||||||
"srcs": `["a.cpp"]`,
|
"srcs": `["a.cpp"]`,
|
||||||
|
Reference in New Issue
Block a user