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
14hdf_audio_path = "./../../../.."
15
16if (defined(ohos_lite)) {
17  import("//build/lite/config/test.gni")
18  import("$hdf_audio_path/audio.gni")
19} else {
20  import("//build/test.gni")
21
22  import("$hdf_audio_path/audio.gni")
23}
24
25if (defined(ohos_lite)) {
26  ###########################LITEOS###########################
27  ###########################hdf_audio_lib_capture_test###########################
28  unittest("hdf_audio_lib_capture_test") {
29    sources = [ "./src/audio_adm_if_lib_capture_test.cpp" ]
30
31    include_dirs = [
32      "$hdf_audio_path/hal/hdi_passthrough/include",
33      "$hdf_audio_path/interfaces/include",
34      "$hdf_audio_path/supportlibs/adm_adapter/include",
35      "$hdf_audio_path/supportlibs/interfaces/include",
36      "//third_party/googletest/googletest/include/gtest",
37    ]
38
39    external_deps = [ "bounds_checking_function:libsec_shared" ]
40
41    public_deps = [
42      "$hdf_audio_path/hdi_service/supportlibs:audio_capture_adapter",
43      "//drivers/hdf_core/adapter/uhdf/manager:hdf_core",
44      "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
45      "//third_party/googletest:gmock_main",
46      "//third_party/googletest:gtest_main",
47    ]
48  }
49} else {
50  ###########################unittest###########################
51  module_output_path = "hdf/audio"
52
53  ###########################hdf_audio_lib_capture_test###########################
54  ohos_unittest("hdf_audio_lib_capture_test") {
55    module_out_path = module_output_path
56    sources = []
57    include_dirs = []
58    if (drivers_peripheral_audio_feature_alsa_lib) {
59      sources += [ "./src/audio_alsa_if_lib_capture_test.cpp" ]
60      include_dirs += [
61        "$hdf_audio_path/supportlibs/alsa_adapter/include",
62        "//third_party/alsa-lib/include",
63      ]
64    } else {
65      sources += [ "./src/audio_adm_if_lib_capture_test.cpp" ]
66      include_dirs += [ "$hdf_audio_path/supportlibs/adm_adapter/include" ]
67    }
68
69    include_dirs += [
70      "$hdf_audio_path/hal/hdi_passthrough/include",
71      "$hdf_audio_path/interfaces/include",
72      "$hdf_audio_path/supportlibs/interfaces/include",
73      "//third_party/googletest/googletest/include/gtest",
74    ]
75
76    deps = [
77      "$hdf_audio_path/hdi_service/supportlibs:audio_capture_adapter",
78      "//third_party/googletest:gmock_main",
79      "//third_party/googletest:gtest_main",
80    ]
81
82    if (is_standard_system) {
83      external_deps = [
84        "hdf_core:libhdf_utils",
85        "hilog:libhilog",
86      ]
87      if (enable_c_utils) {
88        external_deps += [ "c_utils:utils" ]
89      }
90    } else if (defined(ohos_lite)) {
91      external_deps = [ "hilog_lite:hilog_shared" ]
92    }
93    external_deps += [ "bounds_checking_function:libsec_shared" ]
94  }
95}
96