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 17module_output_path = "av_codec/unittest" 18 19av_codec_unittest_cflags = [ 20 "-std=c++17", 21 "-fno-rtti", 22 "-Wall", 23 "-fno-common", 24 "-fstack-protector-strong", 25 "-Wshadow", 26 "-FPIC", 27 "-FS", 28 "-O2", 29 "-D_FORTIFY_SOURCE=2", 30 "-fvisibility=hidden", 31 "-Wformat=2", 32 "-Wdate-time", 33 "-Werror", 34 "-Wextra", 35 "-Wimplicit-fallthrough", 36 "-Wsign-compare", 37 "-Wno-unused-function", 38 "-Wno-unused-parameter", 39 "-Dprivate=public", 40 "-Dprotected=public", 41] 42 43################################################################################################################## 44ohos_unittest("sa_avcodec_unit_test") { 45 sanitize = av_codec_test_sanitize 46 module_out_path = module_output_path 47 include_dirs = [ 48 "./", 49 "./mock/include", 50 "$av_codec_root_dir/test/unittest/common", 51 "$av_codec_root_dir/interfaces/inner_api/native", 52 "$av_codec_root_dir/services/dfx/include", 53 "$av_codec_root_dir/services/include", 54 "$av_codec_root_dir/services/services/sa_avcodec/server/include", 55 "$av_codec_root_dir/services/services/sa_avcodec", 56 ] 57 58 defines = av_codec_defines 59 60 sources = [ 61 "$av_codec_root_dir/services/services/sa_avcodec/server/avcodec_server.cpp", 62 "$av_codec_root_dir/services/services/sa_avcodec/server/avcodec_server_manager.cpp", 63 "./mock/avcodec_service_stub_mock.cpp", 64 "./mock/codec_service_stub_mock.cpp", 65 "./mock/codeclist_service_stub_mock.cpp", 66 "./mock/mem_mgr_client_mock.cpp", 67 "./mock/system_ability_mock.cpp", 68 "./sa_avcodec_unit_test.cpp", 69 ] 70 71 cflags = av_codec_unittest_cflags 72 73 cflags_cc = cflags 74 75 deps = [ 76 "$av_codec_root_dir/services/dfx:av_codec_service_dfx", 77 "//third_party/googletest:gmock_main", 78 ] 79 80 external_deps = [ 81 "c_utils:utils", 82 "hilog:libhilog", 83 "ipc:ipc_single", 84 "media_foundation:media_foundation", 85 ] 86 87 resource_config_file = 88 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 89} 90