• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2024 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("//build/test.gni")
15SOURCE_DIR = "../../../"
16import("$SOURCE_DIR/telephony_core_service.gni")
17
18ohos_unittest("esim_service_client_branch_gtest") {
19  install_enable = true
20  subsystem_name = "telephony"
21  part_name = "core_service"
22  test_module = "tel_esim_gtest"
23  module_out_path = part_name + "/" + test_module
24
25  sources = [
26    "$SOURCE_DIR/frameworks/native/src/download_profile_config_info_parcel.cpp",
27    "$SOURCE_DIR/frameworks/native/src/download_profile_result_parcel.cpp",
28    "$SOURCE_DIR/frameworks/native/src/downloadable_profile_parcel.cpp",
29    "$SOURCE_DIR/frameworks/native/src/euicc_info_parcel.cpp",
30    "$SOURCE_DIR/frameworks/native/src/get_downloadable_profiles_result_parcel.cpp",
31    "$SOURCE_DIR/frameworks/native/src/profile_info_list_parcel.cpp",
32    "$SOURCE_DIR/frameworks/native/src/profile_metadata_result_parcel.cpp",
33    "$SOURCE_DIR/frameworks/native/src/response_esim_result.cpp",
34    "esim_service_client_branch_test.cpp",
35  ]
36
37  include_dirs = [
38    "$SOURCE_DIR/interfaces/innerkits/include",
39    "$SOURCE_DIR/test/unittest/esim_gtest/mock/include",
40  ]
41
42  configs = [ "$SOURCE_DIR/utils:telephony_log_config" ]
43
44  deps = [
45    "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api",
46    "//third_party/googletest:gmock_main",
47    "//third_party/googletest:gtest_main",
48  ]
49
50  external_deps = [
51    "ability_base:want",
52    "ability_base:zuri",
53    "ability_runtime:ability_manager",
54    "ability_runtime:data_ability_helper",
55    "ability_runtime:wantagent_innerkits",
56    "access_token:libaccesstoken_sdk",
57    "access_token:libnativetoken",
58    "access_token:libtoken_setproc",
59    "cJSON:cjson",
60    "c_utils:utils",
61    "common_event_service:cesfwk_innerkits",
62    "config_policy:configpolicy_util",
63    "core_service:libtel_vcard",
64    "data_share:datashare_common",
65    "data_share:datashare_consumer",
66    "drivers_interface_ril:ril_idl_headers",
67    "eventhandler:libeventhandler",
68    "hdf_core:libhdi",
69    "hilog:libhilog",
70    "init:libbegetutil",
71    "ipc:ipc_single",
72    "netmanager_base:net_conn_manager_if",
73    "netmanager_ext:net_tether_manager_if",
74    "power_manager:powermgr_client",
75    "safwk:system_ability_fwk",
76    "samgr:samgr_proxy",
77  ]
78
79  defines = [
80    "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"",
81    "LOG_DOMAIN = 0xD000F00",
82  ]
83
84  cflags = [
85    "-flto",
86    "-fsanitize=cfi",
87    "-fsanitize-cfi-cross-dso",
88    "-fvisibility=hidden",
89  ]
90
91  ldflags = [
92    "-flto",
93    "-fsanitize=cfi",
94    "-fsanitize-cfi-cross-dso",
95  ]
96}
97
98ohos_unittest("tel_esim_gtest") {
99  install_enable = true
100  subsystem_name = "telephony"
101  part_name = "core_service"
102  test_module = "tel_esim_gtest"
103  module_out_path = part_name + "/" + test_module
104
105  sources = [
106    "esim_core_service_client_test.cpp",
107    "esim_core_service_proxy_test.cpp",
108    "esim_core_service_stub_test.cpp",
109    "esim_core_service_test.cpp",
110    "esim_file_manager_test.cpp",
111    "esim_manager_test.cpp",
112    "esim_part_one_test.cpp",
113    "esim_test.cpp",
114  ]
115
116  include_dirs = [
117    "$SOURCE_DIR/services/core/include",
118    "$SOURCE_DIR/utils/codec/include",
119    "$SOURCE_DIR/utils/log/include",
120    "$SOURCE_DIR/utils/preferences/include",
121    "$SOURCE_DIR/services/sim/include",
122    "$SOURCE_DIR/services/network_search/include",
123    "$SOURCE_DIR/services/tel_ril/include",
124    "$SOURCE_DIR/services/telephony_ext_wrapper/include",
125    "$SOURCE_DIR/interfaces/innerkits/include",
126    "$SOURCE_DIR/test/unittest/esim_gtest/mock/include",
127  ]
128
129  configs = [ "$SOURCE_DIR/utils:telephony_log_config" ]
130
131  deps = [
132    "$SOURCE_DIR:tel_core_service",
133    "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api",
134    "$SOURCE_DIR/utils:libtel_common",
135    "//third_party/googletest:gmock_main",
136    "//third_party/googletest:gtest_main",
137  ]
138
139  external_deps = [
140    "ability_base:want",
141    "ability_base:zuri",
142    "ability_runtime:ability_manager",
143    "ability_runtime:data_ability_helper",
144    "ability_runtime:wantagent_innerkits",
145    "access_token:libaccesstoken_sdk",
146    "access_token:libnativetoken",
147    "access_token:libtoken_setproc",
148    "cJSON:cjson",
149    "c_utils:utils",
150    "common_event_service:cesfwk_innerkits",
151    "config_policy:configpolicy_util",
152    "core_service:libtel_vcard",
153    "data_share:datashare_common",
154    "data_share:datashare_consumer",
155    "drivers_interface_ril:ril_idl_headers",
156    "eventhandler:libeventhandler",
157    "hdf_core:libhdi",
158    "hilog:libhilog",
159    "init:libbegetutil",
160    "ipc:ipc_single",
161    "netmanager_base:net_conn_manager_if",
162    "netmanager_ext:net_tether_manager_if",
163    "power_manager:powermgr_client",
164    "safwk:system_ability_fwk",
165    "samgr:samgr_proxy",
166  ]
167  defines = [
168    "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"",
169    "LOG_DOMAIN = 0xD000F00",
170  ]
171
172  if (defined(global_parts_info) &&
173      defined(global_parts_info.location_location) &&
174      global_parts_info.location_location) {
175    external_deps += [
176      "location:lbsservice_common",
177      "location:locator_sdk",
178    ]
179    defines += [ "ABILITY_LOCATION_SUPPORT" ]
180  }
181
182  defines += telephony_extra_defines
183
184  cflags = [
185    "-flto",
186    "-fsanitize=cfi",
187    "-fsanitize-cfi-cross-dso",
188    "-fvisibility=hidden",
189  ]
190
191  ldflags = [
192    "-flto",
193    "-fsanitize=cfi",
194    "-fsanitize-cfi-cross-dso",
195  ]
196}
197
198ohos_unittest("esim_core_service_client_branch_test") {
199  install_enable = true
200  subsystem_name = "telephony"
201  part_name = "core_service"
202  test_module = "tel_esim_gtest"
203  module_out_path = part_name + "/" + test_module
204
205  sources = [ "esim_core_service_client_branch_test.cpp" ]
206
207  include_dirs = [
208    "$SOURCE_DIR/services/core/include",
209    "$SOURCE_DIR/utils/codec/include",
210    "$SOURCE_DIR/utils/log/include",
211    "$SOURCE_DIR/utils/preferences/include",
212    "$SOURCE_DIR/services/sim/include",
213    "$SOURCE_DIR/services/network_search/include",
214    "$SOURCE_DIR/services/tel_ril/include",
215    "$SOURCE_DIR/services/telephony_ext_wrapper/include",
216    "$SOURCE_DIR/interfaces/innerkits/include",
217    "$SOURCE_DIR/test/unittest/esim_gtest/mock/include",
218  ]
219
220  configs = [ "$SOURCE_DIR/utils:telephony_log_config" ]
221
222  deps = [
223    "$SOURCE_DIR:tel_core_service",
224    "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api",
225    "$SOURCE_DIR/utils:libtel_common",
226    "//third_party/googletest:gmock_main",
227    "//third_party/googletest:gtest_main",
228  ]
229
230  external_deps = [
231    "ability_base:want",
232    "ability_base:zuri",
233    "ability_runtime:ability_manager",
234    "ability_runtime:data_ability_helper",
235    "ability_runtime:wantagent_innerkits",
236    "access_token:libaccesstoken_sdk",
237    "access_token:libnativetoken",
238    "access_token:libtoken_setproc",
239    "cJSON:cjson",
240    "c_utils:utils",
241    "common_event_service:cesfwk_innerkits",
242    "config_policy:configpolicy_util",
243    "core_service:libtel_vcard",
244    "data_share:datashare_common",
245    "data_share:datashare_consumer",
246    "drivers_interface_ril:ril_idl_headers",
247    "eventhandler:libeventhandler",
248    "hdf_core:libhdi",
249    "hilog:libhilog",
250    "init:libbegetutil",
251    "ipc:ipc_single",
252    "netmanager_base:net_conn_manager_if",
253    "netmanager_ext:net_tether_manager_if",
254    "power_manager:powermgr_client",
255    "safwk:system_ability_fwk",
256    "samgr:samgr_proxy",
257  ]
258  defines = [
259    "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"",
260    "LOG_DOMAIN = 0xD000F00",
261  ]
262
263  defines += telephony_extra_defines
264
265  if (defined(global_parts_info) &&
266      defined(global_parts_info.location_location) &&
267      global_parts_info.location_location) {
268    external_deps += [
269      "location:lbsservice_common",
270      "location:locator_sdk",
271    ]
272    defines += [ "ABILITY_LOCATION_SUPPORT" ]
273  }
274
275  cflags = [
276    "-flto",
277    "-fsanitize=cfi",
278    "-fsanitize-cfi-cross-dso",
279    "-fvisibility=hidden",
280  ]
281
282  ldflags = [
283    "-flto",
284    "-fsanitize=cfi",
285    "-fsanitize-cfi-cross-dso",
286  ]
287}
288
289group("unittest") {
290  testonly = true
291  deps = [
292    ":esim_core_service_client_branch_test",
293    ":esim_service_client_branch_gtest",
294    ":tel_esim_gtest",
295  ]
296}
297