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_include_dirs = [ 20 "$av_codec_root_dir/interfaces/inner_api/native", 21 "$av_codec_root_dir/interfaces/interfaces/inner_api/native", 22] 23 24av_codec_unittest_cflags = [ 25 "-O2", 26 "-fPIC", 27 "-Wall", 28 "-fexceptions", 29 "-fno-rtti", 30 "-Wno-unused-but-set-variable", 31 "-Wno-format", 32 "-Dprivate=public", 33 "-Dprotected=public", 34] 35 36################################################################################################################## 37ohos_unittest("source_test") { 38 sanitize = av_codec_test_sanitize 39 module_out_path = module_output_path 40 include_dirs = av_codec_unittest_include_dirs 41 include_dirs += [ 42 "./", 43 "$av_codec_root_dir/interfaces/kits/c", 44 "$av_codec_root_dir/services/engine/common/include", 45 "$av_codec_root_dir/services/engine/base/include", 46 "$av_codec_root_dir/services/utils/include", 47 "$av_codec_root_dir/services/engine/codec/include/audio", 48 "$av_codec_root_dir/services/engine/factory", 49 "$av_codec_root_dir/services/media_engine/modules/source", 50 "./mock", 51 ] 52 53 cflags = av_codec_unittest_cflags 54 55 cflags_cc = cflags 56 57 public_configs = [] 58 59 if (av_codec_support_test) { 60 sources = [ 61 "./source_test.cpp", 62 ] 63 } 64 65 deps = [ 66 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 67 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 68 "$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec", 69 "$av_codec_root_dir/services/media_engine/modules:av_codec_media_engine_modules", 70 "$av_codec_root_dir/services/services:av_codec_service", 71 "$av_codec_root_dir/services/utils:av_codec_service_utils", 72 ] 73 74 public_configs = [] 75 76 external_deps = [ 77 "googletest:gmock", 78 "googletest:gtest", 79 "ffmpeg:libohosffmpeg", 80 "graphic_surface:surface", 81 "ipc:ipc_single", 82 "media_foundation:native_media_core", 83 ] 84 85 resource_config_file = 86 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 87} 88