1 # Copyright (C) 2021 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 
14 import("//build/test.gni")
15 SOURCE_DIR = "../../../"
16 
17 ohos_unittest("tel_ril_adapter_gtest") {
18   install_enable = true
19   subsystem_name = "telephony"
20   part_name = "ril_adapter"
21   test_module = "tel_ril_adapter_gtest"
22   module_out_path = part_name + "/" + test_module
23 
24   sources = [
25     "ril_call_test.cpp",
26     "ril_callback_test.cpp",
27     "ril_data_test.cpp",
28     "ril_modem_test.cpp",
29     "ril_network_test.cpp",
30     "ril_sim_test.cpp",
31     "ril_sms_test.cpp",
32     "ril_test_util.cpp",
33     "zero_branch_test.cpp",
34   ]
35 
36   include_dirs = [
37     "include",
38     "$SOURCE_DIR/services/hril/include",
39     "$SOURCE_DIR/services/hril_hdf/include",
40   ]
41   deps = [
42     "$SOURCE_DIR/interfaces/innerkits:hril_innerkits",
43     "$SOURCE_DIR/services/hril:hril",
44     "$SOURCE_DIR/services/hril_hdf:hril_hdf",
45   ]
46   defines = [
47     "TELEPHONY_LOG_TAG = \"RilAdapterGtest\"",
48     "LOG_DOMAIN = 0xD000F00",
49   ]
50 
51   # defines += [ "TEL_TEST_PIN_PUK" ]
52   configs = [ "$SOURCE_DIR/utils:utils_config" ]
53   if (is_standard_system) {
54     external_deps = [
55       "bounds_checking_function:libsec_shared",
56       "c_utils:utils",
57       "drivers_interface_power:libpower_proxy_1.2",
58       "drivers_interface_ril:libril_proxy_1.2",
59       "drivers_interface_ril:libril_proxy_1.3",
60       "hdf_core:libhdf_utils",
61       "hilog:libhilog",
62       "init:libbegetutil",
63       "ipc:ipc_single",
64     ]
65   } else {
66     external_deps = [ "hilog:libhilog" ]
67   }
68   external_deps += [ "ipc:ipc_single" ]
69   if (defined(global_parts_info) &&
70       defined(global_parts_info.hdf_drivers_interface_power) &&
71       global_parts_info.hdf_drivers_interface_power) {
72     external_deps += [ "drivers_interface_power:libpower_proxy_1.2" ]
73     defines += [ "ABILITY_POWER_SUPPORT" ]
74   }
75 }
76 
77 group("unittest") {
78   testonly = true
79   deps = [ ":tel_ril_adapter_gtest" ]
80 }
81