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. 13 14import("//base/update/sys_installer/sys_installer_default_cfg.gni") 15import("//build/test.gni") 16 17sys_installer_path = rebase_path("${sys_installer_absolutely_path}", ".") 18module_output_path = "sys_installer/sys_installer" 19 20config("utest_config") { 21 visibility = [ ":*" ] 22 23 cflags = [ 24 "-fprofile-arcs", 25 "-Wno-implicit-fallthrough", 26 "-Wno-unused-function", 27 ] 28 cflags_cc = [ "-Wno-implicit-fallthrough" ] 29 30 ldflags = [ "--coverage" ] 31} 32 33ohos_unittest("sys_installer_unittest") { 34 testonly = true 35 module_out_path = module_output_path 36 sources = [ 37 "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_kits_impl.cpp", 38 "sys_installer_ipc_test.cpp", 39 ] 40 41 include_dirs = [ 42 "${sys_installer_path}/interfaces/inner_api/include", 43 "${sys_installer_path}/interfaces/innerkits/ipc_client/include", 44 "${sys_installer_path}/test/unitest", 45 ] 46 deps = [ 47 "${sys_installer_path}/interfaces/innerkits/ipc_client:libsysinstallerkits", 48 ] 49 50 deps += [ 51 "${sys_installer_path}/test/unittest/ipc_test:sys_installer_client_test", 52 ] 53 external_deps = [ 54 "bounds_checking_function:libsec_static", 55 "c_utils:utils", 56 "googletest:gmock_main", 57 "googletest:gtest_main", 58 "hilog:libhilog", 59 "samgr:samgr_proxy", 60 "updater:libupdaterlog", 61 ] 62 63 cflags_cc = [ "-fexceptions" ] 64 65 defines = [ 66 "UPDATER_UT", 67 "BUILD_OHOS", 68 "HDC_DEBUG", 69 "HARMONY_PROJECT", 70 ] 71 72 public_configs = [ ":utest_config" ] 73 install_enable = true 74 part_name = "sys_installer" 75} 76 77ohos_executable("sys_installer_client_test") { 78 sources = [ "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_client.cpp" ] 79 80 include_dirs = [ 81 "${sys_installer_path}/interfaces/innerkits/ipc_client/include", 82 "${sys_installer_path}/interfaces/inner_api/include", 83 ] 84 85 deps = [ 86 "${sys_installer_path}/interfaces/innerkits/ipc_client:libsysinstallerkits", 87 ] 88 89 external_deps = [ 90 "bounds_checking_function:libsec_static", 91 "c_utils:utils", 92 "hilog:libhilog", 93 "init:libbegetutil", 94 "ipc:ipc_core", 95 "safwk:system_ability_fwk", 96 "samgr:samgr_proxy", 97 ] 98 install_enable = true 99 part_name = "sys_installer" 100 subsystem_name = "updater" 101} 102