# Copyright (c) 2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("//foundation/multimedia/player_framework/config.gni") module_output_path = "player_framework/player" config("hiplayer_impl_unit_test_config") { visibility = [ ":*" ] cflags = [ "-O2", "-fPIC", "-Wall", "-fexceptions", "-fno-rtti", "-Wno-unused-but-set-variable", "-Wno-format", "-Dprivate=public", "-Dprotected=public", ] cflags_cc = cflags include_dirs = [ "./", "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/utils", "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", "$MEDIA_PLAYER_ROOT_DIR/services/services/player/client", "$MEDIA_PLAYER_ROOT_DIR/services/services/player/ipc", "$MEDIA_PLAYER_ROOT_DIR/services/services/player/server/", "$MEDIA_PLAYER_ROOT_DIR/services/utils/include", ] defines = [] if (target_cpu == "arm64" || is_emulator) { dragging_player_path = "\"/system/lib64\"" } else { dragging_player_path = "\"/system/lib\"" } defines += [ "DRAGGING_PLAYER_PATH=${dragging_player_path}" ] defines += player_framework_defines } ohos_unittest("hiplayer_impl_unit_test") { module_out_path = module_output_path stack_protector_ret = true sources = [ "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/dfx_agent.cpp", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/dragging_player_agent.cpp", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/hiplayer_callback_looper.cpp", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/hiplayer_impl.cpp", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player/seek_agent.cpp", "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_dfx.cpp", "$MEDIA_PLAYER_ROOT_DIR/services/utils/media_utils.cpp", "hiplayer_impl_unit_test.cpp", ] configs = [ ":hiplayer_impl_unit_test_config", "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx_public_config", "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils_public_config", ] sanitize = { integer_overflow = true ubsan = true boundary_sanitize = true cfi = true cfi_cross_dso = true debug = false } external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libprivacy_sdk", "audio_framework:audio_client", "audio_framework:audio_renderer", "av_codec:av_codec_client", "av_codec:av_codec_media_engine_filters", "av_codec:av_codec_media_engine_modules", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "graphic_surface:surface", "graphic_surface:sync_fence", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "hitrace:hitrace_meter", "hitrace:libhitracechain", "init:libbegetutil", "ipc:ipc_single", "libxml2:libxml2", "media_foundation:media_foundation", "qos_manager:qos", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] deps = [ "$MEDIA_PLAYER_ROOT_DIR/services/dfx:media_service_log_dfx", "$MEDIA_PLAYER_ROOT_DIR/services/engine/histreamer/player:media_engine_histreamer_player", "$MEDIA_PLAYER_ROOT_DIR/services/utils:media_service_utils", ] deps = [] }