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("SecurityGuardModelManagerTest") { 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}/services/data_collect/store/include", 28 "${sg_root_dir}/frameworks/common/constants/include", 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}/services/risk_classify/model_manager", 35 "${sg_root_dir}/test/unittest/mock/config_manager", 36 "${sg_root_dir}/interfaces/inner_api/common/include", 37 ] 38 39 sources = [ 40 "${sg_root_dir}/services/risk_classify/model_manager/src/config_operate.cpp", 41 "${sg_root_dir}/services/risk_classify/model_manager/src/db_operate.cpp", 42 "${sg_root_dir}/services/risk_classify/model_manager/src/model_manager.cpp", 43 "${sg_root_dir}/services/risk_classify/model_manager/src/model_manager_impl.cpp", 44 "src/security_guard_model_manager_test.cpp", 45 ] 46 47 deps = [ 48 "${sg_root_dir}/services/config_manager:sg_config_manager", 49 "${sg_root_dir}/services/data_collect:sg_collect_service", 50 ] 51 52 external_deps = [ 53 "c_utils:utils", 54 "googletest:gmock", 55 "hilog:libhilog", 56 "ipc:ipc_core", 57 "json:nlohmann_json_static", 58 "relational_store:native_rdb", 59 "safwk:system_ability_fwk", 60 "samgr:samgr_proxy", 61 ] 62} 63 64group("unittest") { 65 testonly = true 66 deps = [ ":SecurityGuardModelManagerTest" ] 67} 68