1# Copyright (c) 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
14#####################hydra-fuzz###################
15import("//build/config/features.gni")
16import("//build/test.gni")
17import("//foundation/multimedia/player_framework/config.gni")
18module_output_path = "$MODULE_OUTPUT_PATH/media_player"
19
20##############################fuzztest##########################################
21ohos_fuzztest("PlayerServiceStubFuzzTest") {
22  module_out_path = module_output_path
23  fuzz_config_file =
24      "../../../../test/fuzztest/player_fuzztest/playerservicestub_fuzzer"
25
26  include_dirs = [
27    "../../../../services/include",
28    "../../../../services/services/sa_media/ipc",
29    "../../../../test/fuzztest/player_fuzztest",
30    "../../../../interfaces/inner_api/native",
31    "../../../../test/fuzztest/common",
32  ]
33  cflags = [
34    "-std=c++17",
35    "-fno-rtti",
36    "-fno-exceptions",
37    "-Wall",
38    "-fno-common",
39    "-fstack-protector-strong",
40    "-Wshadow",
41    "-FPIC",
42    "-FS",
43    "-O2",
44    "-D_FORTIFY_SOURCE=2",
45    "-fvisibility=hidden",
46    "-Wformat=2",
47    "-Wfloat-equal",
48    "-Wdate-time",
49    "-Werror",
50    "-Wextra",
51    "-Wimplicit-fallthrough",
52    "-Wsign-compare",
53    "-Wunused-parameter",
54    "-DBINDER_IPC_32BIT",
55  ]
56  if (player_framework_support_player) {
57    sources = [ "playerservicestub_fuzzer.cpp" ]
58  }
59  deps = [ "../../../../services/services:media_service" ]
60  external_deps = [
61    "c_utils:utils",
62    "drivers_peripheral_display:hdi_gralloc_client",
63    "graphic_surface:surface",
64    "ipc:ipc_single",
65    "player_framework:media_client",
66    "safwk:system_ability_fwk",
67    "samgr:samgr_proxy",
68  ]
69}
70