1# Copyright (c) 2021 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/appexecfwk/standard/appexecfwk.gni") 16import( 17 "//foundation/appexecfwk/standard/services/bundlemgr/appexecfwk_bundlemgr.gni") 18 19config("private_config") { 20 include_dirs = [ "${services_path}/bundlemgr/test/mock/include" ] 21} 22 23module_output_path = "appexecfwk_standard/bundlemgrservice" 24 25ohos_unittest("BmsDataMgrTest") { 26 module_out_path = module_output_path 27 include_dirs = [ "//third_party/jsoncpp/include" ] 28 sources = [ 29 "${innerkits_path}/appexecfwk_base/src/ability_info.cpp", 30 "${innerkits_path}/appexecfwk_base/src/application_info.cpp", 31 "${innerkits_path}/appexecfwk_base/src/bundle_info.cpp", 32 "${innerkits_path}/appexecfwk_base/src/element_name.cpp", 33 "${services_path}/bundlemgr/src/bundle_data_mgr.cpp", 34 "${services_path}/bundlemgr/src/bundle_data_storage_database.cpp", 35 "${services_path}/bundlemgr/src/bundle_mgr_host_impl.cpp", 36 "${services_path}/bundlemgr/src/bundle_mgr_service.cpp", 37 "${services_path}/bundlemgr/src/bundle_mgr_service_event_handler.cpp", 38 "${services_path}/bundlemgr/src/bundle_scanner.cpp", 39 "${services_path}/bundlemgr/src/bundle_status_callback_death_recipient.cpp", 40 "${services_path}/bundlemgr/src/kvstore_death_recipient_callback.cpp", 41 "${services_path}/bundlemgr/src/module_usage_data_storage.cpp", 42 "${services_path}/bundlemgr/src/permission_changed_death_recipient.cpp", 43 ] 44 45 sources += [ 46 "${services_path}/bundlemgr/test/mock/src/mock_status_receiver.cpp", 47 "${services_path}/bundlemgr/test/mock/src/system_ability_helper.cpp", 48 ] 49 50 sources += bundle_install_sources 51 52 sources += [ "bms_data_mgr_test.cpp" ] 53 54 configs = [ 55 "${services_path}/bundlemgr/test:bundlemgr_test_config", 56 "${libs_path}/libeventhandler:libeventhandler_config", 57 "${innerkits_path}/appexecfwk_base:appexecfwk_base_sdk_config", 58 ] 59 cflags = [] 60 if (target_cpu == "arm") { 61 cflags += [ "-DBINDER_IPC_32BIT" ] 62 } 63 deps = [ 64 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", 65 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", 66 "${libs_path}/libeventhandler:libeventhandler_target", 67 "${services_path}/bundlemgr:bundle_parser", 68 "${services_path}/bundlemgr:parser_common", 69 "//base/security/appverify/interfaces/innerkits/appverify:libhapverify", 70 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", 71 "//foundation/aafwk/standard/interfaces/innerkits/base:base", 72 "//foundation/aafwk/standard/interfaces/innerkits/want:want", 73 "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", 74 "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", 75 "//third_party/googletest:gtest_main", 76 "//third_party/jsoncpp:jsoncpp", 77 "//utils/native/base:utils", 78 ] 79 80 deps += bundle_install_deps 81 82 external_deps = [ 83 "ces_standard:cesfwk_innerkits", 84 "hiviewdfx_hilog_native:libhilog", 85 "ipc:ipc_core", 86 ] 87} 88 89group("unittest") { 90 testonly = true 91 92 deps = [ ":BmsDataMgrTest" ] 93} 94