• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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} else {
17  import("//build/test.gni")
18  import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
19}
20import("//drivers/peripheral/audio/audio.gni")
21
22if (defined(ohos_lite)) {
23  moduletest("hdf_audio_hdi_render_performace_test") {
24    sources = [
25      "../../common/hdi_common/src/audio_hdi_common.cpp",
26      "src/audio_hdirender_performace_test.cpp",
27    ]
28
29    include_dirs = [
30      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
31      "//drivers/peripheral/audio/interfaces/include",
32      "//drivers/hdf_core/framework/include/core",
33      "//drivers/hdf_core/framework/include/utils",
34      "//drivers/hdf_core/framework/include/osal",
35      "//drivers/hdf_core/framework/utils/include",
36      "//drivers/hdf_core/framework/include",
37      "//drivers/hdf_core/framework/core/sec/include",
38      "//drivers/hdf_core/framework/core/shared/include",
39      "//drivers/hdf_core/framework/core/host/include",
40      "//drivers/hdf_core/framework/core/manager/include",
41      "//drivers/hdf_core/framework/core/common/include/host/",
42      "//third_party/bounds_checking_function/include",
43      "//drivers/hdf_core/adapter/khdf/liteos/osal/include",
44      "//drivers/hdf_core/adapter/uhdf2/shared/include",
45      "//drivers/hdf_core/adapter/uhdf2/include/hdi/",
46      "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include",
47      "//third_party/googletest/googletest/include/gtest",
48      "//drivers/peripheral/audio/test/systemtest/hdi/hdiperformace/include",
49    ]
50    deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ]
51  }
52
53  moduletest("hdf_audio_hdi_capture_performace_test") {
54    sources = [
55      "../../common/hdi_common/src/audio_hdi_common.cpp",
56      "src/audio_hdicapture_performace_test.cpp",
57    ]
58
59    include_dirs = [
60      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
61      "//drivers/peripheral/audio/interfaces/include",
62      "//drivers/hdf_core/framework/include/core",
63      "//drivers/hdf_core/framework/include/utils",
64      "//drivers/hdf_core/framework/include/osal",
65      "//drivers/hdf_core/framework/utils/include",
66      "//drivers/hdf_core/framework/include",
67      "//drivers/hdf_core/framework/core/sec/include",
68      "//drivers/hdf_core/framework/core/shared/include",
69      "//drivers/hdf_core/framework/core/host/include",
70      "//drivers/hdf_core/framework/core/manager/include",
71      "//drivers/hdf_core/framework/core/common/include/host/",
72      "//third_party/bounds_checking_function/include",
73      "//drivers/hdf_core/adapter/khdf/liteos/osal/include",
74      "//drivers/hdf_core/adapter/uhdf2/shared/include",
75      "//drivers/hdf_core/adapter/uhdf2/include/hdi/",
76      "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include",
77      "//third_party/googletest/googletest/include/gtest",
78      "//drivers/peripheral/audio/test/systemtest/hdi/hdiperformace/include",
79    ]
80    deps = [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ]
81  }
82} else {
83  module_output_path = "drivers_peripheral_audio/audio"
84
85  ohos_systemtest("hdf_audio_hdi_render_performace_test") {
86    module_out_path = module_output_path
87    resource_config_file =
88        "//drivers/peripheral/audio/test/resource/ohos_test.xml"
89    sources = [
90      "../../common/hdi_common/src/audio_hdi_common.cpp",
91      "src/audio_hdirender_performace_test.cpp",
92    ]
93
94    include_dirs = [
95      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
96      "//drivers/peripheral/audio/interfaces/include",
97      "//drivers/hdf_core/adapter/uhdf2/include/hdi",
98      "//drivers/hdf_core/adapter/uhdf2/shared/include",
99      "//drivers/hdf_core/framework/include/core",
100      "//drivers/hdf_core/framework/include/utils",
101      "//drivers/hdf_core/framework/include/osal",
102      "//drivers/hdf_core/framework/include",
103      "//third_party/bounds_checking_function/include",
104      "//drivers/hdf_core/framework/utils/include",
105      "//drivers/hdf_core/adapter/uhdf2/osal/include",
106      "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include",
107      "//third_party/googletest/googletest/include/gtest",
108      "//drivers/peripheral/audio/test/systemtest/hdi/hdiperformace/include",
109    ]
110
111    deps = [
112      "//third_party/googletest:gmock_main",
113      "//third_party/googletest:gtest_main",
114    ]
115    defines = []
116    if (enable_audio_adm_passthrough) {
117      deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ]
118      defines += [ "AUDIO_ADM_SO" ]
119    }
120    if (enable_audio_adm_service) {
121      deps +=
122          [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ]
123      defines += [ "AUDIO_ADM_SERVICE" ]
124    }
125    if (!drivers_peripheral_audio_rich_device) {
126      defines += [ "FEATURE_SMALL_DEVICE" ]
127    }
128  }
129
130  ohos_systemtest("hdf_audio_hdi_capture_performace_test") {
131    module_out_path = module_output_path
132    sources = [
133      "../../common/hdi_common/src/audio_hdi_common.cpp",
134      "src/audio_hdicapture_performace_test.cpp",
135    ]
136
137    include_dirs = [
138      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
139      "//drivers/peripheral/audio/interfaces/include",
140      "//drivers/hdf_core/adapter/uhdf2/include/hdi",
141      "//drivers/hdf_core/adapter/uhdf2/shared/include",
142      "//drivers/hdf_core/framework/include/core",
143      "//drivers/hdf_core/framework/include/utils",
144      "//drivers/hdf_core/framework/include/osal",
145      "//drivers/hdf_core/framework/include",
146      "//third_party/bounds_checking_function/include",
147      "//drivers/hdf_core/framework/utils/include",
148      "//drivers/hdf_core/adapter/uhdf2/osal/include",
149      "//drivers/peripheral/audio/test/systemtest/common/hdi_common/include",
150      "//third_party/googletest/googletest/include/gtest",
151      "//drivers/peripheral/audio/test/systemtest/hdi/hdiperformace/include",
152    ]
153
154    deps = [
155      "//third_party/googletest:gmock_main",
156      "//third_party/googletest:gtest_main",
157    ]
158    defines = []
159    if (enable_audio_adm_passthrough) {
160      deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ]
161      defines += [ "AUDIO_ADM_SO" ]
162    }
163    if (enable_audio_adm_service) {
164      deps +=
165          [ "//drivers/peripheral/audio/hal/hdi_binder/proxy:hdi_audio_client" ]
166      defines += [ "AUDIO_ADM_SERVICE" ]
167    }
168    if (!drivers_peripheral_audio_rich_device) {
169      defines += [ "FEATURE_SMALL_DEVICE" ]
170    }
171  }
172}
173group("hdi_performace") {
174  if (!defined(ohos_lite)) {
175    testonly = true
176  }
177  deps = [
178    ":hdf_audio_hdi_capture_performace_test",
179    ":hdf_audio_hdi_render_performace_test",
180  ]
181}
182