• 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("//build/test.gni")
15import("../../updateengine.gni")
16
17module_output_path = "updater/updateservice_test"
18config("utest_config") {
19  visibility = [ ":*" ]
20
21  cflags = [
22    "-fprofile-arcs",
23    "-ftest-coverage",
24    "-Wno-implicit-fallthrough",
25    "-Wno-unused-function",
26  ]
27  cflags_cc = [ "-Wno-implicit-fallthrough" ]
28
29  ldflags = [ "--coverage" ]
30}
31
32ohos_unittest("$updateengine_unittest_name") {
33  testonly = true
34  module_out_path = module_output_path
35  sources = [
36    "update_client/client_stub.cpp",
37    "update_client/client_unittest.cpp",
38    "update_engine/server_unittest.cpp",
39    "update_server_ut_entry.cpp",
40  ]
41
42  sources += [
43    "$updateengine_root_path/frameworks/js/napi/client/update_client.cpp",
44    "$updateengine_root_path/frameworks/js/napi/client/update_module.cpp",
45    "$updateengine_root_path/frameworks/js/napi/client/update_session.cpp",
46    "$updateengine_root_path/interfaces/inner_api/engine/update_service_kits_impl.cpp",
47    "$updateengine_root_path/interfaces/inner_api/engine/update_service_proxy.cpp",
48    "$updateengine_root_path/services/callback/src/update_callback.cpp",
49    "$updateengine_root_path/services/callback/src/update_callback_proxy.cpp",
50    "$updateengine_root_path/services/callback/src/update_callback_stub.cpp",
51    "$updateengine_root_path/services/engine/src/progress_thread.cpp",
52    "$updateengine_root_path/services/engine/src/update_helper.cpp",
53    "$updateengine_root_path/services/engine/src/update_service.cpp",
54    "$updateengine_root_path/services/engine/src/update_service_stub.cpp",
55    "//base/update/updater/interfaces/kits/packages/package.cpp",
56    "//base/update/updater/interfaces/kits/updaterkits/updaterkits.cpp",
57  ]
58  include_dirs = [
59    "//base/update/updater/interfaces/kits/include/",
60    "//base/update/updater/interfaces/kits/include/package",
61    "$updateengine_root_path",
62    "$updateengine_root_path/interfaces/inner_api/include",
63    "$updateengine_root_path/frameworks/js/napi/client/",
64    "$updateengine_root_path/services/engine/include",
65    "$updateengine_root_path/services/callback/include",
66    "//base/update/updater/utils/include/",
67    "//base/update/updater/services/include/",
68    "//base/update/updater/services/include/log",
69    "//base/update/updater/services/include/package",
70    "//base/update/updater/test/unittest",
71    "//third_party/bounds_checking_function/include",
72    "//third_party/googletest/googletest/include",
73    "//third_party/node/src",
74    "//foundation/arkui/napi/interfaces/kits",
75    "//third_party/cJSON",
76    "//third_party/libxml2/include",
77    "//third_party/curl/include",
78    "//third_party/openssl/include",
79    "//foundation/communication/ipc/interfaces/innerkits/ipc_core/include",
80    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
81    "//foundation/systemabilitymgr/safwk/services/safwk/include",
82    "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
83    "//foundation/systemabilitymgr/samgr/adapter/interfaces/innerkits/include",
84    "//foundation/systemabilitymgr/samgr/interfaces/innerkits/samgr_proxy/include",
85  ]
86
87  deps = [
88    "//base/update/updater/interfaces/kits/misc_info:libmiscinfo",
89    "//base/update/updater/interfaces/kits/packages:libpackageExt",
90    "//base/update/updater/interfaces/kits/updaterkits:libupdaterkits",
91    "//base/update/updater/services/log:libupdaterlog",
92    "//base/update/updater/services/package:libupdaterpackage",
93    "//base/update/updater/utils:libutils",
94    "//third_party/bounds_checking_function:libsec_static",
95    "//third_party/cJSON:cjson_static",
96    "//third_party/curl:curl",
97    "//third_party/googletest:gmock_main",
98    "//third_party/googletest:gtest_main",
99    "//third_party/libxml2:xml2",
100    "//third_party/lz4:liblz4_static",
101    "//third_party/openssl:libcrypto_shared",
102    "//third_party/openssl:libssl_shared",
103  ]
104
105  defines = [
106    "UPDATER_UT",
107    "UPDATER_API_TEST",
108  ]
109
110  external_deps = [
111    "c_utils:utils",
112    "hiviewdfx_hilog_native:libhilog",
113    "init:libbegetutil",
114    "ipc:ipc_core",
115    "samgr:samgr_proxy",
116  ]
117
118  cflags_cc = [ "-fexceptions" ]
119
120  public_configs = [ ":utest_config" ]
121  install_enable = true
122  part_name = "$updateengine_part_name"
123}
124