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("AsyncResourceCapiDecFuzzTest") { 23 module_out_path = module_output_path 24 fuzz_config_file = "$MEDIA_ROOT_DIR/test/fuzztest/asyncresourcecapidec_fuzzer" 25 include_dirs = [ 26 "$MEDIA_ROOT_DIR/interfaces/kits/c", 27 "$MEDIA_ROOT_DIR/test/fuzztest/asyncresourcecapidec_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/unittest/video_test/vcodec_framework_test/func_sample/mock/inner", 38 "$MEDIA_ROOT_DIR/test/fuzztest/sync_fuzzer/sample/decoder", 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_ASYNC_UNIT_TEST", 52 "VIDEODEC_CAPI_UNIT_TEST", 53 ] 54 55 sources = [ 56 "asyncresourcedec_fuzzer.cpp", 57 "$MEDIA_ROOT_DIR/test/fuzztest/sync_fuzzer/sample/decoder/vdec_async_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 external_deps = [ 70 "c_utils:utils", 71 "ffmpeg:libohosffmpeg", 72 "graphic_2d:libgraphic_utils", 73 "graphic_surface:surface", 74 "graphic_surface:sync_fence", 75 "hilog:libhilog", 76 "ipc:ipc_single", 77 "media_foundation:native_media_core", 78 "googletest:gtest", 79 ] 80 81 if (av_codec_support_drm) { 82 external_deps += [ 83 "drm_framework:drm_framework", 84 "drm_framework:native_drm", 85 ] 86 } 87 88 resource_config_file = 89 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 90} 91 92 93group("fuzztest") { 94 testonly = true 95 deps = [] 96 deps += [ 97 # deps file 98 ":AsyncResourceCapiDecFuzzTest", #引用测试套 99 ] 100} 101