• 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 = "../../../"
16
17ohos_unittest("sim_gtest") {
18  install_enable = true
19  subsystem_name = "telephony"
20  part_name = "core_service"
21  test_module = "core_service"
22  module_out_path = part_name + "/" + test_module
23
24  sources = [
25    "core_manager_inner_gtest.cpp",
26    "csim_file_controller_gtest.cpp",
27    "isim_file_gtest.cpp",
28    "multi_sim_controller_gtest.cpp",
29    "operator_config_loader_gtest.cpp",
30    "operator_matching_rule_test.cpp",
31    "pdp_profile_rdb_helper_test.cpp",
32    "ruim_file_gtest.cpp",
33    "sim_file_gtest.cpp",
34    "sim_manager_gtest.cpp",
35    "sim_sms_controller_gtest.cpp",
36    "sim_utils_gtest.cpp",
37    "usim_dialling_numbers_service_gtest.cpp",
38  ]
39
40  include_dirs = [
41    "$SOURCE_DIR/services/core/include",
42    "$SOURCE_DIR/utils/log/include",
43    "$SOURCE_DIR/utils/preferences/include",
44    "$SOURCE_DIR/services/sim/include",
45    "$SOURCE_DIR/services/network_search/include",
46    "$SOURCE_DIR/services/tel_ril/include",
47    "$SOURCE_DIR/services/telephony_ext_wrapper/include",
48    "$SOURCE_DIR/test/mock",
49  ]
50
51  configs = [ "$SOURCE_DIR/utils:telephony_log_config" ]
52
53  deps = [
54    "$SOURCE_DIR:tel_core_service",
55    "$SOURCE_DIR/interfaces/innerkits:tel_core_service_api",
56    "$SOURCE_DIR/test/mock/ffrt:ffrt_mocked",
57    "$SOURCE_DIR/utils:libtel_common",
58  ]
59
60  external_deps = [
61    "ability_base:want",
62    "ability_base:zuri",
63    "ability_runtime:ability_manager",
64    "ability_runtime:dataobs_manager",
65    "ability_runtime:data_ability_helper",
66    "ability_runtime:wantagent_innerkits",
67    "access_token:libaccesstoken_sdk",
68    "access_token:libnativetoken_shared",
69    "access_token:libtoken_setproc",
70    "cJSON:cjson",
71    "c_utils:utils",
72    "common_event_service:cesfwk_innerkits",
73    "config_policy:configpolicy_util",
74    "core_service:libtel_vcard",
75    "data_share:datashare_common",
76    "data_share:datashare_consumer",
77    "drivers_interface_ril:ril_idl_headers",
78    "eventhandler:libeventhandler",
79    "googletest:gmock_main",
80    "googletest:gtest_main",
81    "hdf_core:libhdi",
82    "hilog:libhilog",
83    "i18n:zone_util",
84    "init:libbegetutil",
85    "ipc:ipc_single",
86    "libxml2:libxml2",
87    "libphonenumber:phonenumber_standard",
88    "netmanager_base:net_conn_manager_if",
89    "netmanager_ext:net_tether_manager_if",
90    "power_manager:powermgr_client",
91    "preferences:native_preferences",
92    "safwk:system_ability_fwk",
93    "samgr:samgr_proxy",
94    "telephony_data:tel_telephony_data",
95  ]
96  defines = [
97    "TELEPHONY_LOG_TAG = \"CoreServiceGtest\"",
98    "LOG_DOMAIN = 0xD000F00",
99  ]
100
101  if (defined(global_parts_info) &&
102      defined(global_parts_info.location_location) &&
103      global_parts_info.location_location) {
104    external_deps += [
105      "location:lbsservice_common",
106      "location:locator_sdk",
107    ]
108    defines += [ "ABILITY_LOCATION_SUPPORT" ]
109  }
110
111  cflags = [
112    "-flto",
113    "-fvisibility=hidden",
114  ]
115
116  ldflags = [ "-flto" ]
117}
118
119group("unittest") {
120  testonly = true
121  deps = [ ":sim_gtest" ]
122}
123