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 19module_output_path = "appexecfwk_standard/bundlemgrservice" 20 21ohos_unittest("BmsServiceStartupTest") { 22 module_out_path = module_output_path 23 include_dirs = [ "//third_party/jsoncpp/include" ] 24 sources = [ 25 "${services_path}/bundlemgr/src/bundle_data_mgr.cpp", 26 "${services_path}/bundlemgr/src/bundle_data_storage_database.cpp", 27 "${services_path}/bundlemgr/src/bundle_mgr_host_impl.cpp", 28 "${services_path}/bundlemgr/src/bundle_mgr_service.cpp", 29 "${services_path}/bundlemgr/src/bundle_mgr_service_event_handler.cpp", 30 "${services_path}/bundlemgr/src/bundle_scanner.cpp", 31 "${services_path}/bundlemgr/src/bundle_status_callback_death_recipient.cpp", 32 "${services_path}/bundlemgr/src/kvstore_death_recipient_callback.cpp", 33 "${services_path}/bundlemgr/src/module_usage_data_storage.cpp", 34 "${services_path}/bundlemgr/src/permission_changed_death_recipient.cpp", 35 ] 36 37 sources += 38 [ "${services_path}/bundlemgr/test/mock/src/system_ability_helper.cpp" ] 39 40 sources += bundle_install_sources 41 42 sources += [ "bms_service_startup_test.cpp" ] 43 44 configs = [ 45 "${services_path}/bundlemgr/test:bundlemgr_test_config", 46 "${libs_path}/libeventhandler:libeventhandler_config", 47 ] 48 cflags = [] 49 if (target_cpu == "arm") { 50 cflags += [ "-DBINDER_IPC_32BIT" ] 51 } 52 deps = [ 53 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", 54 "${libs_path}/libeventhandler:libeventhandler_target", 55 "//base/security/appverify/interfaces/innerkits/appverify:libhapverify", 56 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", 57 "//foundation/aafwk/standard/interfaces/innerkits/base:base", 58 "//foundation/aafwk/standard/interfaces/innerkits/want:want", 59 "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", 60 "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", 61 "//third_party/googletest:gtest_main", 62 "//third_party/jsoncpp:jsoncpp", 63 "//utils/native/base:utils", 64 ] 65 66 deps += bundle_install_deps 67 68 external_deps = [ 69 "ces_standard:cesfwk_innerkits", 70 "hiviewdfx_hilog_native:libhilog", 71 "ipc:ipc_core", 72 ] 73} 74 75group("unittest") { 76 testonly = true 77 78 deps = [ ":BmsServiceStartupTest" ] 79} 80