fix: fix the crash because of cfi_check

Signed-off-by: wdh122119 <wangchunyang3@huawei.com>
This commit is contained in:
wdh122119 2023-12-23 18:37:05 +08:00
parent ea76314c23
commit cfea571034
3 changed files with 57 additions and 0 deletions

8
test/cfi_blocklist.txt Normal file
View File

@ -0,0 +1,8 @@
src:*powermgr/power_manager/test/mock/action/*
src:*powermgr/power_manager/test/systemtest/mock/*
src:*powermgr/power_manager/test/systemtest/include/*
src:*powermgr/power_manager/test/systemtest/src/*
src:*powermgr/power_manager/test/unittest/include/*
src:*powermgr/power_manager/test/unittest/src/*
src:*third_party/googletest/googlemock/include/gmock/*
src:*third_party/googletest/googletest/include/gtest/*

View File

@ -56,6 +56,13 @@ deps_ex = [
ohos_systemtest("test_power_mgr_mock_system") {
module_out_path = module_output_path
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
sources = [ "src/power_mgr_mock_system_test.cpp" ]
configs = [
@ -208,6 +215,13 @@ ohos_systemtest("test_power_level_event_system_test_on") {
ohos_systemtest("test_power_st_mgr_mock") {
module_out_path = module_output_path
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
sources = [ "src/power_mgr_st_mock_test.cpp" ]
configs = [
@ -232,6 +246,13 @@ ohos_systemtest("test_power_st_mgr_mock") {
ohos_systemtest("test_power_st_mgr_mock_suspend") {
module_out_path = module_output_path
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
sources = [ "src/power_mgr_st_suspend_test.cpp" ]
configs = [

View File

@ -321,6 +321,13 @@ ohos_unittest("test_power_state_machine") {
ohos_unittest("test_power_mgr_mock") {
module_out_path = module_output_path
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
sources = [ "src/power_mgr_mock_test.cpp" ]
configs = [
@ -595,6 +602,13 @@ ohos_unittest("test_power_mgr_service_native") {
module_out_path = module_output_path
defines = defs
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
defines += [ "THERMAL_GTEST" ]
sources = [ "src/power_mgr_service_native_test.cpp" ]
@ -731,6 +745,13 @@ ohos_unittest("test_running_lock_hub_native") {
ohos_unittest("test_running_lock_mock") {
module_out_path = module_output_path
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
sources = [ "src/running_lock_mock_test.cpp" ]
configs = [
@ -1047,6 +1068,13 @@ ohos_unittest("test_power_parsesources_mock") {
ohos_unittest("test_power_mgr_powerdialog") {
module_out_path = module_output_path
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
blocklist = "../cfi_blocklist.txt"
}
sources = [
"mock/mock_power_remote_object.cpp",
"src/power_mgr_powerdialog_test.cpp",