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 = "./../../../../.."
15hdf_audio_test_path = "./../../.."
16
17if (defined(ohos_lite)) {
18  import("//build/lite/config/test.gni")
19} else {
20  import("//build/test.gni")
21}
22import("$hdf_audio_path/audio.gni")
23
24if (defined(ohos_lite)) {
25  moduletest("hdf_audio_lib_capture_hardwaredependence_test") {
26    if (defined(enable_liteos_test_bin) && enable_liteos_test_bin == true) {
27      output_extension = "bin"
28      output_dir = "$root_out_dir/test/moduletest/hdf"
29    }
30
31    sources = [
32      "$hdf_audio_test_path/common/hdi_common/src/audio_hdi_common.cpp",
33      "$hdf_audio_test_path/common/lib_common/src/audio_lib_common.cpp",
34      "src/audio_libcapture_hardwaredependence_test.cpp",
35    ]
36
37    include_dirs = [
38      "$hdf_audio_path/supportlibs/adm_adapter/include",
39      "$hdf_audio_path/supportlibs/interfaces/include",
40      "$hdf_audio_path/hal/hdi_passthrough/include",
41      "$hdf_audio_path/interfaces/include",
42      "//third_party/bounds_checking_function/include",
43      "$hdf_audio_test_path/common/lib_common/include",
44      "$hdf_audio_test_path/common/hdi_common/include",
45      "$hdf_audio_test_path/supportlibs/hardwaredependence/capture/include",
46      "//third_party/googletest/googletest/include/gtest",
47    ]
48
49    public_deps = [
50      "//drivers/hdf_core/adapter/uhdf/manager:hdf_core",
51      "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
52      "//third_party/bounds_checking_function:libsec_shared",
53    ]
54  }
55} else {
56  module_output_path = "drivers_peripheral_audio/audio"
57
58  ohos_systemtest("hdf_audio_lib_capture_hardwaredependence_test") {
59    module_out_path = module_output_path
60    sources = [
61      "$hdf_audio_test_path/common/hdi_common/src/audio_hdi_common.cpp",
62      "$hdf_audio_test_path/common/lib_common/src/audio_lib_common.cpp",
63      "src/audio_libcapture_hardwaredependence_test.cpp",
64    ]
65
66    include_dirs = [
67      "$hdf_audio_path/supportlibs/adm_adapter/include",
68      "$hdf_audio_path/supportlibs/interfaces/include",
69      "$hdf_audio_path/hal/hdi_passthrough/include",
70      "$hdf_audio_path/interfaces/include",
71      "$hdf_audio_test_path/common/lib_common/include",
72      "$hdf_audio_test_path/common/hdi_common/include",
73      "$hdf_audio_test_path/supportlibs/hardwaredependence/capture/include",
74    ]
75
76    deps = [
77      "//third_party/googletest:gmock_main",
78      "//third_party/googletest:gtest_main",
79    ]
80    external_deps = [ "hdf_core:libhdf_utils" ]
81    if (enable_c_utils) {
82      external_deps += [ "c_utils:utils" ]
83    }
84    external_deps += [ "bounds_checking_function:libsec_shared" ]
85    defines = []
86    if (enable_audio_adm_passthrough) {
87      defines += [ "AUDIO_ADM_SO" ]
88    }
89    if (enable_audio_adm_service) {
90      defines += [ "AUDIO_ADM_SERVICE" ]
91    }
92  }
93}
94