add moduletest cfi

Signed-off-by: bigtea <tianqushen@huawei.com>
This commit is contained in:
bigtea 2024-03-21 22:13:51 +08:00
parent 74bd8a195f
commit 945ed77ef5
9 changed files with 384 additions and 0 deletions

View File

@ -1,2 +1,3 @@
src:*/third_party/googletest/googletest/include/gtest/internal/gtest-port.h
src:*/third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h
src:*/third_party/googletest/googletest/include/gtest/gtest-matchers.h

View File

@ -43,6 +43,14 @@ config("app_account_native_config_moduletest") {
}
ohos_moduletest("app_account_manager_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "app_account_manager_module_test.cpp" ]

View File

@ -33,6 +33,14 @@ config("domain_account_frameworks_config_moduletest") {
}
ohos_moduletest("domain_account_frameworks_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
@ -82,6 +90,15 @@ ohos_moduletest("domain_account_frameworks_module_test") {
}
ohos_moduletest("domain_account_frameworks_module_mock_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
cflags = [ "-pipe" ]
@ -166,6 +183,14 @@ ohos_moduletest("domain_account_frameworks_module_mock_test") {
}
ohos_moduletest("domain_account_common_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${domain_account_interfaces_native_path}/include" ]
@ -189,6 +214,14 @@ ohos_moduletest("domain_account_common_module_test") {
}
ohos_moduletest("domain_account_plugin_service_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${domain_account_interfaces_native_path}/include" ]
@ -216,6 +249,14 @@ ohos_moduletest("domain_account_plugin_service_test") {
}
ohos_moduletest("domain_account_plugin_stub_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${domain_account_interfaces_native_path}/include" ]

View File

@ -25,6 +25,14 @@ config("accountmgr_mst_test_config") {
}
ohos_moduletest("AccountInnerSdkModuleTest") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [
@ -67,6 +75,14 @@ ohos_moduletest("AccountInnerSdkModuleTest") {
}
ohos_moduletest("AccountInnerSdkModuleMockTest") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
@ -153,6 +169,14 @@ ohos_moduletest("AccountInnerSdkModuleMockTest") {
}
ohos_moduletest("DeviceAccountInfoModuleTest") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "device_account_info_test.cpp" ]

View File

@ -36,6 +36,15 @@ config("os_account_frameworks_config_unittest") {
}
ohos_moduletest("os_account_frameworks_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
sources = [
@ -82,6 +91,15 @@ ohos_moduletest("os_account_frameworks_module_test") {
}
ohos_moduletest("os_account_frameworks_module_mock_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
include_dirs = [
"${os_account_dfx_path}/hidumper_adapter",
@ -167,6 +185,14 @@ ohos_moduletest("os_account_frameworks_module_mock_test") {
}
ohos_moduletest("os_account_manager_no_bms_mock_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
"${os_account_dfx_path}/hidumper_adapter",

View File

@ -42,6 +42,14 @@ config("app_account_service_config_unittest") {
}
ohos_moduletest("app_account_check_labels_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "app_account_check_labels_module_test.cpp" ]
@ -71,6 +79,14 @@ ohos_moduletest("app_account_check_labels_module_test") {
}
ohos_moduletest("app_account_authorization_extension_ability_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
"${app_account_extension_path}/include",
@ -112,6 +128,14 @@ ohos_moduletest("app_account_authorization_extension_ability_test") {
}
ohos_moduletest("account_permission_manager_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "account_permission_manager_module_test.cpp" ]
@ -137,6 +161,14 @@ ohos_moduletest("account_permission_manager_module_test") {
}
ohos_moduletest("app_account_manager_service_associated_data_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
cflags = []
@ -255,6 +287,14 @@ ohos_moduletest("app_account_manager_service_associated_data_test") {
}
ohos_moduletest("app_account_authenticator_callback_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
sources = [ "app_account_authenticator_callback_test.cpp" ]
@ -284,6 +324,14 @@ ohos_moduletest("app_account_authenticator_callback_test") {
}
ohos_moduletest("app_account_event_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
sources = [ "app_account_event_module_test.cpp" ]
@ -318,6 +366,14 @@ ohos_moduletest("app_account_event_module_test") {
}
ohos_moduletest("app_account_authenticate_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
sources = [
@ -360,6 +416,14 @@ ohos_moduletest("app_account_authenticate_test") {
}
ohos_moduletest("app_account_control_manager_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "app_account_control_manager_module_test.cpp" ]
@ -392,6 +456,15 @@ ohos_moduletest("app_account_control_manager_module_test") {
}
ohos_moduletest("app_account_authenticator_session_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
include_dirs = [
"${app_account_services_path}/test/mock/app_account",
@ -506,6 +579,15 @@ ohos_moduletest("app_account_authenticator_session_module_test") {
}
ohos_moduletest("app_account_manager_service_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
cflags_cc = []
cflags = []
@ -561,6 +643,14 @@ ohos_moduletest("app_account_manager_service_module_test") {
}
ohos_moduletest("app_account_manager_service_not_mock_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
cflags = []
@ -609,6 +699,14 @@ ohos_moduletest("app_account_manager_service_not_mock_module_test") {
}
ohos_moduletest("at_not_mock_app_account_manager_service_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [
"${app_account_services_path}/src/account_data_storage.cpp",
@ -715,6 +813,14 @@ ohos_moduletest("at_not_mock_app_account_manager_service_module_test") {
}
ohos_moduletest("app_account_manager_service_subscribe_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
sources = [
@ -764,6 +870,14 @@ ohos_moduletest("app_account_manager_service_subscribe_module_test") {
}
ohos_moduletest("app_account_manager_service_sync_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
cflags = []
@ -817,6 +931,14 @@ ohos_moduletest("app_account_manager_service_sync_module_test") {
}
ohos_moduletest("bundle_manager_adapter_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs =
[ "${services_path}/accountmgr/include/bundle_manager_adapter" ]
@ -848,6 +970,15 @@ ohos_moduletest("bundle_manager_adapter_module_test") {
}
ohos_moduletest("app_account_authenticator_session_manager_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
include_dirs = [
"${app_account_services_path}/test/mock/app_account",
@ -961,6 +1092,14 @@ ohos_moduletest("app_account_authenticator_session_manager_module_test") {
}
ohos_moduletest("app_account_manager_service_thread_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
sources = [
@ -1008,6 +1147,14 @@ ohos_moduletest("app_account_manager_service_thread_module_test") {
}
ohos_moduletest("app_account_subscribe_manager_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
cflags_cc = []
include_dirs = [ "${app_account_services_path}/include/appaccount" ]

View File

@ -41,6 +41,14 @@ config("app_account_service_config_unittest") {
}
ohos_moduletest("account_permission_manager_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "account_permission_manager_module_test.cpp" ]
@ -66,6 +74,14 @@ ohos_moduletest("account_permission_manager_module_test") {
}
ohos_moduletest("bundle_manager_adapter_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs =
[ "${services_path}/accountmgr/include/bundle_manager_adapter" ]

View File

@ -32,6 +32,14 @@ config("os_account_manager_service_test_config") {
}
ohos_moduletest("inner_os_account_manager_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "inner_os_account_manager_test.cpp" ]
@ -64,6 +72,14 @@ ohos_moduletest("inner_os_account_manager_test") {
}
ohos_moduletest("os_account_manager_service_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
"${app_account_services_path}/test/mock/common",
@ -175,6 +191,14 @@ config("os_account_manager_service_create_os_account_test_config") {
}
ohos_moduletest("os_account_manager_service_create_os_account_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "os_account_manager_service_create_os_account_test.cpp" ]
@ -221,6 +245,15 @@ config("os_account_manager_service_subscribe_test_config") {
}
ohos_moduletest("os_account_manager_service_subscribe_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "${os_account_path}/cfi_blocklist.txt"
}
module_out_path = module_output_path
include_dirs = [
@ -337,6 +370,14 @@ ohos_moduletest("os_account_manager_service_subscribe_module_test") {
}
ohos_moduletest("os_account_control_file_manager_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "os_account_control_file_manager_test.cpp" ]
@ -368,6 +409,14 @@ ohos_moduletest("os_account_control_file_manager_test") {
}
ohos_moduletest("os_account_database_operator_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "os_account_database_operator_test.cpp" ]
@ -399,6 +448,14 @@ ohos_moduletest("os_account_database_operator_test") {
}
ohos_moduletest("os_account_file_operator_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "os_account_file_operator_test.cpp" ]
@ -443,6 +500,14 @@ config("os_account_photo_operator_test_config") {
}
ohos_moduletest("os_account_photo_operator_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
sources = [ "os_account_photo_operator_test.cpp" ]

View File

@ -17,6 +17,14 @@ import("../../../../services/accountmgr/os_account_service.gni")
module_output_path = "os_account/tools"
ohos_moduletest("account_command_create_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${ability_runtime_path}/tools/test/systemtest/aa" ]
@ -56,6 +64,14 @@ ohos_moduletest("account_command_create_module_test") {
}
ohos_moduletest("account_command_create_module_mock_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
@ -148,6 +164,14 @@ ohos_moduletest("account_command_create_module_mock_test") {
}
ohos_moduletest("account_command_delete_module_mock_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [
@ -240,6 +264,14 @@ ohos_moduletest("account_command_delete_module_mock_test") {
}
ohos_moduletest("account_command_delete_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${ability_runtime_path}/tools/test/systemtest/aa" ]
@ -279,6 +311,14 @@ ohos_moduletest("account_command_delete_module_test") {
}
ohos_moduletest("account_command_dump_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${ability_runtime_path}/tools/test/systemtest/aa" ]
@ -318,6 +358,14 @@ ohos_moduletest("account_command_dump_module_test") {
}
ohos_moduletest("account_command_set_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${ability_runtime_path}/tools/test/systemtest/aa" ]
@ -357,6 +405,14 @@ ohos_moduletest("account_command_set_module_test") {
}
ohos_moduletest("account_command_switch_module_test") {
branch_protector_ret = "pac_ret"
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
module_out_path = module_output_path
include_dirs = [ "${ability_runtime_path}/tools/test/systemtest/aa" ]