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