• 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("SyncResourceCapiEncFuzzTest") {
23  module_out_path = module_output_path
24  fuzz_config_file = "$MEDIA_ROOT_DIR/test/fuzztest/syncresourcecapienc_fuzzer"
25  include_dirs = [
26    "$MEDIA_ROOT_DIR/interfaces/kits/c",
27    "$MEDIA_ROOT_DIR/test/fuzztest/syncresourcecapienc_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/encoder",
38    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test",
39    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test/capi",
40  ]
41  cflags = [
42    "-g",
43    "-O0",
44    "-Wno-unused-variable",
45    "-fno-omit-frame-pointer",
46  ]
47  sources = [
48    "syncresourceenc_fuzzer.cpp",
49    "$MEDIA_ROOT_DIR/test/fuzztest/sync_fuzzer/sample/encoder/venc_sync_sample.cpp",
50
51    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test/capi/codeclist_capi_mock.cpp",
52    "$MEDIA_ROOT_DIR/test/unittest/codeclist_test/capi/codeclist_capi_mock_factory.cpp",
53    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/data_producer/avcc_reader/avcc_reader.cpp",
54    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/common/utils/unittest_utils.cpp",
55    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/mock/capi/vcodec_capi_mock_factory.cpp",
56    "$MEDIA_ROOT_DIR/test/unittest/video_test/vcodec_framework_test/func_sample/mock/capi/videoenc_capi_mock.cpp",
57    "$MEDIA_ROOT_DIR/test/unittest/common/common_mock/drm_mock/capi/media_key_system_mock.cpp",
58     ]
59
60  defines = [
61    "VIDEOENC_CAPI_UNIT_TEST",
62    "VIDEOENC_SYNC_UNIT_TEST",
63  ]
64  public_deps =
65      [ "$MEDIA_ROOT_DIR/test/unittest/common:av_codec_capi_unit_test" ]
66
67  external_deps = [
68    "c_utils:utils",
69    "ffmpeg:libohosffmpeg",
70    "graphic_2d:libgraphic_utils",
71    "graphic_surface:surface",
72    "graphic_surface:sync_fence",
73    "hilog:libhilog",
74    "ipc:ipc_single",
75    "media_foundation:native_media_core",
76    "googletest:gtest",
77  ]
78
79  if (av_codec_support_drm) {
80    external_deps += [
81      "drm_framework:drm_framework",
82      "drm_framework:native_drm",
83    ]
84  }
85
86  resource_config_file =
87      "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml"
88}
89
90group("fuzztest") {
91  testonly = true
92  deps = []
93
94  deps += [
95    # deps file
96    ":SyncResourceCapiEncFuzzTest",  #引用测试套
97  ]
98}
99