dmsfwk gn添加覆盖率插桩适配

Change-Id: I698878afefb24f612b0ad45b754cf60303950293
Signed-off-by: wangyang2022 <wangyang412@huawei.com>
This commit is contained in:
wangyang2022 2022-08-22 11:18:31 +08:00
parent 26e693b897
commit 557a20466d
10 changed files with 90 additions and 28 deletions

View File

@ -19,6 +19,7 @@
],
"adapted_system_type": [ "standard" ],
"features" : [
"dmsfwk_feature_coverage = false",
"dmsfwk_standard_form_share",
"dmsfwk_mission_manager"
],

View File

@ -34,7 +34,10 @@ ohos_shared_library("common_sdk") {
"//foundation/ability/dmsfwk/services/dtbabilitymgr/src/distributed_ability_manager_proxy.cpp",
]
public_configs = [ ":common_public_config" ]
public_configs = [
":common_public_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
external_deps = [
"ability_base:want",

View File

@ -33,7 +33,10 @@ ohos_shared_library("continuation_manager") {
"//foundation/ability/dmsfwk/services/dtbabilitymgr/src/continuation_manager/device_selection_notifier_stub.cpp",
]
public_configs = [ ":continuation_manager_public_config" ]
public_configs = [
":continuation_manager_public_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
external_deps = [
"c_utils:utils",

View File

@ -33,7 +33,10 @@ ohos_shared_library("continuationmanager_napi") {
"js_device_selection_listener.cpp",
]
public_configs = [ ":continuationmanager_napi_public_config" ]
public_configs = [
":continuationmanager_napi_public_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
deps = [ "//foundation/ability/ability_runtime/frameworks/js/napi/inner/napi_common:napi_common" ]

View File

@ -32,9 +32,10 @@ ohos_shared_library("dmsbaseinner") {
"src/distributed_device_node_listener.cpp",
"src/dtbschedmgr_device_info_storage.cpp",
]
configs = [ ":distributed_sched_config" ]
public_configs = [ ":distributed_sched_config" ]
public_configs = [
":distributed_sched_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
external_deps = [
"c_utils:utils",

View File

@ -23,7 +23,6 @@ config("distributed_ability_manager_config") {
visibility = [ ":*" ]
include_dirs = [
"include/",
"../base/include/",
"//foundation/ability/dmsfwk/interfaces/innerkits/common/include/",
"//foundation/ability/dmsfwk/interfaces/innerkits/continuation_manager/include/",
]
@ -44,7 +43,10 @@ ohos_shared_library("distributed_ability_manager_svr") {
"src/distributed_ability_manager_stub.cpp",
]
configs = [ ":distributed_ability_manager_config" ]
configs = [
":distributed_ability_manager_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
ldflags = [ "-rdynamic" ]

View File

@ -26,10 +26,7 @@ dtbabilitymgr_configs = [
config("test_config") {
visibility = [ ":*" ]
include_dirs = [
"//foundation/ability/dmsfwk/utils/native/include",
"//foundation/ability/dmsfwk/services/base/include",
]
include_dirs = [ "//foundation/ability/dmsfwk/utils/native/include" ]
}
dtbabilitymgr_external_deps = [
@ -68,7 +65,10 @@ ohos_unittest("continuationmanagertest") {
module_out_path = module_output_path
sources = [ "unittest/continuation_manager/continuation_manager_test.cpp" ]
sources += dtbabilitymgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dtbabilitymgr_configs
deps =
[ "${distributed_service}/dtbabilitymgr:distributed_ability_manager_svr" ]

View File

@ -22,10 +22,7 @@ group("unittest") {
config("distributed_sched_config") {
visibility = [ ":*" ]
include_dirs = [
"include",
"../base/include/",
]
include_dirs = [ "include" ]
if (dmsfwk_mission_manager) {
defines = [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ]
}
@ -57,7 +54,10 @@ ohos_shared_library("distributedschedsvr") {
"src/dms_token_callback.cpp",
]
configs = [ ":distributed_sched_config" ]
configs = [
":distributed_sched_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
external_deps = [
"ability_base:want",

View File

@ -27,7 +27,6 @@ config("test_config") {
visibility = [ ":*" ]
include_dirs = [
"//foundation/ability/dmsfwk/utils/native/include",
"//foundation/ability/dmsfwk/services/base/include",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/unittest",
]
}
@ -120,7 +119,10 @@ ohos_unittest("distributedschedsvrtest") {
sources = [ "unittest/distributed_sched_service_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
if (is_standard_system) {
external_deps = dsched_external_deps
@ -135,7 +137,10 @@ ohos_unittest("distributedcalltest") {
sources = [ "unittest/distributed_sched_call_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
if (is_standard_system) {
external_deps = dsched_external_deps
@ -153,7 +158,10 @@ ohos_unittest("dschedcontinuetest") {
"unittest/mock_distributed_sched.cpp",
]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
if (is_standard_system) {
external_deps = dsched_external_deps
@ -177,7 +185,10 @@ ohos_unittest("dschedconnecttest") {
sources = [ "unittest/distributed_sched_connect_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
if (is_standard_system) {
external_deps = dsched_external_deps
@ -192,7 +203,10 @@ ohos_unittest("dschedpermissiontest") {
sources = [ "unittest/distributed_sched_permission_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
if (is_standard_system) {
external_deps = dsched_external_deps
@ -206,7 +220,10 @@ ohos_unittest("dschedmissionmanagertest") {
module_out_path = module_output_path
sources = [ "unittest/mission/dms_mission_manager_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
deps = [ "${distributed_service}/dtbschedmgr:distributedschedsvr" ]
if (is_standard_system) {
@ -221,7 +238,10 @@ ohos_unittest("dscheddatastoragetest") {
module_out_path = module_output_path
sources = [ "unittest/mission/distributed_data_storage_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
deps = [ "${distributed_service}/dtbschedmgr:distributedschedsvr" ]
if (is_standard_system) {
@ -235,7 +255,10 @@ ohos_unittest("bundlemanagerinternaltest") {
module_out_path = module_output_path
sources = [ "unittest/bundle_manager_internal_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
deps = [ "${distributed_service}/dtbschedmgr:distributedschedsvr" ]
if (is_standard_system) {
@ -249,7 +272,10 @@ ohos_unittest("hisyseventreporttest") {
module_out_path = module_output_path
sources = [ "unittest/dms_hisysevent_report_test.cpp" ]
sources += dtbschedmgr_sources
configs = [ ":test_config" ]
configs = [
":test_config",
"//foundation/ability/dmsfwk/services/dtbschedmgr/test/resource:coverage_flags",
]
configs += dsched_configs
deps = [ "${distributed_service}/dtbschedmgr:distributedschedsvr" ]
if (is_standard_system) {

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() {
dmsfwk_feature_coverage = false
}
config("coverage_flags") {
if (dmsfwk_feature_coverage) {
cflags = [ "--coverage" ]
ldflags = [ "--coverage" ]
}
}