• 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/test.gni")
16import("../../../accessibility.gni")
17import("../../../config.gni")
18import("../../../bluetooth_part.gni")
19
20ohos_fuzztest("AudioPolicyServerFuzzTest") {
21  module_out_path = "audio_framework/audio_framework_route"
22  fuzz_config_file = "../audiopolicyserver_fuzzer"
23
24  include_dirs = [
25    "../../../services/audio_policy/server/include",
26    "../../../services/audio_policy/server/include/service",
27    "../../../services/audio_engine/manager/include",
28    "../../../services/audio_service/server/include",
29  ]
30  cflags = [
31    "-g",
32    "-O0",
33    "-Wno-unused-variable",
34    "-fno-omit-frame-pointer",
35  ]
36
37  cflags_cc = cflags
38  cflags_cc += [ "-fno-access-control" ]
39
40  configs = [ "../../../services/audio_policy:audio_policy_public_config" ]
41
42  defines = []
43  if (audio_framework_feature_dtmf_tone) {
44    defines += [ "FEATURE_DTMF_TONE" ]
45  }
46  if (use_libfuzzer || use_clang_coverage) {
47    defines += [ "TEST_COVERAGE" ]
48  }
49  if (audio_framework_feature_input) {
50    defines += [ "FEATURE_MULTIMODALINPUT_INPUT" ]
51  }
52
53  sources = [ "audio_policy_server_fuzzer.cpp" ]
54
55  deps = [
56    "../../../frameworks/native/hdiadapter_new:hdiadapter_new",
57    "../../../services/audio_engine:audio_engine_manager",
58    "../../../services/audio_policy:audio_policy_service_static",
59    "../../../services/audio_service:audio_client",
60  ]
61
62  external_deps = [
63    "ability_base:want",
64    "ability_runtime:extension_manager",
65    "ability_runtime:wantagent_innerkits",
66    "access_token:libaccesstoken_sdk",
67    "access_token:libnativetoken_shared",
68    "access_token:libtokensetproc_shared",
69    "background_task_mgr:bgtaskmgr_innerkits",
70    "bundle_framework:appexecfwk_base",
71    "bundle_framework:appexecfwk_core",
72    "c_utils:utils",
73    "data_share:datashare_common",
74    "data_share:datashare_consumer",
75    "hdf_core:libhdf_ipc_adapter",
76    "hdf_core:libhdi",
77    "hdf_core:libpub_utils",
78    "hilog:libhilog",
79    "ipc:ipc_single",
80    "kv_store:distributeddata_inner",
81    "media_foundation:media_monitor_client",
82    "media_foundation:media_monitor_common",
83    "os_account:os_account_innerkits",
84    "power_manager:powermgr_client",
85    "relational_store:native_appdatafwk",
86    "safwk:system_ability_fwk",
87    "samgr:samgr_proxy",
88  ]
89  if (accessibility_enable == true) {
90    external_deps += [
91      "accessibility:accessibility_common",
92      "accessibility:accessibilityconfig",
93    ]
94  }
95  if (bluetooth_part_enable == true) {
96    external_deps += [ "bluetooth:btframework" ]
97  }
98}
99
100group("fuzztest") {
101  testonly = true
102  deps = [ ":AudioPolicyServerFuzzTest" ]
103}
104