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