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