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 14import("//build/test.gni") 15import("//foundation/multimedia/av_codec/config.gni") 16 17module_output_path = "av_codec/AVCodec_Video/unittest" 18 19av_codec_unittest_cflags = [ 20 "-std=c++17", 21 "-fno-rtti", 22 "-Wall", 23 "-fno-common", 24 "-fstack-protector-strong", 25 "-Wshadow", 26 "-FPIC", 27 "-FS", 28 "-O2", 29 "-D_FORTIFY_SOURCE=2", 30 "-fvisibility=hidden", 31 "-Wformat=2", 32 "-Wdate-time", 33 "-Werror", 34 "-Wextra", 35 "-Wimplicit-fallthrough", 36 "-Wsign-compare", 37 "-Wno-unused-function", 38 "-Wno-unused-parameter", 39 "-Dprivate=public", 40 "-Dprotected=public", 41] 42 43################################################################################################################## 44avc_codec_coverage_unit_include_dirs = [ 45 "$av_codec_root_dir/services/engine/base/include", 46 "$av_codec_root_dir/services/engine/codec/video/avcencoder", 47 "$av_codec_root_dir/services/engine/codec/video/avcencoder/include", 48 "$av_codec_root_dir/interfaces/inner_api/native", 49 "$av_codec_root_dir/services/dfx/include", 50 "$av_codec_root_dir/services/engine/common/include", 51 "$av_codec_root_dir/services/utils/include", 52 "$av_codec_root_dir/services/engine/plugin/interface", 53] 54 55ohos_unittest("avc_codec_coverage_unit_test") { 56 sanitize = av_codec_test_sanitize 57 module_out_path = module_output_path 58 cflags = av_codec_unittest_cflags 59 cflags_cc = cflags 60 include_dirs = avc_codec_coverage_unit_include_dirs 61 defines = av_codec_defines 62 63 if (!is_emulator && target_cpu == "arm64") { 64 defines += [ "ARMV8" ] 65 } 66 67 sources = [ 68 "$av_codec_root_dir/services/engine/codec/video/avcencoder/avc_encoder.cpp", 69 "$av_codec_root_dir/services/engine/codec/video/avcencoder/avc_encoder_api.cpp", 70 "$av_codec_root_dir/services/engine/codec/video/avcencoder/avc_encoder_convert.cpp", 71 "$av_codec_root_dir/services/engine/codec/video/avcencoder/avc_encoder_util.cpp", 72 "./avc_codec_coverage_unit_test.cpp", 73 ] 74 75 deps = [ 76 "$av_codec_root_dir/services/engine/base:av_codec_codec_base", 77 "$av_codec_root_dir/services/engine/common:av_codec_engine_common", 78 ] 79 80 public_deps = [ 81 "$av_codec_root_dir/services/dfx:av_codec_service_dfx", 82 "$av_codec_root_dir/services/utils:av_codec_service_utils", 83 ] 84 85 external_deps = [ 86 "bounds_checking_function:libsec_static", 87 "c_utils:utils", 88 "ffmpeg:libohosffmpeg", 89 "graphic_surface:surface", 90 "graphic_surface:sync_fence", 91 "hilog:libhilog", 92 "hisysevent:libhisysevent", 93 "hitrace:hitrace_meter", 94 "init:libbegetutil", 95 "media_foundation:media_foundation", 96 ] 97 98 resource_config_file = 99 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 100} 101