• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/av_codec/config.gni")
18module_output_path = "av_codec/av_codec"
19MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/"
20
21##############################fuzztest##########################################
22ohos_fuzztest("SyncResourceCapiDecFuzzTest") {
23  module_out_path = module_output_path
24  fuzz_config_file = "$MEDIA_ROOT_DIR/test/fuzztest/syncresourcecapidec_fuzzer"
25  include_dirs = [
26    "$MEDIA_ROOT_DIR/interfaces/kits/c",
27    "$MEDIA_ROOT_DIR/test/fuzztest/syncresourcecapidec_fuzzer",
28    "$MEDIA_ROOT_DIR/test/unittest/common/",
29    "$MEDIA_ROOT_DIR/test/unittest/common/common_mock/drm_mock/capi",
30
31    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/utils",
32    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/data_producer/avcc_reader/",
33    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/data_producer/base/",
34    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/base",
35    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/mock",
36    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/mock/capi",
37    "$MEDIA_ROOT_DIR/test/fuzztest/sync_fuzzer/sample/decoder",
38    "$MEDIA_ROOT_DIR/test/fuzztest/sync_fuzzer/sample/encoder",
39    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test",
40    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test/capi",
41  ]
42
43  cflags = [
44    "-g",
45    "-O0",
46    "-Wno-unused-variable",
47    "-fno-omit-frame-pointer",
48  ]
49
50  defines = [
51    "VIDEODEC_SYNC_UNIT_TEST",
52    "VIDEODEC_CAPI_UNIT_TEST",
53  ]
54
55  sources = [
56    "syncresourcedec_fuzzer.cpp",
57    "$MEDIA_ROOT_DIR/test/fuzztest/sync_fuzzer/sample/decoder/vdec_sync_sample.cpp",
58
59    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test/capi/codeclist_capi_mock.cpp",
60    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test/capi/codeclist_capi_mock_factory.cpp",
61    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/data_producer/avcc_reader/avcc_reader.cpp",
62    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/utils/unittest_utils.cpp",
63    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/mock/capi/vcodec_capi_mock_factory.cpp",
64    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/mock/capi/videodec_capi_mock.cpp",
65    "$MEDIA_ROOT_DIR/test/unittest/common/common_mock/drm_mock/capi/media_key_system_mock.cpp",
66    ]
67
68  public_deps = [ "$MEDIA_ROOT_DIR/test/unittest/common:av_codec_capi_unit_test" ]
69
70
71  external_deps = [
72    "c_utils:utils",
73    "ffmpeg:libohosffmpeg",
74    "graphic_2d:libgraphic_utils",
75    "graphic_surface:surface",
76    "graphic_surface:sync_fence",
77    "hilog:libhilog",
78    "ipc:ipc_single",
79    "media_foundation:native_media_core",
80    "googletest:gtest",
81  ]
82
83  if (av_codec_support_drm) {
84    external_deps += [
85      "drm_framework:drm_framework",
86      "drm_framework:native_drm",
87    ]
88  }
89
90  resource_config_file =
91      "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
92}
93
94group("fuzztest") {
95  testonly = true
96  deps = []
97  deps += [
98    # deps file
99    ":SyncResourceCapiDecFuzzTest",  #引用测试套
100  ]
101}
102