TDD目录结构重构

Signed-off-by: 123 <834689456@qq.com>
Change-Id: I35982b537307e069fb7d342bddc588498352f0bb
This commit is contained in:
123 2023-08-02 12:01:10 +08:00
parent 6a8a61d4b1
commit 9b59e85583
37 changed files with 448 additions and 268 deletions

View File

@ -46,6 +46,7 @@ group("account_build_moduletest") {
"${os_account_path}/frameworks/domain_account/test/moduletest:moduletest",
"${os_account_path}/frameworks/ohosaccount/test:moduletest",
"${os_account_path}/frameworks/osaccount/native/test/moduletest:moduletest",
"${os_account_path}/services/accountmgr/test/moduletest/common:moduletest",
"${os_account_path}/services/accountmgr/test/moduletest/os_account:moduletest",
"${os_account_path}/tools:moduletest",
]

View File

@ -16,7 +16,7 @@ import("//build/test.gni")
import("../../../../../os_account.gni")
import("../../../account_kits_headers.gni")
module_output_path = "os_account/frameworks/accountdfx"
module_output_path = "os_account/frameworks/ohos_account"
# mst test common config defines here
config("accountmgr_mst_test_config") {

View File

@ -14,7 +14,7 @@
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/frameworks"
module_output_path = "os_account/frameworks/os_account"
config("os_account_service_config_unittest") {
visibility = [ ":*" ]

View File

@ -30,6 +30,8 @@
"OHOS::AccountSA::AccountMgrService::Init()";
"OHOS::AccountSA::AccountStateMachine::Clean()";
"OHOS::AccountSA::OhosAccountManager::GetInstance()";
"OHOS::AccountSA::AccountEventSubscriber::AccountEventSubscriber(OHOS::AccountSA::AccountCommonEventCallback const&)";
"OHOS::AccountSA::AccountEventSubscriber::CreateEventSubscribe()";
"OHOS::AccountSA::AccountStateMachine::OnInitialize()";
"OHOS::AccountSA::AccountStateMachine::StateChangeProcess(int)";
"OHOS::AccountSA::DomainAccountManagerService::DomainAccountManagerService()";

View File

@ -34,13 +34,9 @@ group("unittest") {
testonly = true
deps = [
"unittest/ability_manager_adapter:unittest",
"unittest/account_event_provider_test:unittest",
"unittest/account_file_operator_test:unittest",
"unittest/account_iam_callback_test:unittest",
"unittest/account_mgr_service_test:unittest",
"unittest/common:unittest",
"unittest/domain_account:unittest",
"unittest/ohos_account_data_deal_test:unittest",
"unittest/ohos_account:unittest",
"unittest/os_account:unittest",
]
if (has_user_auth_part) {

View File

@ -789,7 +789,6 @@ group("moduletest") {
testonly = true
deps = [
":account_permission_manager_module_test",
":app_account_authenticate_test",
":app_account_authenticator_callback_test",
":app_account_authenticator_session_manager_module_test",
@ -805,6 +804,5 @@ group("moduletest") {
":app_account_manager_service_sync_module_test",
":app_account_subscribe_manager_test",
":at_not_mock_app_account_manager_service_module_test",
":bundle_manager_adapter_module_test",
]
}

View File

@ -0,0 +1,102 @@
# Copyright (c) 2023 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.
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/services/common"
config("app_account_service_config_mock") {
include_dirs = [
"//third_party/googletest/googlemock/include",
"${app_account_services_path}/test/mock/app_account",
"${app_account_services_path}/test/mock/common",
"${app_account_innerkits_native_path}/include",
]
}
config("app_account_service_config_unittest") {
visibility = [ ":*" ]
include_dirs = []
cflags = []
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
}
defines = [
"ACCOUNT_LOG_TAG = \"AccountCommonMTest\"",
"LOG_DOMAIN = 0xD001B00",
]
}
ohos_moduletest("account_permission_manager_module_test") {
module_out_path = module_output_path
sources = [ "account_permission_manager_module_test.cpp" ]
deps = [
"${common_path}:libaccount_common",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
]
}
ohos_moduletest("bundle_manager_adapter_module_test") {
module_out_path = module_output_path
include_dirs =
[ "${services_path}/accountmgr/include/bundle_manager_adapter" ]
sources = [
"${services_path}/accountmgr/src/bundle_manager_adapter/bundle_manager_adapter_proxy.cpp",
"bundle_manager_adapter_module_test.cpp",
]
configs = [ ":app_account_service_config_unittest" ]
deps = [
"${app_account_services_path}:accountmgr",
"${common_path}:libaccount_common",
"${innerkits_native_path}:libaccountkits",
"//third_party/googletest:gtest_main",
]
external_deps = [
"ability_base:want",
"ability_runtime:app_manager",
"ability_runtime:wantagent_innerkits",
"bundle_framework:appexecfwk_base",
"bundle_framework:appexecfwk_core",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
"samgr:samgr_proxy",
]
}
group("moduletest") {
testonly = true
deps = [
":account_permission_manager_module_test",
":bundle_manager_adapter_module_test",
]
}

View File

@ -15,7 +15,7 @@ import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/os_account"
config("os_account_manager_service_test_config") {
include_dirs = [

View File

@ -35,6 +35,88 @@ config("account_iam_native_config_unittest") {
]
}
ohos_unittest("account_iam_service_test") {
module_out_path = module_output_path
sources = [ "account_iam_service_test.cpp" ]
configs = [ ":account_iam_native_config_unittest" ]
deps = [
"${account_iam_framework_path}:account_iam_innerkits",
"${common_path}:libaccount_common",
"${services_path}/accountmgr:accountmgr",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
"os_account:os_account_innerkits",
]
cflags_cc = []
if (has_pin_auth_part) {
cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
external_deps += [ "pin_auth:pinauth_framework" ]
}
if (has_user_auth_part) {
cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
external_deps += [ "user_auth_framework:userauth_client" ]
}
}
ohos_unittest("account_iam_callback_test") {
module_out_path = module_output_path
sources = [
"${domain_account_framework_path}/test/moduletest/src/mock_domain_plugin.cpp",
"account_iam_callback_test.cpp",
]
configs = [ ":account_iam_native_config_unittest" ]
deps = [
"${account_iam_framework_path}:account_iam_innerkits",
"${common_path}:libaccount_common",
"${domain_account_framework_path}:domain_account_innerkits",
"${os_account_core_path}:os_account_core",
"${os_account_innerkits_native_path}:os_account_innerkits",
"${services_path}/accountmgr:accountmgr",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
include_dirs = [
"${os_account_path}/frameworks/domain_account/test/moduletest/include/",
"${os_account_interfaces_native_path}/include/",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
]
cflags_cc = []
if (has_pin_auth_part) {
cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
external_deps += [ "pin_auth:pinauth_framework" ]
}
if (has_user_auth_part) {
cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
external_deps += [ "user_auth_framework:userauth_client" ]
}
}
ohos_unittest("account_iam_manager_test") {
module_out_path = module_output_path
@ -82,5 +164,9 @@ ohos_unittest("account_iam_manager_test") {
group("unittest") {
testonly = true
deps = [ ":account_iam_manager_test" ]
deps = [
":account_iam_callback_test",
":account_iam_manager_test",
":account_iam_service_test",
]
}

View File

@ -1,124 +0,0 @@
# 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.
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/account_iam/services"
config("account_iam_native_config_unittest") {
visibility = [ ":*" ]
include_dirs = [ "${app_account_services_path}/include/account_iam" ]
cflags = []
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
}
defines = [
"ACCOUNT_LOG_TAG = \"AccountIAMUTestFwk\"",
"LOG_DOMAIN = 0xD001B00",
]
}
ohos_unittest("account_iam_callback_test") {
module_out_path = module_output_path
sources = [
"${domain_account_framework_path}/test/moduletest/src/mock_domain_plugin.cpp",
"account_iam_callback_test.cpp",
]
configs = [ ":account_iam_native_config_unittest" ]
deps = [
"${account_iam_framework_path}:account_iam_innerkits",
"${common_path}:libaccount_common",
"${domain_account_framework_path}:domain_account_innerkits",
"${os_account_core_path}:os_account_core",
"${os_account_innerkits_native_path}:os_account_innerkits",
"${services_path}/accountmgr:accountmgr",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
include_dirs = [
"${os_account_path}/frameworks/domain_account/test/moduletest/include/",
"${os_account_interfaces_native_path}/include/",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
]
cflags_cc = []
if (has_pin_auth_part) {
cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
external_deps += [ "pin_auth:pinauth_framework" ]
}
if (has_user_auth_part) {
cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
external_deps += [ "user_auth_framework:userauth_client" ]
}
}
ohos_unittest("account_iam_service_test") {
module_out_path = module_output_path
sources = [ "account_iam_service_test.cpp" ]
configs = [ ":account_iam_native_config_unittest" ]
deps = [
"${account_iam_framework_path}:account_iam_innerkits",
"${common_path}:libaccount_common",
"${services_path}/accountmgr:accountmgr",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
"os_account:os_account_innerkits",
]
cflags_cc = []
if (has_pin_auth_part) {
cflags_cc += [ "-DHAS_PIN_AUTH_PART" ]
external_deps += [ "pin_auth:pinauth_framework" ]
}
if (has_user_auth_part) {
cflags_cc += [ "-DHAS_USER_AUTH_PART" ]
external_deps += [ "user_auth_framework:userauth_client" ]
}
}
group("unittest") {
testonly = true
deps = [
":account_iam_callback_test",
":account_iam_service_test",
]
}

View File

@ -40,35 +40,6 @@ config("app_account_service_config_unittest") {
]
}
ohos_unittest("account_permission_manager_test") {
module_out_path = module_output_path
sources = [
"${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp",
"${common_path}/utils/src/account_permission_manager.cpp",
"account_permission_manager_test.cpp",
]
configs = [
":app_account_service_config_mock",
":app_account_service_config_unittest",
]
deps = [
"${common_path}:libaccount_common",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
]
}
ohos_unittest("app_account_data_storage_test") {
module_out_path = module_output_path
@ -231,7 +202,6 @@ group("unittest") {
testonly = true
deps = [
":account_permission_manager_test",
":app_account_data_storage_test",
":app_account_info_test",
":app_account_manager_service_test",

View File

@ -0,0 +1,25 @@
# Copyright (c) 2023 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.
import("../../../../../os_account.gni")
group("unittest") {
testonly = true
deps = [
"ability_manager_adapter:unittest",
"account_event_provider_test:unittest",
"account_file_operator_test:unittest",
"account_mgr_service_test:unittest",
"account_permission_manager_test:unittest",
]
}

View File

@ -1,4 +1,4 @@
# Copyright (c) 2022-2023 Huawei Device Co., Ltd.
# Copyright (c) 2023 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
@ -13,9 +13,9 @@
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
import("../../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/common"
config("ability_manager_adapter_test_config") {
include_dirs = [

View File

@ -13,9 +13,9 @@
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
import("../../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/common"
config("accountmgr_event_provider_test_config") {
include_dirs = [

View File

@ -13,9 +13,9 @@
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
import("../../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/common"
config("account_file_operator_test_config") {
include_dirs = [
@ -31,8 +31,6 @@ config("account_file_operator_test_config") {
ohos_unittest("AccountFileOperatorTest") {
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [ "account_file_operator_test.cpp" ]

View File

@ -13,9 +13,9 @@
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
import("../../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/common"
config("bundle_manager_config") {
include_dirs = [
@ -43,7 +43,6 @@ ohos_unittest("account_mgr_test") {
"account_dump_helper_test.cpp",
"account_mgr_service_test.cpp",
"account_state_machine_test.cpp",
"ohos_account_manager_test.cpp",
]
sources += bundle_manager_sources

View File

@ -0,0 +1,76 @@
# Copyright (c) 2023 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.
import("//build/test.gni")
import("../../../../../../os_account.gni")
module_output_path = "os_account/services/app_account"
config("app_account_service_config_mock") {
include_dirs = [
"//third_party/googletest/googlemock/include",
"${app_account_services_path}/test/mock/app_account",
"${app_account_services_path}/test/mock/common",
]
}
config("app_account_service_config_unittest") {
visibility = [ ":*" ]
include_dirs = []
cflags = []
if (target_cpu == "arm") {
cflags += [ "-DBINDER_IPC_32BIT" ]
}
defines = [
"ACCOUNT_LOG_TAG = \"AppAccountUTest\"",
"LOG_DOMAIN = 0xD001B00",
]
}
ohos_unittest("account_permission_manager_test") {
module_out_path = module_output_path
sources = [
"${app_account_services_path}/test/mock/app_account/accesstoken_kit.cpp",
"${common_path}/utils/src/account_permission_manager.cpp",
"account_permission_manager_test.cpp",
]
configs = [
":app_account_service_config_mock",
":app_account_service_config_unittest",
]
deps = [
"${common_path}:libaccount_common",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libtoken_setproc",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
]
}
group("unittest") {
testonly = true
deps = [ ":account_permission_manager_test" ]
}

View File

@ -15,7 +15,7 @@ import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/domain_account"
config("domain_account_service_config_unittest") {
visibility = [ ":*" ]
@ -55,8 +55,6 @@ config("domain_account_amgr_mock_config") {
ohos_unittest("DomainAccountInnerServiceCovTest") {
cflags_cc = []
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [
"${domain_account_framework_path}/test/moduletest/src/mock_domain_plugin.cpp",

View File

@ -0,0 +1,138 @@
# Copyright (c) 2023 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.
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/services/ohos_account"
config("accountmgr_data_deal_test_config") {
include_dirs = [
"./include",
"${app_account_core_path}/include",
"${app_account_interfaces_native_path}/include",
"${common_path}/log/include",
"${common_path}/account_error/include",
"${os_account_dfx_path}/hisysevent_adapter",
"${services_path}/accountmgr/include",
"//third_party/json/include",
"${innerkits_path}/include",
]
}
ohos_unittest("OhosServiceTest") {
module_out_path = module_output_path
cflags_cc = []
include_dirs = [
"${account_iam_interfaces_native_path}/include",
"${os_account_interfaces_native_path}/include",
"${os_account_core_path}/include",
]
sources = [
"${common_path}/log/src/account_log_wrapper.cpp",
"${os_account_dfx_path}/hisysevent_adapter/hisysevent_adapter.cpp",
"${services_path}/accountmgr/src/account_event_provider.cpp",
"${services_path}/accountmgr/src/account_mgr_service.cpp",
"${services_path}/accountmgr/src/ohos_account_data_deal.cpp",
"${services_path}/accountmgr/src/ohos_account_manager.cpp",
]
sources += [ "ohos_account_manager_test.cpp" ]
configs = [
":accountmgr_data_deal_test_config",
"${services_path}/accountmgr:accountmgr_config",
"${services_path}/accountmgr/test:accountmgr_test_config",
]
deps = [
"${common_path}:libaccount_common",
"${os_account_innerkits_native_path}:os_account_innerkits",
"${services_path}/accountmgr:accountmgr",
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
"//third_party/mbedtls:mbedtls",
]
external_deps = [
"ability_base:base",
"ability_base:want",
"ability_runtime:app_manager",
"c_utils:utils",
"hilog:libhilog",
"ipc:ipc_single",
"kv_store:distributeddata_inner",
"safwk:system_ability_fwk",
]
if (has_hiviewdfx_hisysevent_part) {
cflags_cc += [ "-DHAS_HISYSEVENT_PART" ]
external_deps += [ "hisysevent:libhisysevent" ]
}
if (has_ces_part) {
cflags_cc += [ "-DHAS_CES_PART" ]
external_deps += [ "common_event_service:cesfwk_innerkits" ]
}
part_name = "os_account"
}
ohos_unittest("OhosDataDealTest") {
module_out_path = module_output_path
cflags_cc = []
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
include_dirs = [
"${account_iam_interfaces_native_path}/include",
"${os_account_interfaces_native_path}/include",
"${os_account_core_path}/include",
]
sources = [
"${common_path}/log/src/account_log_wrapper.cpp",
"${os_account_dfx_path}/hisysevent_adapter/hisysevent_adapter.cpp",
"${services_path}/accountmgr/src/ohos_account_data_deal.cpp",
]
sources += [ "ohos_account_data_deal_test.cpp" ]
configs = [
":accountmgr_data_deal_test_config",
"${services_path}/accountmgr/test:accountmgr_test_config",
]
deps = [
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"ability_base:want",
"c_utils:utils",
"hilog:libhilog",
]
if (has_hiviewdfx_hisysevent_part) {
cflags_cc += [ "-DHAS_HISYSEVENT_PART" ]
external_deps += [ "hisysevent:libhisysevent" ]
}
part_name = "os_account"
}
group("unittest") {
testonly = true
deps = [
":OhosDataDealTest",
":OhosServiceTest",
]
}

View File

@ -18,7 +18,6 @@
#define private public
#include "ohos_account_manager.h"
#undef private
#include "accesstoken_kit.h"
#include "account_helper_data.h"
#include "account_info.h"
#include "account_log_wrapper.h"

View File

@ -1,74 +0,0 @@
# Copyright (c) 2021-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.
import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
config("accountmgr_data_deal_test_config") {
include_dirs = [
"./include",
"${app_account_core_path}/include",
"${app_account_interfaces_native_path}/include",
"${common_path}/log/include",
"${common_path}/account_error/include",
"${os_account_dfx_path}/hisysevent_adapter",
"${services_path}/accountmgr/include",
"//third_party/json/include",
"${innerkits_path}/include",
]
}
ohos_unittest("AccountSADataDealTest") {
module_out_path = module_output_path
cflags_cc = []
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [
"${common_path}/log/src/account_log_wrapper.cpp",
"${os_account_dfx_path}/hisysevent_adapter/hisysevent_adapter.cpp",
"${services_path}/accountmgr/src/ohos_account_data_deal.cpp",
]
sources += [ "ohos_account_data_deal_test.cpp" ]
configs = [
":accountmgr_data_deal_test_config",
"${services_path}/accountmgr/test:accountmgr_test_config",
]
deps = [
"//third_party/googletest:gmock_main",
"//third_party/googletest:gtest_main",
]
external_deps = [
"ability_base:want",
"c_utils:utils",
"hilog:libhilog",
]
if (has_hiviewdfx_hisysevent_part) {
cflags_cc += [ "-DHAS_HISYSEVENT_PART" ]
external_deps += [ "hisysevent:libhisysevent" ]
}
part_name = "os_account"
}
group("unittest") {
testonly = true
deps = [ ":AccountSADataDealTest" ]
}

View File

@ -15,7 +15,7 @@ import("//build/ohos.gni")
import("//build/test.gni")
import("../../../../../os_account.gni")
module_output_path = "os_account/services/accountmgr"
module_output_path = "os_account/services/os_account"
config("os_account_control_file_manager_test_config") {
include_dirs = [
@ -31,8 +31,6 @@ config("os_account_control_file_manager_test_config") {
ohos_unittest("OsAccountControlFileManagerTest") {
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [ "os_account_control_file_manager_test.cpp" ]
configs = [
@ -73,8 +71,6 @@ config("os_account_data_storage_test_config") {
ohos_unittest("OsAccountDataStorageTest") {
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [ "os_account_data_storage_test.cpp" ]
configs = [
@ -144,8 +140,6 @@ config("os_account_subscribe_death_recipient_test_config") {
ohos_unittest("OsAccountSubscribeDeathRecipientTest") {
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [
"${services_path}/accountmgr/test/mock/src/mock_account_mgr_service.cpp",
@ -194,8 +188,6 @@ config("os_account_amgr_test_config") {
ohos_unittest("OsAccountInnerAccmgrCovTest") {
cflags_cc = []
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [
"os_account_inner_account_mgr_cov.cpp",
@ -251,8 +243,6 @@ config("os_account_amgr_mock_config") {
ohos_unittest("OsAccountInnerAccmgrMockTest") {
module_out_path = module_output_path
resource_config_file =
"${os_account_path}/test/resource/accountmgrservice/ohos_test.xml"
sources = [
"${services_path}/accountmgr/test/mock/os_account/os_account_interface.cpp",

View File

@ -13,7 +13,7 @@
limitations under the License.
-->
<configuration ver="2.0">
<target name="AccountSADataDealTest">
<target name="OhosDataDealTest">
<preparer>
<option name="push" value="data_deal/100/account.json -> /data/test/account/data_deal/100" src="res"/>
<option name="push" value="data_deal/200/account.json -> /data/test/account/data_deal/200" src="res"/>