# Copyright (c) 2021 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/appexecfwk/standard/appexecfwk.gni") import( "//foundation/appexecfwk/standard/services/bundlemgr/appexecfwk_bundlemgr.gni") config("private_config") { include_dirs = [ "${services_path}/bundlemgr/test/mock/include" ] } module_output_path = "appexecfwk_standard/bundlemgrservice" ohos_unittest("BmsDataMgrTest") { module_out_path = module_output_path include_dirs = [ "//third_party/jsoncpp/include" ] sources = [ "${innerkits_path}/appexecfwk_base/src/ability_info.cpp", "${innerkits_path}/appexecfwk_base/src/application_info.cpp", "${innerkits_path}/appexecfwk_base/src/bundle_info.cpp", "${innerkits_path}/appexecfwk_base/src/element_name.cpp", "${services_path}/bundlemgr/src/bundle_data_mgr.cpp", "${services_path}/bundlemgr/src/bundle_data_storage_database.cpp", "${services_path}/bundlemgr/src/bundle_mgr_host_impl.cpp", "${services_path}/bundlemgr/src/bundle_mgr_service.cpp", "${services_path}/bundlemgr/src/bundle_mgr_service_event_handler.cpp", "${services_path}/bundlemgr/src/bundle_scanner.cpp", "${services_path}/bundlemgr/src/bundle_status_callback_death_recipient.cpp", "${services_path}/bundlemgr/src/kvstore_death_recipient_callback.cpp", "${services_path}/bundlemgr/src/module_usage_data_storage.cpp", "${services_path}/bundlemgr/src/permission_changed_death_recipient.cpp", ] sources += [ "${services_path}/bundlemgr/test/mock/src/mock_status_receiver.cpp", "${services_path}/bundlemgr/test/mock/src/system_ability_helper.cpp", ] sources += bundle_install_sources sources += [ "bms_data_mgr_test.cpp" ] configs = [ "${services_path}/bundlemgr/test:bundlemgr_test_config", "${libs_path}/libeventhandler:libeventhandler_config", "${innerkits_path}/appexecfwk_base:appexecfwk_base_sdk_config", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", "${libs_path}/libeventhandler:libeventhandler_target", "${services_path}/bundlemgr:bundle_parser", "${services_path}/bundlemgr:parser_common", "//base/security/appverify/interfaces/innerkits/appverify:libhapverify", "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", "//third_party/googletest:gtest_main", "//third_party/jsoncpp:jsoncpp", "//utils/native/base:utils", ] deps += bundle_install_deps external_deps = [ "ces_standard:cesfwk_innerkits", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", ] } group("unittest") { testonly = true deps = [ ":BmsDataMgrTest" ] }