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/AVCodec_Video/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 "$av_codec_root_dir/services/services/sa_avcodec/ipc", 57 "$av_codec_root_dir/services/services/common", 58 "$av_codec_root_dir/services/services/common/event_manager/event_handler/background_event_handler/", 59 ] 60 61 defines = av_codec_defines 62 63 sources = [ 64 "$av_codec_root_dir/services/services/common/event_manager/event_handler/background_event_handler/background_event_handler.cpp", 65 "$av_codec_root_dir/services/services/sa_avcodec/server/avcodec_server.cpp", 66 "$av_codec_root_dir/services/services/sa_avcodec/server/avcodec_server_manager.cpp", 67 "./mock/avcodec_service_stub_mock.cpp", 68 "./mock/codec_service_stub_mock.cpp", 69 "./mock/codeclist_service_stub_mock.cpp", 70 "./mock/mem_mgr_client_mock.cpp", 71 "./mock/system_ability_mock.cpp", 72 "./sa_avcodec_unit_test.cpp", 73 ] 74 75 cflags = av_codec_unittest_cflags 76 77 cflags_cc = cflags 78 79 deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ] 80 81 external_deps = [ 82 "c_utils:utils", 83 "googletest:gmock_main", 84 "hilog:libhilog", 85 "hisysevent:libhisysevent", 86 "init:libbegetutil", 87 "ipc:ipc_single", 88 "media_foundation:media_foundation", 89 "samgr:samgr_proxy", 90 ] 91 92 resource_config_file = 93 "$av_codec_root_dir/test/unittest/resources/ohos_test.xml" 94} 95