add gn args option of coverage generation

Signed-off-by: zaki <zhoujun141@huawei.com>
Change-Id: Ie0c8e00be41fb4fe4a03d2de38a2216f4a0933cc
This commit is contained in:
zaki 2022-09-15 21:34:31 +08:00
parent ab4417da50
commit 8aa334c7f1
20 changed files with 175 additions and 52 deletions

View File

@ -18,7 +18,7 @@
"SystemCapability.BarrierFree.Accessibility.Hearing", "SystemCapability.BarrierFree.Accessibility.Hearing",
"SystemCapability.BarrierFree.Accessibility.Vision" "SystemCapability.BarrierFree.Accessibility.Vision"
], ],
"features": [], "features": [ "accessibility_feature_coverage = false" ],
"adapted_system_type": [ "adapted_system_type": [
"standard" "standard"
], ],

View File

@ -69,7 +69,10 @@ ohos_shared_library("accessibility_interface") {
sources = accessibility_interface_src sources = accessibility_interface_src
sources += accessibility_data_parcel_src sources += accessibility_data_parcel_src
configs = [ ":accessibility_interface_private_config" ] configs = [
":accessibility_interface_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
public_configs = [ ":accessibility_interface_public_config" ] public_configs = [ ":accessibility_interface_public_config" ]

View File

@ -102,7 +102,10 @@ ohos_unittest("accessible_ability_test") {
] ]
sources += aams_mock_multimodalinput_src sources += aams_mock_multimodalinput_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",

View File

@ -50,7 +50,10 @@ ohos_unittest("ac_unit_test") {
"unittest/accessibility_config_impl_test.cpp", "unittest/accessibility_config_impl_test.cpp",
] ]
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",

View File

@ -88,7 +88,10 @@ ohos_unittest("asac_unit_test") {
"unittest/accessibility_system_ability_client_impl_test.cpp", "unittest/accessibility_system_ability_client_impl_test.cpp",
] ]
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",

View File

@ -42,7 +42,10 @@ ohos_unittest("accessibility_common_test") {
"unittest/accessibility_window_info_test.cpp", "unittest/accessibility_window_info_test.cpp",
] ]
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common", "//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common",

View File

