1# Copyright (c) 2024-2025 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 14import("//build/test.gni") 15import("//foundation/multimedia/player_framework/config.gni") 16 17module_output_path = "player_framework/audio_haptic" 18 19ohos_unittest("audio_haptic_unit_test") { 20 module_out_path = module_output_path 21 include_dirs = [ 22 "./", 23 "./../../../frameworks/native/audio_haptic", 24 "./../../../interfaces/inner_api/native", 25 "./../../../interfaces/inner_api/native/audio_haptic/include", 26 ] 27 28 cflags = [ 29 "-Wall", 30 "-Werror", 31 ] 32 33 sources = [ 34 "audio_haptic_manager_impl_unit_test.cpp", 35 "audio_haptic_unit_test.cpp", 36 ] 37 38 deps = [ 39 "./../../../frameworks/native/audio_haptic:audio_haptic", 40 "./../../../frameworks/native/soundpool:soundpool_client", 41 "./../../../interfaces/inner_api/native:media_client", 42 ] 43 44 external_deps = [ 45 "access_token:libaccesstoken_sdk", 46 "access_token:libnativetoken_shared", 47 "access_token:libtokensetproc_shared", 48 "audio_framework:audio_client", 49 "graphic_surface:surface", 50 "hilog:libhilog", 51 ] 52 53 resource_config_file = "./../resources/ohos_test.xml" 54} 55 56ohos_unittest("audio_haptic_sound_normal_impl_unit_test") { 57 module_out_path = module_output_path 58 include_dirs = [ 59 "./", 60 "./../../../frameworks/native/audio_haptic", 61 ] 62 63 cflags = [ 64 "-Wall", 65 "-Werror", 66 "-fno-access-control", 67 ] 68 69 sources = [ "audio_haptic_sound_normal_impl_unit_test.cpp" ] 70 71 deps = [ 72 "./../../../frameworks/native/audio_haptic:audio_haptic", 73 "./../../../frameworks/native/soundpool:soundpool_client", 74 "./../../../interfaces/inner_api/native:media_client", 75 ] 76 77 external_deps = [ 78 "access_token:libaccesstoken_sdk", 79 "access_token:libnativetoken_shared", 80 "access_token:libtokensetproc_shared", 81 "audio_framework:audio_client", 82 "graphic_surface:surface", 83 "hilog:libhilog", 84 ] 85 86 resource_config_file = "./../resources/ohos_test.xml" 87} 88 89ohos_unittest("audio_haptic_sound_low_latency_impl_unit_test") { 90 module_out_path = module_output_path 91 include_dirs = [ 92 "./", 93 "./../../../frameworks/native/audio_haptic", 94 "./../../../interfaces/inner_api/native/soundpool/include", 95 ] 96 97 cflags = [ 98 "-Wall", 99 "-Werror", 100 "-fno-access-control", 101 ] 102 103 sources = [ "audio_haptic_sound_low_latency_impl_unit_test.cpp" ] 104 105 deps = [ 106 "./../../../frameworks/native/audio_haptic:audio_haptic", 107 "./../../../frameworks/native/soundpool:soundpool_client", 108 "./../../../interfaces/inner_api/native:media_client", 109 ] 110 111 external_deps = [ 112 "access_token:libaccesstoken_sdk", 113 "access_token:libnativetoken_shared", 114 "access_token:libtokensetproc_shared", 115 "audio_framework:audio_client", 116 "graphic_surface:surface", 117 "hilog:libhilog", 118 ] 119 120 resource_config_file = "./../resources/ohos_test.xml" 121} 122 123ohos_unittest("audio_haptic_player_impl_unit_test") { 124 module_out_path = module_output_path 125 include_dirs = [ 126 "./", 127 "./../../../frameworks/native/audio_haptic", 128 ] 129 130 cflags = [ 131 "-Wall", 132 "-Werror", 133 "-fno-access-control", 134 ] 135 136 sources = [ "audio_haptic_player_impl_unit_test.cpp" ] 137 138 deps = [ 139 "./../../../frameworks/native/audio_haptic:audio_haptic", 140 "./../../../frameworks/native/soundpool:soundpool_client", 141 "./../../../interfaces/inner_api/native:media_client", 142 ] 143 144 external_deps = [ 145 "access_token:libaccesstoken_sdk", 146 "access_token:libnativetoken_shared", 147 "access_token:libtokensetproc_shared", 148 "audio_framework:audio_client", 149 "graphic_surface:surface", 150 "hilog:libhilog", 151 "miscdevice:vibrator_interface_native", 152 ] 153 154 resource_config_file = "./../resources/ohos_test.xml" 155} 156 157ohos_unittest("audio_haptic_vibrator_impl_unit_test") { 158 module_out_path = module_output_path 159 include_dirs = [ 160 "./", 161 "./../../../frameworks/native/audio_haptic", 162 ] 163 164 cflags = [ 165 "-Wall", 166 "-Werror", 167 "-fno-access-control", 168 ] 169 170 sources = [ "audio_haptic_vibrator_impl_unit_test.cpp" ] 171 172 deps = [ 173 "./../../../frameworks/native/audio_haptic:audio_haptic", 174 "./../../../frameworks/native/soundpool:soundpool_client", 175 "./../../../interfaces/inner_api/native:media_client", 176 ] 177 178 external_deps = [ 179 "access_token:libaccesstoken_sdk", 180 "access_token:libnativetoken_shared", 181 "access_token:libtokensetproc_shared", 182 "audio_framework:audio_client", 183 "graphic_surface:surface", 184 "hilog:libhilog", 185 "miscdevice:vibrator_interface_native", 186 ] 187 188 defines = [ "SUPPORT_VIBRATOR" ] 189 190 resource_config_file = "./../resources/ohos_test.xml" 191} 192