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/av_codec/config.gni") 16 17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/" 18module_output_path = "av_codec/AVCodec_Video/moduletest" 19 20encoder_moduletest_native_include_dirs = [ 21 "./include", 22 "$MEDIA_ROOT_DIR/interfaces/kits/c", 23 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 24] 25 26encoder_moduletest_cflags = [ 27 "-std=c++17", 28 "-fno-rtti", 29 "-fno-exceptions", 30 "-Wall", 31 "-fno-common", 32 "-fstack-protector-strong", 33 "-Wshadow", 34 "-FPIC", 35 "-FS", 36 "-O2", 37 "-D_FORTIFY_SOURCE=2", 38 "-fvisibility=hidden", 39 "-Wformat=2", 40 "-Wdate-time", 41 "-Werror", 42 "-Wextra", 43 "-Wimplicit-fallthrough", 44 "-Wsign-compare", 45 "-Wunused-parameter", 46] 47 48################################################################################################################## 49ohos_unittest("encoder_native_module_test") { 50 sanitize = av_codec_test_sanitize 51 module_out_path = module_output_path 52 include_dirs = encoder_moduletest_native_include_dirs 53 include_dirs += [ "./" ] 54 cflags = encoder_moduletest_cflags 55 56 if (av_codec_support_codec) { 57 sources = [ 58 "./src/InnerAPI/api_test.cpp", 59 "./src/InnerAPI/capability_test.cpp", 60 "./src/InnerAPI/func2_test.cpp", 61 "./src/InnerAPI/func_test.cpp", 62 "./src/InnerAPI/sqrbfunc_test.cpp", 63 "./src/InnerAPI/videoenc_ndk_inner_sample.cpp", 64 "./src/api_test.cpp", 65 "./src/configure_test.cpp", 66 "./src/func2_test.cpp", 67 "./src/func3_test.cpp", 68 "./src/func_test.cpp", 69 "./src/temporal_test.cpp", 70 71 #"./src/perf_test.cpp", 72 "./src/getparam_test.cpp", 73 74 #"./src/reli_test.cpp", 75 "./src/setparam_test.cpp", 76 "./src/state_test.cpp", 77 "./src/videoenc_api11_sample.cpp", 78 "./src/videoenc_ndk_sample.cpp", 79 ] 80 } 81 82 deps = [ 83 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 84 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_codecbase", 85 "$MEDIA_ROOT_DIR/interfaces/kits/c:native_media_venc", 86 ] 87 external_deps = [ 88 "c_utils:utils", 89 "graphic_2d:libgraphic_utils", 90 "graphic_2d:librender_service_client", 91 "graphic_surface:surface", 92 "hilog:libhilog", 93 "ipc:ipc_single", 94 "media_foundation:media_foundation", 95 "media_foundation:native_media_core", 96 "openssl:libcrypto_shared", 97 "window_manager:libwm", 98 ] 99 100 resource_config_file = 101 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 102} 103