@ -46,7 +46,10 @@ ohos_shared_library("accessibleability") {
configs = [ ":accessibleability_private_config" ] configs = [ ":accessibleability_private_config" ]
public_configs = [ ":accessibleability_public_config" ] public_configs = [
":accessibleability_public_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",

View File

@ -41,7 +41,10 @@ acfwk_src = [
ohos_shared_library("accessibilityconfig") { ohos_shared_library("accessibilityconfig") {
sources = acfwk_src sources = acfwk_src
configs = [ ":accessibilityconfig_private_config" ] configs = [
":accessibilityconfig_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
public_configs = [ ":accessibilityconfig_public_config" ] public_configs = [ ":accessibilityconfig_public_config" ]

View File

@ -41,7 +41,10 @@ asacfwk_src = [
ohos_shared_library("accessibilityclient") { ohos_shared_library("accessibilityclient") {
sources = asacfwk_src sources = asacfwk_src
configs = [ ":accessibilityclient_private_config" ] configs = [
":accessibilityclient_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
public_configs = [ ":accessibilityclient_public_config" ] public_configs = [ ":accessibilityclient_public_config" ]

View File

@ -44,7 +44,10 @@ accessibility_common_src = [
ohos_shared_library("accessibility_common") { ohos_shared_library("accessibility_common") {
sources = accessibility_common_src sources = accessibility_common_src
configs = [ ":accessibility_common_private_config" ] configs = [
":accessibility_common_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
public_configs = [ ":accessibility_common_public_config" ] public_configs = [ ":accessibility_common_public_config" ]

View File

@ -10,7 +10,14 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
config("configs_cc_ld") {
cflags = [
"-g",
"-O0",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
]
}
group("fuzztest") { group("fuzztest") {
testonly = true testonly = true

View File

@ -20,11 +20,9 @@ ohos_fuzztest("AccessibilityConfigFuzzTest") {
module_out_path = "accessibility/acfwk" module_out_path = "accessibility/acfwk"
fuzz_config_file = "../../fuzztest/accessibilityconfig_fuzzer" fuzz_config_file = "../../fuzztest/accessibilityconfig_fuzzer"
cflags = [ configs = [
"-g", "//foundation/barrierfree/accessibility/interfaces/innerkits/test/fuzztest:configs_cc_ld",
"-O0", "//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
] ]
sources = [ "accessibilityconfig_fuzzer.cpp" ] sources = [ "accessibilityconfig_fuzzer.cpp" ]
deps = [ "//foundation/barrierfree/accessibility/interfaces/innerkits/acfwk:accessibilityconfig" ] deps = [ "//foundation/barrierfree/accessibility/interfaces/innerkits/acfwk:accessibilityconfig" ]

View File

@ -21,11 +21,9 @@ ohos_fuzztest("AccessibilitySystemAbilityClientFuzzTest") {
fuzz_config_file = "../../fuzztest/accessibilitysystemabilityclient_fuzzer" fuzz_config_file = "../../fuzztest/accessibilitysystemabilityclient_fuzzer"
include_dirs = [] include_dirs = []
cflags = [ configs = [
"-g", "//foundation/barrierfree/accessibility/interfaces/innerkits/test/fuzztest:configs_cc_ld",
"-O0", "//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
] ]
sources = [ "accessibilitysystemabilityclient_fuzzer.cpp" ] sources = [ "accessibilitysystemabilityclient_fuzzer.cpp" ]
deps = [ "//foundation/barrierfree/accessibility/interfaces/innerkits/asacfwk:accessibilityclient" ] deps = [ "//foundation/barrierfree/accessibility/interfaces/innerkits/asacfwk:accessibilityclient" ]

View File

@ -21,11 +21,9 @@ ohos_fuzztest("AccessibleAbilityClientFuzzTest") {
fuzz_config_file = "../../fuzztest/accessibleabilityclient_fuzzer" fuzz_config_file = "../../fuzztest/accessibleabilityclient_fuzzer"
include_dirs = [] include_dirs = []
cflags = [ configs = [
"-g", "//foundation/barrierfree/accessibility/interfaces/innerkits/test/fuzztest:configs_cc_ld",
"-O0", "//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
"-Wno-unused-variable",
"-fno-omit-frame-pointer",
] ]
sources = [ "accessibleabilityclient_fuzzer.cpp" ] sources = [ "accessibleabilityclient_fuzzer.cpp" ]
deps = [ "//foundation/barrierfree/accessibility/interfaces/innerkits/aafwk:accessibleability" ] deps = [ "//foundation/barrierfree/accessibility/interfaces/innerkits/aafwk:accessibleability" ]

View File

@ -33,7 +33,7 @@ ohos_shared_library("accessibility") {
"./src/native_module.cpp", "./src/native_module.cpp",
] ]
configs = [] configs = [ "//foundation/barrierfree/accessibility/resources/config/build:coverage_flags" ]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",

View File

@ -30,7 +30,7 @@ ohos_shared_library("config_napi") {
"./src/native_module.cpp", "./src/native_module.cpp",
] ]
configs = [] configs = [ "//foundation/barrierfree/accessibility/resources/config/build:coverage_flags" ]
deps = [ deps = [
"//foundation/ability/ability_runtime/frameworks/native/ability/native:abilitykit_native", "//foundation/ability/ability_runtime/frameworks/native/ability/native:abilitykit_native",

View File

@ -0,0 +1,23 @@
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
declare_args() {
accessibility_feature_coverage = false
}
config("coverage_flags") {
if (accessibility_feature_coverage) {
cflags = [ "--coverage" ]
ldflags = [ "--coverage" ]
}
}

View File

@ -64,7 +64,10 @@ accessibleabilityms_files = [
ohos_shared_library("accessibleabilityms") { ohos_shared_library("accessibleabilityms") {
sources = accessibleabilityms_files sources = accessibleabilityms_files
configs = [ ":aams_service_config" ] configs = [
":aams_service_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//foundation/barrierfree/accessibility/common/interface:accessibility_interface", "//foundation/barrierfree/accessibility/common/interface:accessibility_interface",

View File

@ -90,7 +90,10 @@ ohos_unittest("accessibility_account_data_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_inner_api_path}/ability_manager:ability_manager", "${ability_runtime_inner_api_path}/ability_manager:ability_manager",
@ -142,7 +145,10 @@ ohos_unittest("accessible_ability_manager_service_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -208,7 +214,10 @@ ohos_unittest("accessibility_touch_guider_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -264,7 +273,10 @@ ohos_unittest("accessibility_common_event_registry_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -334,7 +346,10 @@ ohos_unittest("accessibility_input_interceptor_test") {
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
sources += aams_mock_multimodalinput_src sources += aams_mock_multimodalinput_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_inner_api_path}/ability_manager:ability_manager", "${ability_runtime_inner_api_path}/ability_manager:ability_manager",
@ -389,7 +404,10 @@ ohos_unittest("accessibility_window_manager_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_inner_api_path}/ability_manager:ability_manager", "${ability_runtime_inner_api_path}/ability_manager:ability_manager",
@ -454,7 +472,10 @@ ohos_unittest("accessibility_keyevent_filter_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -533,7 +554,10 @@ ohos_unittest("accessible_ability_connection_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -576,7 +600,10 @@ ohos_unittest("accessibility_display_manager_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -636,7 +663,10 @@ ohos_unittest("accessibility_dumper_test") {
] ]
sources += aams_mock_multimodalinput_src sources += aams_mock_multimodalinput_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common", "//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common",
@ -678,7 +708,10 @@ ohos_unittest("accessibility_touchevent_injector_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -739,7 +772,10 @@ ohos_unittest("accessible_ability_channel_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common", "//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common",
@ -781,7 +817,10 @@ ohos_unittest("accessibility_mouse_autoclick_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -820,7 +859,10 @@ ohos_unittest("accessibility_mouse_key_test") {
"unittest/accessibility_mouse_key_test.cpp", "unittest/accessibility_mouse_key_test.cpp",
] ]
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common", "//foundation/barrierfree/accessibility/interfaces/innerkits/common:accessibility_common",
@ -858,7 +900,10 @@ ohos_unittest("accessibility_short_key_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",
@ -898,7 +943,10 @@ ohos_unittest("accessibility_settings_config_test") {
"unittest/accessibility_settings_config_test.cpp", "unittest/accessibility_settings_config_test.cpp",
] ]
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_inner_api_path}/ability_manager:ability_manager", "${ability_runtime_inner_api_path}/ability_manager:ability_manager",
@ -950,7 +998,10 @@ ohos_unittest("accessibility_zoom_gesture_test") {
] ]
sources += aams_mock_distributeddatamgr_src sources += aams_mock_distributeddatamgr_src
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native", "${ability_runtime_path}/frameworks/native/ability/native:abilitykit_native",

View File

@ -125,7 +125,10 @@ ohos_moduletest("aams_accessibility_touch_guider_test") {
sources += aams_mock_powermanager_src sources += aams_mock_powermanager_src
sources += MockDistributedscheduleSrc sources += MockDistributedscheduleSrc
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",
@ -206,7 +209,10 @@ ohos_moduletest("aams_accessibility_touchEvent_injector_test") {
sources += aams_mock_powermanager_src sources += aams_mock_powermanager_src
sources += MockDistributedscheduleSrc sources += MockDistributedscheduleSrc
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",
@ -293,7 +299,10 @@ ohos_moduletest("aams_accessible_ability_channel_test") {
sources += aams_mock_powermanager_src sources += aams_mock_powermanager_src
sources += MockDistributedscheduleSrc sources += MockDistributedscheduleSrc
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",
@ -378,7 +387,10 @@ ohos_moduletest("aams_server_test") {
sources += aams_mock_powermanager_src sources += aams_mock_powermanager_src
sources += MockDistributedscheduleSrc sources += MockDistributedscheduleSrc
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",
@ -457,7 +469,10 @@ ohos_moduletest("aams_accessibility_keyevent_filter_test") {
sources += aams_mock_powermanager_src sources += aams_mock_powermanager_src
sources += MockDistributedscheduleSrc sources += MockDistributedscheduleSrc
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",
@ -542,7 +557,10 @@ ohos_moduletest("aams_common_event_registry_test") {
sources += aams_mock_powermanager_src sources += aams_mock_powermanager_src
sources += MockDistributedscheduleSrc sources += MockDistributedscheduleSrc
configs = [ ":module_private_config" ] configs = [
":module_private_config",
"//foundation/barrierfree/accessibility/resources/config/build:coverage_flags",
]
deps = [ deps = [
"//base/global/resource_management/frameworks/resmgr:global_resmgr", "//base/global/resource_management/frameworks/resmgr:global_resmgr",