• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2025 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.
13import("//base/hiviewdfx/hiview/hiview.gni")
14import("//build/test.gni")
15
16module_output_path = "hiview/hiview"
17
18group("unittest") {
19  testonly = true
20  deps = [
21    ":AdapterLoglibraryAbilityTest",
22    ":HiviewSATest",
23  ]
24}
25
26config("unittest_config") {
27  include_dirs = [
28    "unittest/common",
29    "$hiview_adapter/service/client/include",
30    "$hiview_adapter/service/common/include",
31    "$hiview_adapter/service/server/include",
32    "$hiview_interfaces/inner_api/unified_collection",
33    "$hiview_service",
34  ]
35
36  cflags_cc = [ "-D__UNITTEST__" ]
37}
38
39ohos_unittest("HiviewSATest") {
40  module_out_path = module_output_path
41  configs = [ ":unittest_config" ]
42
43  sources = [ "unittest/common/hiview_sa_test.cpp" ]
44
45  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
46
47  deps = [
48    "$hiview_adapter/service/client:hiview_service_proxy",
49    "$hiview_base:hiview_base",
50  ]
51
52  external_deps = [
53    "googletest:gtest_main",
54    "hilog:libhilog",
55    "ipc:ipc_single",
56    "safwk:system_ability_fwk",
57    "samgr:samgr_proxy",
58  ]
59}
60
61ohos_unittest("AdapterLoglibraryAbilityTest") {
62  module_out_path = module_output_path
63  configs = [
64    ":unittest_config",
65    "$hiview_adapter/service/client:hiview_service_stub_inner_public_config",
66  ]
67
68  sources = [
69    "unittest/common/adapter_loglibrary_ability_test.cpp",
70    "unittest/common/adapter_loglibrary_test_tools.cpp",
71  ]
72
73  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
74
75  deps = [
76    "$hiview_base:hiview_base",
77    "$hiview_core:hiview_core",
78    "$hiview_service:hiview_service",
79  ]
80
81  external_deps = [
82    "access_token:libaccesstoken_sdk",
83    "access_token:libnativetoken",
84    "access_token:libtoken_setproc",
85    "ffrt:libffrt",
86    "googletest:gtest_main",
87    "hilog:libhilog",
88    "ipc:ipc_single",
89    "safwk:system_ability_fwk",
90    "samgr:samgr_proxy",
91  ]
92}
93