• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14if (defined(ohos_lite)) {
15  import("//build/lite/config/test.gni")
16  import("//drivers/peripheral/audio/audio.gni")
17} else {
18  import("//build/test.gni")
19  import("//drivers/adapter/uhdf2/uhdf.gni")
20  import("//drivers/peripheral/audio/audio.gni")
21}
22
23if (defined(ohos_lite)) {
24  ###########################LITEOS###########################
25  ###########################hdf_audio_hdi_manager_test###########################
26  unittest("hdf_audio_hdi_manager_test") {
27    sources = [ "//drivers/peripheral/audio/test/unittest/hdi/manager/src/audio_manager_test.cpp" ]
28
29    include_dirs = [
30      "//drivers/peripheral/audio/test/unittest/hdi/manager/include",
31      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
32      "//drivers/peripheral/audio/interfaces/include",
33      "//drivers/peripheral/audio/supportlibs/adm_adapter/include",
34      "//drivers/adapter/uhdf2/include/hdi",
35      "//drivers/adapter/uhdf2/shared/include",
36      "//drivers/framework/include/core",
37      "//drivers/framework/include/utils",
38      "//drivers/framework/include/osal",
39      "//drivers/framework/include",
40      "//third_party/bounds_checking_function/include",
41      "//drivers/framework/utils/include",
42      "//drivers/adapter/uhdf2/osal/include",
43      "//third_party/googletest/googletest/include/gtest",
44    ]
45
46    deps = [
47      "//drivers/adapter/uhdf2/utils:libhdf_utils",
48      "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common",
49      "//third_party/googletest:gmock_main",
50      "//third_party/googletest:gtest_main",
51    ]
52    if (!defined(enable_audio_user_mode) || !enable_audio_user_mode) {
53      deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ]
54    } else {
55      deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ]
56    }
57    cflags = [
58      "-Wall",
59      "-Wextra",
60      "-Werror",
61      "-fsigned-char",
62      "-fno-common",
63      "-fno-strict-aliasing",
64      "-std=c++11",
65    ]
66  }
67} else {
68  ###########################unittest###########################
69  module_output_path = "hdf/audio/unittest/hal"
70
71  ###########################hdf_audio_hdi_manager_test###########################
72  ohos_unittest("hdf_audio_hdi_manager_test") {
73    module_out_path = module_output_path
74    sources = [ "//drivers/peripheral/audio/test/unittest/hdi/manager/src/audio_manager_test.cpp" ]
75
76    include_dirs = [
77      "//drivers/peripheral/audio/test/unittest/hdi/manager/include",
78      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
79      "//drivers/peripheral/audio/interfaces/include",
80      "//drivers/peripheral/audio/supportlibs/adm_adapter/include",
81      "//third_party/bounds_checking_function/include",
82      "//third_party/googletest/googletest/include/gtest",
83    ]
84
85    deps = [
86      "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common",
87      "//third_party/googletest:gmock_main",
88      "//third_party/googletest:gtest_main",
89    ]
90    if (!defined(enable_audio_user_mode) || !enable_audio_user_mode) {
91      deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ]
92      external_deps = [ "device_driver_framework:libhdf_utils" ]
93    } else {
94      deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ]
95    }
96    cflags = [
97      "-Wall",
98      "-Wextra",
99      "-Werror",
100      "-fsigned-char",
101      "-fno-common",
102      "-fno-strict-aliasing",
103    ]
104  }
105}
106