• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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("//base/security/security_guard/security_guard.gni")
15import("//build/test.gni")
16
17ohos_unittest("SecurityGuardRiskAnalysisTest") {
18  install_enable = true
19  part_name = "security_guard"
20  subsystem_name = "security"
21  module_out_path = part_name + "/" + part_name
22
23  #resource_config_file = "resource/ohos_test.xml"
24
25  include_dirs = [
26    "include",
27    "${sg_root_dir}/frameworks/common/constants/include",
28    "${sg_root_dir}/frameworks/common/json/include",
29    "${sg_root_dir}/frameworks/common/task_handler/include",
30    "${sg_root_dir}/frameworks/common/database/include",
31    "${sg_root_dir}/frameworks/common/log/include",
32    "${sg_root_dir}/frameworks/common/utils/include",
33    "${sg_root_dir}/test/unittest/mock/account_manager",
34    "${sg_root_dir}/test/unittest/mock/collector_manager",
35    "${sg_root_dir}/test/unittest/mock/config_manager",
36    "${sg_root_dir}/test/unittest/mock/data_collect",
37    "${sg_root_dir}/test/unittest/mock/database_manager",
38    "${sg_root_dir}/test/unittest/mock/device_manager",
39    "${sg_root_dir}/test/unittest/mock/preferences",
40    "${sg_root_dir}/test/unittest/mock/preferences_wrapper",
41    "${sg_root_dir}/test/unittest/mock/accesstoken",
42    "${sg_root_dir}/test/unittest/mock/rdb",
43    "${sg_root_dir}/interfaces/inner_api/common/include",
44    "${sg_root_dir}/frameworks/common/classify/include",
45  ]
46
47  sources = [
48    "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp",
49    "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_callback_proxy.cpp",
50    "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_service.cpp",
51    "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_stub.cpp",
52    "src/security_guard_risk_analysis_test.cpp",
53  ]
54
55  deps = [
56    "${sg_root_dir}/frameworks/common/classify:libsg_classify_sdk",
57    "${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
58    "${sg_root_dir}/services/config_manager:sg_config_manager",
59    "${sg_root_dir}/services/data_collect:sg_collect_service",
60    "${sg_root_dir}/services/data_collect:sg_collect_service_database",
61    "${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp",
62  ]
63
64  external_deps = [
65    "ability_base:want",
66    "ability_runtime:ability_manager",
67    "ability_runtime:extension_manager",
68    "access_token:libaccesstoken_sdk",
69    "access_token:libtokenid_sdk",
70    "c_utils:utils",
71    "ffrt:libffrt",
72    "googletest:gmock",
73    "hilog:libhilog",
74    "ipc:ipc_core",
75    "json:nlohmann_json_static",
76    "os_account:os_account_innerkits",
77    "relational_store:native_rdb",
78    "safwk:system_ability_fwk",
79    "samgr:samgr_proxy",
80  ]
81}
82
83group("unittest") {
84  testonly = true
85  deps = [ ":SecurityGuardRiskAnalysisTest" ]
86}
87