• 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")
18
19ohos_fuzztest("AudioPolicyConcurrencyFuzzTest") {
20  module_out_path = "audio_framework/audio_framework_route"
21  fuzz_config_file = "../audiopolicyconcurrency_fuzzer"
22
23  include_dirs = [
24    "../../../services/audio_policy/server/include",
25    "../../../services/audio_policy/server/include/service",
26    "../../../services/audio_policy/server/include/service/concurrency",
27    "../../../services/audio_policy/server/include/service/listener",
28    "../../../../../communication/bluetooth/interfaces/inner_api/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
50  sources = [ "audio_policy_concurrency_fuzzer.cpp" ]
51
52  deps = [
53    "../../../services/audio_policy:audio_policy_service_static",
54    "../../../services/audio_service:audio_client",
55  ]
56
57  external_deps = [
58    "ability_base:want",
59    "ability_runtime:extension_manager",
60    "access_token:libaccesstoken_sdk",
61    "access_token:libnativetoken_shared",
62    "access_token:libtokensetproc_shared",
63    "bundle_framework:appexecfwk_base",
64    "bundle_framework:appexecfwk_core",
65    "c_utils:utils",
66    "data_share:datashare_common",
67    "data_share:datashare_consumer",
68    "hdf_core:libhdf_ipc_adapter",
69    "hdf_core:libhdi",
70    "hdf_core:libpub_utils",
71    "hilog:libhilog",
72    "ipc:ipc_single",
73    "kv_store:distributeddata_inner",
74    "media_foundation:media_monitor_client",
75    "media_foundation:media_monitor_common",
76    "os_account:os_account_innerkits",
77    "power_manager:powermgr_client",
78    "pulseaudio:pulse",
79    "relational_store:native_appdatafwk",
80    "safwk:system_ability_fwk",
81    "samgr:samgr_proxy",
82  ]
83  if (accessibility_enable == true) {
84    external_deps += [
85      "accessibility:accessibility_common",
86      "accessibility:accessibilityconfig",
87    ]
88  }
89}
90
91group("fuzztest") {
92  testonly = true
93  deps = [ ":AudioPolicyConcurrencyFuzzTest" ]
94}
95