1# Copyright (c) 2022-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("//build/ohos.gni")
15import("//build/ohos_var.gni")
16import("//build/test.gni")
17import("../../../../../distributedaudio.gni")
18
19module_out_path = "distributed_audio/services/audiomanager/service_sink_test"
20
21config("module_private_config") {
22  visibility = [ ":*" ]
23
24  include_dirs = [
25    "${audio_client_path}/micclient/include",
26    "${audio_client_path}/spkclient/include",
27    "${audio_control_path}/controlsink/include",
28    "${audio_processor_path}/interface",
29    "${audio_transport_path}/interface",
30    "${audio_transport_path}/receiverengine/include",
31    "${audio_transport_path}/senderengine/include",
32    "${common_path}/include",
33    "${innerkits_path}/native_cpp/audio_sink/include",
34    "${innerkits_path}/native_cpp/audio_source/include",
35    "${services_path}/audiomanager/managersink/include",
36    "${services_path}/audiomanager/servicesink/include",
37    "${services_path}/audiomanager/test/unittest/managersink/include",
38    "${services_path}/audiomanager/test/unittest/servicesink/include",
39    "${services_path}/common/audiodata/include",
40    "${services_path}/common/audioeventcallback",
41    "${services_path}/common/audioparam",
42  ]
43}
44
45## UnitTest daudio_sink_dev_test
46ohos_unittest("DaudioSinkServiceTest") {
47  module_out_path = module_out_path
48
49  sources = [ "${services_path}/audiomanager/test/unittest/servicesink/src/daudio_sink_service_test.cpp" ]
50
51  configs = [ ":module_private_config" ]
52
53  deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink" ]
54
55  external_deps = [
56    "audio_framework:audio_capturer",
57    "audio_framework:audio_client",
58    "audio_framework:audio_renderer",
59    "c_utils:utils",
60    "distributed_hardware_fwk:distributedhardwareutils",
61    "dsoftbus:softbus_client",
62    "googletest:gmock",
63    "hisysevent:libhisysevent",
64    "hitrace:hitrace_meter",
65    "ipc:ipc_core",
66    "safwk:system_ability_fwk",
67    "samgr:samgr_proxy",
68  ]
69}
70
71## UnitTest daudio_sink_stub_test
72ohos_unittest("DaudioSinkStubTest") {
73  module_out_path = module_out_path
74
75  cflags = [
76    "-g",
77    "-O0",
78    "-Wno-unused-variable",
79    "-fno-omit-frame-pointer",
80    "-Dprivate=public",
81    "-Dprotected=public",
82  ]
83
84  sources = [ "${services_path}/audiomanager/test/unittest/servicesink/src/daudio_sink_stub_test.cpp" ]
85
86  configs = [ ":module_private_config" ]
87
88  deps = [ "${services_path}/audiomanager/servicesink:distributed_audio_sink" ]
89
90  external_deps = [
91    "access_token:libaccesstoken_sdk",
92    "access_token:libtokenid_sdk",
93    "audio_framework:audio_capturer",
94    "audio_framework:audio_client",
95    "audio_framework:audio_renderer",
96    "c_utils:utils",
97    "distributed_hardware_fwk:distributedhardwareutils",
98    "dsoftbus:softbus_client",
99    "googletest:gmock",
100    "hisysevent:libhisysevent",
101    "hitrace:hitrace_meter",
102    "ipc:ipc_core",
103    "safwk:system_ability_fwk",
104    "samgr:samgr_proxy",
105  ]
106}
107
108group("service_sink_test") {
109  testonly = true
110  deps = [
111    ":DaudioSinkServiceTest",
112    ":DaudioSinkStubTest",
113  ]
114}
115