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 "googletest:gmock_main", 56 "googletest:gtest_main", 57 "updater:libupdaterlog", 58 ] 59 60 cflags_cc = [ "-fexceptions" ] 61 62 defines = [ 63 "UPDATER_UT", 64 "BUILD_OHOS", 65 "HDC_DEBUG", 66 "HARMONY_PROJECT", 67 ] 68 69 public_configs = [ ":utest_config" ] 70 install_enable = true 71 part_name = "sys_installer" 72} 73 74ohos_executable("sys_installer_client_test") { 75 sources = [ "${sys_installer_path}/interfaces/innerkits/ipc_client/src/sys_installer_client.cpp" ] 76 77 include_dirs = [ 78 "${sys_installer_path}/interfaces/innerkits/ipc_client/include", 79 "${sys_installer_path}/interfaces/inner_api/include", 80 ] 81 82 deps = [ 83 "${sys_installer_path}/interfaces/innerkits/ipc_client:libsysinstallerkits", 84 ] 85 86 external_deps = [ 87 "bounds_checking_function:libsec_static", 88 "c_utils:utils", 89 "init:libbegetutil", 90 "ipc:ipc_core", 91 "safwk:system_ability_fwk", 92 "samgr:samgr_proxy", 93 ] 94 install_enable = true 95 part_name = "sys_installer" 96 subsystem_name = "updater" 97} 98