1# Copyright (c) 2020-2021 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 17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/" 18THIRD_ROOT_DIR = "//third_party/" 19module_output_path = "av_codec/moduletest" 20 21ohos_unittest("audio_encoder_module_test") { 22 module_out_path = module_output_path 23 sources = [ 24 "Avbuffer/src/avcodec_audio_avbuffer_encoder_demo.cpp", 25 "Avbuffer/src/common_tool.cpp", 26 "Avbuffer/src/fuzz_test.cpp", 27 "Avbuffer/src/null_check_test.cpp", 28 "Avbuffer/src/param_check_test.cpp", 29 "Avbuffer/src/status_check_test.cpp", 30 "Common/src/AudioEncoderDemoCommon.cpp", 31 "InnerAPI/InnerInterfaceDependCheckTest.cpp", 32 "InnerAPI/InnerParamCheckTest.cpp", 33 "NativeAPI/NativeInterfaceDependCheckTest.cpp", 34 "NativeAPI/NativeNullCheckTest.cpp", 35 "NativeAPI/NativeParamCheckTest.cpp", 36 ] 37 38 include_dirs = [ 39 "Avbuffer/include", 40 "Common/include", 41 "$MEDIA_ROOT_DIR/test/nativedemo/avmuxer", 42 "$MEDIA_ROOT_DIR/interfaces/kits/c", 43 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 44 "$MEDIA_ROOT_DIR/services/services/factory", 45 "$MEDIA_ROOT_DIR/services/engine/plugin/common", 46 "$MEDIA_ROOT_DIR/services/engine/plugin/core", 47 "$MEDIA_ROOT_DIR/services/engine/plugin/interface", 48 "$THIRD_ROOT_DIR/ffmpeg", 49 "$MEDIA_ROOT_DIR/frameworks/native/capi/common", 50 "$MEDIA_ROOT_DIR/services/dfx/include", 51 "$MEDIA_ROOT_DIR/services/engine/base/include", 52 "$MEDIA_ROOT_DIR/services/engine/codec/include/video", 53 "$MEDIA_ROOT_DIR/services/engine/common/include", 54 "$MEDIA_ROOT_DIR/services/engine/source/hst_releated", 55 "$MEDIA_ROOT_DIR/services/services/factory", 56 "$MEDIA_ROOT_DIR/services/utils/include", 57 "$MEDIA_ROOT_DIR/test/nativedemo/include", 58 ] 59 60 cflags = [ 61 "-Wall", 62 "-fno-rtti", 63 "-fno-exceptions", 64 "-fno-common", 65 "-fstack-protector-strong", 66 "-Wshadow", 67 "-FPIC", 68 "-FS", 69 "-O2", 70 "-D_FORTIFY_SOURCE=2", 71 "-fvisibility=hidden", 72 "-Wformat=2", 73 "-Wdate-time", 74 "-Werror", 75 "-Wextra", 76 "-Wimplicit-fallthrough", 77 "-Wsign-compare", 78 "-Wunused-parameter", 79 "-Wno-deprecated-declarations", 80 ] 81 82 deps = [ 83 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 84 "$MEDIA_ROOT_DIR/interfaces/kits/c:capi_packages", 85 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_avmuxer", 86 "$MEDIA_ROOT_DIR/services/services:av_codec_service", 87 "$THIRD_ROOT_DIR/bounds_checking_function:libsec_static", 88 "$THIRD_ROOT_DIR/ffmpeg:libohosffmpeg", 89 ] 90 91 external_deps = [ 92 "c_utils:utils", 93 "hilog:libhilog", 94 "ipc:ipc_core", 95 "media_foundation:capi_packages", 96 "media_foundation:media_foundation", 97 ] 98 99 resource_config_file = 100 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 101} 102