• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/avcodec"
19
20vcodec_fuzztest_include_dirs = [
21  "../../../../../../../foundation/window/window_manager/interfaces/innerkits/wm",
22  "../../../../interfaces/inner_api/native",
23  "../../../../test/unittest/avcodec_test/",
24  "../../../../test/unittest/avcodec_test/native/audiodecoder/",
25  "../../../../test/unittest/avcodec_test/native/audioencoder/",
26  "../../../../test/unittest/avcodec_test/native/avcodec_info/",
27  "../../../../test/unittest/avcodec_test/native/avcodec_list/",
28  "../../../../test/unittest/avcodec_test/native/avformat/",
29  "../../../../test/unittest/avcodec_test/native/avmemory/",
30  "../../../../test/unittest/avcodec_test/native/enum/",
31  "../../../../test/unittest/avcodec_test/native/surface/",
32  "../../../../test/unittest/avcodec_test/native/videodecoder/",
33  "../../../../test/unittest/avcodec_test/native/videoencoder/",
34  "../../../../test/unittest/avcodec_test/vcodec_test/",
35  "../../../../test/unittest/common/include/",
36]
37
38vcodec_fuzztest_cflags = [
39  "-std=c++17",
40  "-fno-rtti",
41  "-fno-exceptions",
42  "-Wall",
43  "-fno-common",
44  "-fstack-protector-strong",
45  "-Wshadow",
46  "-FPIC",
47  "-FS",
48  "-O2",
49  "-D_FORTIFY_SOURCE=2",
50  "-fvisibility=hidden",
51  "-Wformat=2",
52  "-Wdate-time",
53  "-Werror",
54  "-Wextra",
55  "-Wimplicit-fallthrough",
56  "-Wsign-compare",
57  "-Wunused-parameter",
58]
59
60##############################fuzztest##########################################
61ohos_fuzztest("VCodecFileFuzzTest") {
62  module_out_path = module_output_path
63  fuzz_config_file =
64      "../../../../test/fuzztest/avcodec_fuzztest/vcodecfile_fuzzer"
65
66  resource_config_file = "../../../../test/fuzztest/resource/ohos_test.xml"
67  include_dirs = vcodec_fuzztest_include_dirs
68  include_dirs += [
69    "../../../../services/utils/include",
70    "../../../../test/fuzztest/common/",
71    "../../../../test/fuzztest/vcodecfile_fuzzer",
72  ]
73  cflags = vcodec_fuzztest_cflags
74  cflags += [
75    "-g",
76    "-O0",
77    "-Wno-unused-variable",
78    "-fno-omit-frame-pointer",
79  ]
80  if (multimedia_player_framework_support_codec) {
81    sources = [
82      "../../../../test/unittest/avcodec_test/native/avcodec_mock_factory.cpp",
83      "../../../../test/unittest/avcodec_test/native/avformat/avformat_native_mock.cpp",
84      "../../../../test/unittest/avcodec_test/native/avmemory/avmemory_native_mock.cpp",
85      "../../../../test/unittest/avcodec_test/native/surface/surface_native_mock.cpp",
86      "../../../../test/unittest/avcodec_test/native/videodecoder/videodec_native_mock.cpp",
87      "../../../../test/unittest/avcodec_test/native/videoencoder/videoenc_native_mock.cpp",
88      "../../../../test/unittest/avcodec_test/vcodec_test/vdec_mock.cpp",
89      "../../../../test/unittest/avcodec_test/vcodec_test/venc_mock.cpp",
90      "../../common/aw_common.cpp",
91      "vcodecfile_fuzzer.cpp",
92    ]
93  }
94  deps = [
95    "../../../../../../../foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client",
96    "../../../../../../../foundation/window/window_manager/wm:libwm",
97  ]
98  external_deps = [
99    "c_utils:utils",
100    "graphic_surface:surface",
101    "hilog:libhilog",
102    "player_framework:media_client",
103  ]
104}
105
106###############################################################################
107
108