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. 13import("//build/test.gni") 14import("//foundation/multimedia/av_codec/config.gni") 15 16module_output_path = "av_codec/unittest" 17 18av_codec_unittest_include_dirs = [ 19 "$av_codec_root_dir/interfaces/inner_api/native", 20 "$av_codec_root_dir/interfaces/interfaces/inner_api/native", 21] 22 23av_codec_unittest_cflags = [ 24 "-std=c++17", 25 "-fno-rtti", 26 "-fno-exceptions", 27 "-Wall", 28 "-fno-common", 29 "-fstack-protector-strong", 30 "-Wshadow", 31 "-FPIC", 32 "-FS", 33 "-O2", 34 "-D_FORTIFY_SOURCE=2", 35 "-fvisibility=hidden", 36 "-Wformat=2", 37 "-Wdate-time", 38 "-Werror", 39 "-Wextra", 40 "-Wimplicit-fallthrough", 41 "-Wsign-compare", 42 "-Wunused-parameter", 43] 44 45################################################################################################################## 46ohos_unittest("audio_vivid_capi_unit_test") { 47 module_out_path = module_output_path 48 include_dirs = av_codec_unittest_include_dirs 49 include_dirs += [ 50 "./", 51 "//third_party/ffmpeg", 52 "$av_codec_root_dir/interfaces/kits/c", 53 "$av_codec_root_dir/services/engine/common/include", 54 "$av_codec_root_dir/services/engine/base/include", 55 "$av_codec_root_dir/services/utils/include", 56 "$av_codec_root_dir/services/engine/codec/include/audio", 57 "$av_codec_root_dir/services/engine/factory", 58 ] 59 60 cflags = av_codec_unittest_cflags 61 62 cflags_cc = cflags 63 64 public_configs = [] 65 66 if (av_codec_support_test) { 67 sources = [ "./audio_decoder_capi_avbuffer_vivid_unit_test.cpp" ] 68 } 69 70 deps = [ 71 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 72 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 73 "$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec", 74 "$av_codec_root_dir/services/services:av_codec_service", 75 "$av_codec_root_dir/services/utils:av_codec_service_utils", 76 ] 77 78 external_deps = [ 79 "graphic_surface:surface", 80 "media_foundation:capi_packages", 81 ] 82 83 resource_config_file = 84 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 85} 86 87################################################################################################################## 88ohos_unittest("audio_vivid_inner_unit_test") { 89 module_out_path = module_output_path 90 include_dirs = av_codec_unittest_include_dirs 91 include_dirs += [ 92 "./", 93 "//third_party/ffmpeg", 94 "$av_codec_root_dir/interfaces/kits/c", 95 "$av_codec_root_dir/services/engine/common/include", 96 "$av_codec_root_dir/services/engine/base/include", 97 "$av_codec_root_dir/services/utils/include", 98 "$av_codec_root_dir/services/engine/codec/include/audio", 99 "$av_codec_root_dir/services/engine/factory", 100 ] 101 102 cflags = av_codec_unittest_cflags 103 104 cflags_cc = cflags 105 106 public_configs = [] 107 108 if (av_codec_support_test) { 109 sources = [ "./audio_decoder_avbuffer_vivid_inner_unit_test.cpp" ] 110 } 111 112 deps = [ 113 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 114 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 115 "$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec", 116 "$av_codec_root_dir/services/services:av_codec_service", 117 "$av_codec_root_dir/services/utils:av_codec_service_utils", 118 ] 119 120 external_deps = [ 121 "graphic_surface:surface", 122 "media_foundation:capi_packages", 123 ] 124 125 resource_config_file = 126 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 127} 128 129################################################################################################################## 130ohos_unittest("audio_vivid_ability_unit_test") { 131 module_out_path = module_output_path 132 include_dirs = av_codec_unittest_include_dirs 133 include_dirs += [ 134 "./", 135 "//third_party/ffmpeg", 136 "$av_codec_root_dir/interfaces/kits/c", 137 "$av_codec_root_dir/services/engine/common/include", 138 "$av_codec_root_dir/services/engine/base/include", 139 "$av_codec_root_dir/services/utils/include", 140 "$av_codec_root_dir/services/engine/codec/include/audio", 141 "$av_codec_root_dir/services/engine/factory", 142 ] 143 144 cflags = av_codec_unittest_cflags 145 146 cflags_cc = cflags 147 148 public_configs = [] 149 150 if (av_codec_support_test) { 151 sources = [ "./audio_decoder_avbuffer_vivid_unit_test.cpp" ] 152 } 153 154 deps = [ 155 "$av_codec_root_dir/interfaces/inner_api/native:av_codec_client", 156 "$av_codec_root_dir/interfaces/kits/c:capi_packages", 157 "$av_codec_root_dir/services/engine/codec/audio:av_codec_audio_ffmpeg_codec", 158 "$av_codec_root_dir/services/services:av_codec_service", 159 "$av_codec_root_dir/services/utils:av_codec_service_utils", 160 ] 161 162 external_deps = [ 163 "graphic_surface:surface", 164 "media_foundation:capi_packages", 165 ] 166 167 resource_config_file = 168 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 169} 170