Support abi check in bazel.

Bug: 253498204
Test: Manual and unit test.
Change-Id: Id23c4f772f67c4ba05704eaad77322133474b42b
This commit is contained in:
Yu Liu
2022-11-12 10:47:07 -08:00
parent 47d7ccfffd
commit 56ccb1aecd
4 changed files with 134 additions and 6 deletions

View File

@@ -543,7 +543,8 @@ cc_library_shared {
]`,
}),
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"has_stubs": `True`,
"has_stubs": `True`,
"stubs_symbol_file": `"a.map.txt"`,
}),
},
})
@@ -845,3 +846,43 @@ cc_library_shared {
},
})
}
func TestCcLibrarySharedHeaderAbiChecker(t *testing.T) {
runCcLibrarySharedTestCase(t, Bp2buildTestCase{
Description: "cc_library_shared with header abi checker",
Blueprint: `cc_library_shared {
name: "foo",
header_abi_checker: {
enabled: true,
symbol_file: "a.map.txt",
exclude_symbol_versions: [
"29",
"30",
],
exclude_symbol_tags: [
"tag1",
"tag2",
],
check_all_apis: true,
diff_flags: ["-allow-adding-removing-weak-symbols"],
},
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"abi_checker_enabled": `True`,
"abi_checker_symbol_file": `"a.map.txt"`,
"abi_checker_exclude_symbol_versions": `[
"29",
"30",
]`,
"abi_checker_exclude_symbol_tags": `[
"tag1",
"tag2",
]`,
"abi_checker_check_all_apis": `True`,
"abi_checker_diff_flags": `["-allow-adding-removing-weak-symbols"]`,
}),
},
})
}