1# Copyright (c) 2021-2022 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 = "bundle_framework/mstbundlemgrservice" 20 21ohos_moduletest("BmsBundleUninstallerModuleTest") { 22 use_exceptions = true 23 module_out_path = module_output_path 24 25 configs = [ 26 "${services_path}/test/moduletest/common/bms:bms_module_test_config", 27 "${libs_path}/libeventhandler:libeventhandler_config", 28 "${services_path}/bundlemgr:bundlemgr_common_config", 29 "${common_path}:appexecfwk_common_config", 30 ] 31 32 include_dirs = [ 33 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", 34 "//third_party/json/include", 35 "${services_path}/test/mock/include", 36 "//third_party/jsoncpp/include", 37 ] 38 39 sources = [ 40 "${services_path}/bundlemgr/src/bms_device_manager.cpp", 41 "${services_path}/bundlemgr/src/bundle_clone_mgr.cpp", 42 "${services_path}/bundlemgr/src/bundle_data_mgr.cpp", 43 "${services_path}/bundlemgr/src/bundle_data_storage_database.cpp", 44 "${services_path}/bundlemgr/src/bundle_event_callback_death_recipient.cpp", 45 "${services_path}/bundlemgr/src/bundle_mgr_host_impl.cpp", 46 "${services_path}/bundlemgr/src/bundle_mgr_service.cpp", 47 "${services_path}/bundlemgr/src/bundle_mgr_service_event_handler.cpp", 48 "${services_path}/bundlemgr/src/bundle_scanner.cpp", 49 "${services_path}/bundlemgr/src/bundle_status_callback_death_recipient.cpp", 50 "${services_path}/bundlemgr/src/bundle_user_mgr_host_impl.cpp", 51 "${services_path}/bundlemgr/src/installd/installd_host_impl.cpp", 52 "${services_path}/bundlemgr/src/installd/installd_operator.cpp", 53 "${services_path}/bundlemgr/src/installd/installd_service.cpp", 54 "${services_path}/bundlemgr/src/kvstore_death_recipient_callback.cpp", 55 "${services_path}/bundlemgr/src/module_usage_data_storage.cpp", 56 "${services_path}/bundlemgr/src/permission_changed_death_recipient.cpp", 57 "${services_path}/bundlemgr/src/preinstall_data_storage.cpp", 58 ] 59 60 sources += bundle_install_sources 61 62 sources += [ 63 "${services_path}/bundlemgr/test/mock/src/system_ability_helper.cpp", 64 "${services_path}/test/mock/src/mock_status_receiver.cpp", 65 ] 66 67 sources += [ "bms_bundle_uninstaller_module_test.cpp" ] 68 cflags = [] 69 if (target_cpu == "arm") { 70 cflags += [ "-DBINDER_IPC_32BIT" ] 71 } 72 deps = [ 73 "${aafwk_path}/interfaces/innerkits/app_manager:app_manager", 74 "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", 75 "${libs_path}/libeventhandler:libeventhandler_target", 76 "${services_path}/bundlemgr:bundle_parser", 77 "${services_path}/bundlemgr:parser_common", 78 "${services_path}/test/moduletest/utils:tool_common", 79 "//base/security/appverify/interfaces/innerkits/appverify:libhapverify", 80 "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", 81 "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara", 82 "//foundation/aafwk/standard/interfaces/innerkits/base:base", 83 "//foundation/aafwk/standard/interfaces/innerkits/want:want", 84 "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", 85 "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", 86 "//third_party/googletest:gtest_main", 87 "//third_party/jsoncpp:jsoncpp", 88 ] 89 90 external_deps = [ 91 "ability_runtime:app_manager", 92 "access_token:libaccesstoken_sdk", 93 "bytrace_standard:bytrace_core", 94 "ces_standard:cesfwk_innerkits", 95 "device_manager_base:devicemanagersdk", 96 "hicollie_native:libhicollie", 97 "hiviewdfx_hilog_native:libhilog", 98 "init:libbegetutil", 99 "ipc:ipc_core", 100 "os_account_standard:os_account_innerkits", 101 "resmgr_standard:global_resmgr", 102 ] 103 if (build_selinux) { 104 external_deps += [ "selinux:libhap_restorecon" ] 105 cflags += [ "-DWITH_SELINUX" ] 106 } 107 resource_config_file = "//foundation/appexecfwk/standard/test/resource/mstbundlemgrservice/ohos_test.xml" 108} 109 110group("moduletest") { 111 testonly = true 112 113 deps = [ ":BmsBundleUninstallerModuleTest" ] 114} 115