• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_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_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/common/capture/include",
46      "//third_party/googletest/googletest/include/gtest",
47    ]
48    public_deps = [
49      "//drivers/hdf_core/adapter/uhdf/manager:hdf_core",
50      "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
51      "//third_party/bounds_checking_function:libsec_shared",
52    ]
53  }
54} else {
55  module_output_path = "drivers_peripheral_audio/audio"
56
57  ohos_systemtest("hdf_audio_lib_capture_test") {
58    module_out_path = module_output_path
59    sources = [
60      "$hdf_audio_test_path/common/hdi_common/src/audio_hdi_common.cpp",
61      "$hdf_audio_test_path/common/lib_common/src/audio_lib_common.cpp",
62    ]
63    if (defined(drivers_peripheral_audio_feature_alsa_lib) &&
64        drivers_peripheral_audio_feature_alsa_lib == true) {
65      sources += [ "src/audio_alsa_libcapture_test.cpp" ]
66    } else {
67      sources += [ "src/audio_libcapture_test.cpp" ]
68    }
69    include_dirs = [
70      "$hdf_audio_path/supportlibs/adm_adapter/include",
71      "$hdf_audio_path/supportlibs/interfaces/include",
72      "$hdf_audio_path/hal/hdi_passthrough/include",
73      "$hdf_audio_path/interfaces/include",
74      "$hdf_audio_test_path/common/lib_common/include",
75      "$hdf_audio_test_path/common/hdi_common/include",
76      "$hdf_audio_test_path/supportlibs/common/capture/include",
77    ]
78    deps = [
79      "//third_party/bounds_checking_function:libsec_shared",
80      "//third_party/googletest:gmock_main",
81      "//third_party/googletest:gtest_main",
82    ]
83    external_deps = [
84      "c_utils:utils",
85      "hdf_core:libhdf_utils",
86    ]
87    defines = []
88    if (enable_audio_adm_passthrough) {
89      defines += [ "AUDIO_ADM_SO" ]
90    }
91    if (enable_audio_adm_service) {
92      defines += [ "AUDIO_ADM_SERVICE" ]
93    }
94  }
95}
96