• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 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/config/features.gni")
15import("//build/ohos.gni")
16import("//build/test.gni")
17import("../../../accessibility.gni")
18import("../../../config.gni")
19import("../../../sensor.gni")
20
21ohos_fuzztest("AudioEffectChainFuzzTest") {
22  module_out_path = "audio_framework/audio_framework_route"
23  fuzz_config_file = "../audioeffectchain_fuzzer"
24
25  include_dirs = [
26    "../../../frameworks/native/audioeffect/include",
27    "../../../frameworks/native/audioeffect/src",
28    "../../../services/audio_policy/server/include/service",
29    "../../../services/audio_policy/server/include",
30  ]
31  cflags = [
32    "-g",
33    "-O0",
34    "-Wno-unused-variable",
35    "-fno-omit-frame-pointer",
36    "-fno-access-control",
37  ]
38
39  if (sensor_enable == true) {
40    cflags += [ "-DSENSOR_ENABLE" ]
41  }
42  configs = [ "../../../services/audio_policy:audio_policy_public_config" ]
43
44  sources = [ "audio_effect_chain_fuzzer.cpp" ]
45
46  deps = [
47    "../../../frameworks/native/audioeffect:audio_effect_static",
48    "../../../frameworks/native/bluetoothclient:audio_bluetooth_client",
49    "../../../services/audio_policy:audio_policy_service",
50  ]
51
52  external_deps = [
53    "ability_base:want",
54    "ability_runtime:extension_manager",
55    "access_token:libaccesstoken_sdk",
56    "access_token:libnativetoken_shared",
57    "access_token:libprivacy_sdk",
58    "access_token:libtokenid_sdk",
59    "access_token:libtokensetproc_shared",
60    "bounds_checking_function:libsec_shared",
61    "bundle_framework:appexecfwk_base",
62    "bundle_framework:appexecfwk_core",
63    "c_utils:utils",
64    "data_share:datashare_common",
65    "data_share:datashare_consumer",
66    "drivers_interface_audio:libeffect_proxy_1.0",
67    "eventhandler:libeventhandler",
68    "hdf_core:libhdf_ipc_adapter",
69    "hdf_core:libhdf_utils",
70    "hdf_core:libhdi",
71    "hdf_core:libpub_utils",
72    "hicollie:libhicollie",
73    "hilog:libhilog",
74    "hisysevent:libhisysevent",
75    "hitrace:hitrace_meter",
76    "init:libbegetutil",
77    "ipc:ipc_single",
78    "kv_store:distributeddata_inner",
79    "media_foundation:media_monitor_client",
80    "media_foundation:media_monitor_common",
81    "os_account:os_account_innerkits",
82    "power_manager:powermgr_client",
83    "relational_store:native_appdatafwk",
84    "safwk:system_ability_fwk",
85    "samgr:samgr_proxy",
86  ]
87  defines = []
88  if (!audio_framework_feature_new_engine_flag) {
89    external_deps += [ "pulseaudio:pulse" ]
90    defines += [ "SUPPORT_OLD_ENGINE" ]
91  }
92  if (sensor_enable == true) {
93    external_deps += [ "sensor:sensor_interface_native" ]
94  }
95  if (accessibility_enable == true) {
96    external_deps += [
97      "accessibility:accessibility_common",
98      "accessibility:accessibilityconfig",
99    ]
100  }
101  if (use_libfuzzer || use_clang_coverage) {
102    defines += [ "TEST_COVERAGE" ]
103  }
104}
105
106group("fuzztest") {
107  testonly = true
108  deps = [ ":AudioEffectChainFuzzTest" ]
109}
110