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/interfaces", 29 "${sg_root_dir}/frameworks/common/json/include", 30 "${sg_root_dir}/frameworks/common/task_handler/include", 31 "${sg_root_dir}/frameworks/common/database/include", 32 "${sg_root_dir}/frameworks/common/log/include", 33 "${sg_root_dir}/frameworks/common/utils/include", 34 "${sg_root_dir}/test/unittest/mock/account_manager", 35 "${sg_root_dir}/test/unittest/mock/collector_manager", 36 "${sg_root_dir}/test/unittest/mock/config_manager", 37 "${sg_root_dir}/test/unittest/mock/data_collect", 38 "${sg_root_dir}/test/unittest/mock/database_manager", 39 "${sg_root_dir}/test/unittest/mock/device_manager", 40 "${sg_root_dir}/test/unittest/mock/preferences", 41 "${sg_root_dir}/test/unittest/mock/preferences_wrapper", 42 "${sg_root_dir}/test/unittest/mock/rdb", 43 ] 44 45 sources = [ 46 "${sg_root_dir}/frameworks/common/utils/src/security_guard_utils.cpp", 47 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_callback_proxy.cpp", 48 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_service.cpp", 49 "${sg_root_dir}/services/risk_classify/src/risk_analysis_manager_stub.cpp", 50 "${sg_root_dir}/services/risk_classify/src/risk_analysis_model.cpp", 51 "src/security_guard_risk_analysis_test.cpp", 52 ] 53 54 deps = [ 55 "${sg_root_dir}/frameworks/common/task_handler:sg_task_stamp", 56 "${sg_root_dir}/services/bigdata:sg_bigdata_stamp", 57 "${sg_root_dir}/services/config_manager:sg_config_manager", 58 "${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp", 59 ] 60 61 external_deps = [ 62 "ability_base:want", 63 "ability_runtime:ability_manager", 64 "ability_runtime:extension_manager", 65 "access_token:libaccesstoken_sdk", 66 "access_token:libtokenid_sdk", 67 "c_utils:utils", 68 "device_usage_statistics:usagestatsinner", 69 "googletest:gmock", 70 "hilog:libhilog", 71 "ipc:ipc_core", 72 "json:nlohmann_json_static", 73 "os_account:os_account_innerkits", 74 "relational_store:native_rdb", 75 "safwk:system_ability_fwk", 76 "samgr:samgr_proxy", 77 ] 78} 79 80group("unittest") { 81 testonly = true 82 deps = [ ":SecurityGuardRiskAnalysisTest" ] 83} 84