1# Copyright (c) 2023 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/media_foundation/config.gni") 16 17module_output_path = "media_foundation/unittest" 18 19group("format_unit_test") { 20 testonly = true 21 deps = [ 22 ":format_capi_unit_test", 23 ":format_inner_unit_test", 24 ":format_unit_channel_layout_test", 25 ] 26} 27 28avcodec_unittest_cflags = [ 29 "-std=c++17", 30 "-frtti", 31 "-fexceptions", 32 "-Wall", 33 "-fno-common", 34 "-fstack-protector-strong", 35 "-Wshadow", 36 "-FPIC", 37 "-FS", 38 "-O2", 39 "-D_FORTIFY_SOURCE=2", 40 "-fvisibility=hidden", 41 "-Wformat=2", 42 "-Wdate-time", 43 "-Werror", 44 "-Wextra", 45 "-Wimplicit-fallthrough", 46 "-Wsign-compare", 47 "-Wunused-parameter", 48] 49 50################################################################################################################## 51ohos_unittest("format_capi_unit_test") { 52 module_out_path = module_output_path 53 include_dirs = [ 54 "./", 55 "./capi", 56 "$histreamer_root_dir/interface/kits/c", 57 ] 58 59 cflags = avcodec_unittest_cflags 60 61 sources = [ "./avformat_unit_test.cpp" ] 62 63 defines = [ 64 "HST_ANY_WITH_NO_RTTI", 65 "MEDIA_OHOS", 66 "AVFORMAT_CAPI_UNIT_TEST", 67 ] 68 69 public_deps = [ "../common:media_foundation_capi_unit_test" ] 70} 71 72################################################################################################################## 73ohos_unittest("format_inner_unit_test") { 74 module_out_path = module_output_path 75 include_dirs = [ 76 "./", 77 "./inner", 78 "$histreamer_root_dir/interface/inner_api/buffer", 79 ] 80 81 cflags = avcodec_unittest_cflags 82 83 sources = [ "./avformat_unit_test.cpp" ] 84 85 defines = [ 86 "HST_ANY_WITH_NO_RTTI", 87 "MEDIA_OHOS", 88 ] 89 public_deps = [ "../common:media_foundation_inner_unit_test" ] 90} 91 92################################################################################################################## 93ohos_unittest("format_unit_channel_layout_test") { 94 module_out_path = module_output_path 95 include_dirs = [ 96 "./", 97 "./capi", 98 "$histreamer_root_dir/interface/inner_api/buffer", 99 ] 100 101 cflags = avcodec_unittest_cflags 102 103 sources = [ "./avformat_unit_channel_layout_test.cpp" ] 104 105 defines = [ 106 "HST_ANY_WITH_NO_RTTI", 107 "MEDIA_OHOS", 108 ] 109 public_deps = [ "../common:media_foundation_inner_unit_test" ] 110} 111