diff --git a/cfi_blocklist.txt b/cfi_blocklist.txt index 52f66a6bd..23e0db966 100644 --- a/cfi_blocklist.txt +++ b/cfi_blocklist.txt @@ -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 \ No newline at end of file diff --git a/frameworks/appaccount/native/test/moduletest/BUILD.gn b/frameworks/appaccount/native/test/moduletest/BUILD.gn index 6876d1540..2686b38b8 100644 --- a/frameworks/appaccount/native/test/moduletest/BUILD.gn +++ b/frameworks/appaccount/native/test/moduletest/BUILD.gn @@ -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" ] diff --git a/frameworks/domain_account/test/moduletest/BUILD.gn b/frameworks/domain_account/test/moduletest/BUILD.gn index 74dad133a..f0abf342e 100644 --- a/frameworks/domain_account/test/moduletest/BUILD.gn +++ b/frameworks/domain_account/test/moduletest/BUILD.gn @@ -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" ] diff --git a/frameworks/ohosaccount/test/moduletests/account_mgr_test/BUILD.gn b/frameworks/ohosaccount/test/moduletests/account_mgr_test/BUILD.gn index 1441ef3d9..d30f20e14 100644 --- a/frameworks/ohosaccount/test/moduletests/account_mgr_test/BUILD.gn +++ b/frameworks/ohosaccount/test/moduletests/account_mgr_test/BUILD.gn @@ -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" ] diff --git a/frameworks/osaccount/native/test/moduletest/BUILD.gn b/frameworks/osaccount/native/test/moduletest/BUILD.gn index 7f82cfc82..ba32357b5 100644 --- a/frameworks/osaccount/native/test/moduletest/BUILD.gn +++ b/frameworks/osaccount/native/test/moduletest/BUILD.gn @@ -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", diff --git a/services/accountmgr/test/moduletest/app_account/BUILD.gn b/services/accountmgr/test/moduletest/app_account/BUILD.gn index 98bbcead8..5375412da 100644 --- a/services/accountmgr/test/moduletest/app_account/BUILD.gn +++ b/services/accountmgr/test/moduletest/app_account/BUILD.gn @@ -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" ] diff --git a/services/accountmgr/test/moduletest/common/BUILD.gn b/services/accountmgr/test/moduletest/common/BUILD.gn index ca9415c27..551fe51c4 100644 --- a/services/accountmgr/test/moduletest/common/BUILD.gn +++ b/services/accountmgr/test/moduletest/common/BUILD.gn @@ -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" ] diff --git a/services/accountmgr/test/moduletest/os_account/BUILD.gn b/services/accountmgr/test/moduletest/os_account/BUILD.gn index 9de670a69..9a056dda8 100644 --- a/services/accountmgr/test/moduletest/os_account/BUILD.gn +++ b/services/accountmgr/test/moduletest/os_account/BUILD.gn @@ -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" ] diff --git a/tools/test/moduletest/acm/BUILD.gn b/tools/test/moduletest/acm/BUILD.gn index c83f1d8c7..a2d43423b 100644 --- a/tools/test/moduletest/acm/BUILD.gn +++ b/tools/test/moduletest/acm/BUILD.gn @@ -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" ]