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
14import("//build/test.gni")
15import("//foundation/communication/bluetooth_service/bluetooth.gni")
16
17module_output_path = "bluetooth/framework_test/hfp/"
18SUBSYSTEM_DIR = "//foundation/communication"
19
20###############################################################################
21#1. intent(c++) get/set test without transport
22
23config("module_private_config") {
24  visibility = [ ":*" ]
25  cflags = []
26  if (target_cpu == "arm") {
27    cflags += [ "-DBINDER_IPC_32BIT" ]
28  }
29  include_dirs = [
30    "mock/include",
31    "//third_party/json/include",
32    "//commonlibrary/c_utils/base/include",
33    "//utils/system/safwk/native/include",
34    "//foundation/communication/bluetooth/interfaces/inner_api/include",
35    "//foundation/communication/bluetooth/frameworks/inner/include",
36  ]
37  defines = [
38    "BTFW_LOG_TAG = \"bluetooth_test\"",
39    "BTFW_LOG_DOMAIN = 0xD000103",
40  ]
41}
42
43ohos_unittest("btfw_hfp_ag_unit_test") {
44  module_out_path = module_output_path
45
46  sources = [ "hfp_ag_test.cpp" ]
47
48  configs = [ ":module_private_config" ]
49
50  deps = [
51    "//third_party/googletest:gmock_main",
52    "//third_party/googletest:gtest_main",
53  ]
54
55  external_deps = [
56    "bluetooth:btframework",
57    "c_utils:utils",
58    "hilog:libhilog",
59    "ipc:ipc_core",
60    "resource_management:global_resmgr",
61  ]
62}
63
64ohos_unittest("btfw_hfp_hf_unit_test") {
65  module_out_path = module_output_path
66
67  sources = [ "hfp_hf_test.cpp" ]
68
69  configs = [ ":module_private_config" ]
70
71  deps = [
72    "//third_party/googletest:gmock_main",
73    "//third_party/googletest:gtest_main",
74  ]
75
76  external_deps = [
77    "bluetooth:btframework",
78    "c_utils:utils",
79    "hilog:libhilog",
80    "ipc:ipc_core",
81    "resource_management:global_resmgr",
82  ]
83}
84
85ohos_unittest("btfw_hf_call_unit_test") {
86  module_out_path = module_output_path
87
88  sources = [ "hf_call_test.cpp" ]
89
90  configs = [ ":module_private_config" ]
91
92  deps = [
93    "$SUBSYSTEM_DIR/bluetooth_service/services/bluetooth/server:bluetooth_server",
94    "//third_party/googletest:gmock_main",
95    "//third_party/googletest:gtest_main",
96  ]
97
98  external_deps = [
99    "bluetooth:btframework",
100    "c_utils:utils",
101    "hilog:libhilog",
102    "ipc:ipc_core",
103    "resource_management:global_resmgr",
104  ]
105}
106
107################################################################################
108group("unittest") {
109  testonly = true
110
111  deps = []
112
113  if (is_phone_product) {
114    deps += [ ":btfw_hf_call_unit_test" ]
115
116    if (bluetooth_service_hfp_ag_feature) {
117      deps += [ ":btfw_hfp_ag_unit_test" ]
118    }
119
120    if (bluetooth_service_hfp_hf_feature) {
121      deps += [ ":btfw_hfp_hf_unit_test" ]
122    }
123  }
124}
125