1# Copyright (c) 2024 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/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_unit_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 ] 51 52 cflags = av_codec_unittest_cflags 53 54 cflags_cc = cflags 55 56 public_configs = [] 57 58 if (av_codec_support_test) { 59 sources = [ "./source_unit_test.cpp" ] 60 } 61 62 deps = [ 63 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 64 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 65 "$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec", 66 "$av_codec_root_dir/services/media_engine/modules:av_codec_media_engine_modules", 67 "$av_codec_root_dir/services/services:av_codec_service", 68 "$av_codec_root_dir/services/utils:av_codec_service_utils", 69 ] 70 71 public_configs = [] 72 73 external_deps = [ 74 "ffmpeg:libohosffmpeg", 75 "graphic_surface:surface", 76 "media_foundation:native_media_core", 77 ] 78 79 resource_config_file = 80 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 81} 82