1# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//base/notification/distributed_notification_service/notification.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17import("//foundation/ability/ability_runtime/ability_runtime.gni")
18
19module_output_path = "${component_name}/moduletest"
20
21ohos_moduletest("ans_module_test") {
22  module_out_path = module_output_path
23  include_dirs = [
24    "include",
25    "${services_path}/ans/include",
26    "${services_path}/ans/test/unittest",
27    "${services_path}/ans/test/unittest/mock/include",
28    "${services_path}/test/moduletest/mock/include",
29    "${ffrt_path}/interfaces/kits",
30  ]
31
32  sources = [
33    "${services_path}/ans/test/unittest/mock/mock_ipc.cpp",
34    "${test_path}/mock/mock_tokenid_kit.cpp",
35    "ans_module_test.cpp",
36    "mock/blob.cpp",
37    "mock/distributed_kv_data_manager.cpp",
38    "mock/mock_accesstoken_kit.cpp",
39    "mock/mock_bundle_manager.cpp",
40    "mock/mock_bundle_manager_helper.cpp",
41    "mock/mock_event_handler.cpp",
42    "mock/mock_single_kv_store.cpp",
43  ]
44
45  deps = [
46    "${frameworks_module_ans_path}:ans_innerkits",
47    "${services_path}/ans:libans",
48  ]
49
50  external_deps = [
51    "ability_base:want",
52    "ability_base:zuri",
53    "ability_runtime:ability_manager",
54    "ability_runtime:abilitykit_native",
55    "ability_runtime:app_manager",
56    "ability_runtime:wantagent_innerkits",
57    "access_token:libaccesstoken_sdk",
58    "access_token:libtokenid_sdk",
59    "bundle_framework:appexecfwk_base",
60    "bundle_framework:appexecfwk_core",
61    "c_utils:utils",
62    "common_event_service:cesfwk_innerkits",
63    "eventhandler:libeventhandler",
64    "ffrt:libffrt",
65    "hilog:libhilog",
66    "hisysevent:libhisysevent",
67    "hitrace:hitrace_meter",
68    "hitrace:libhitracechain",
69    "image_framework:image_native",
70    "ipc:ipc_core",
71    "kv_store:distributeddata_inner",
72    "os_account:os_account_innerkits",
73    "player_framework:media_client",
74    "relational_store:native_rdb",
75    "safwk:system_ability_fwk",
76    "samgr:samgr_proxy",
77    "time_service:time_client",
78  ]
79
80  defines = []
81  if (device_usage) {
82    external_deps += [ "device_usage_statistics:usagestatsinner" ]
83    defines += [ "DEVICE_USAGE_STATISTICS_ENABLE" ]
84  }
85
86  if (distributed_notification_supported) {
87    defines += [ "DISTRIBUTED_NOTIFICATION_SUPPORTED" ]
88    deps += [ "${services_path}/distributed:libans_distributed" ]
89  }
90
91  subsystem_name = "${subsystem_name}"
92  part_name = "${component_name}"
93}
94
95group("moduletest") {
96  testonly = true
97  deps = []
98
99  deps += [ ":ans_module_test" ]
100}
101