1# Copyright (c) 2021-2024 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    "//third_party/bounds_checking_function/include",
29    "unittest/common",
30    "$hiview_adapter/service/client/include",
31    "$hiview_adapter/service/common/include",
32    "$hiview_adapter/service/server/include",
33    "$hiview_interfaces/inner_api/unified_collection",
34    "$hiview_service",
35  ]
36
37  cflags_cc = [ "-D__UNITTEST__" ]
38}
39
40ohos_unittest("HiviewSATest") {
41  module_out_path = module_output_path
42  configs = [ ":unittest_config" ]
43
44  sources = [ "unittest/common/hiview_sa_test.cpp" ]
45
46  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
47
48  deps = [
49    "$hiview_adapter/service/client:hiview_service_impl_for_js",
50    "$hiview_base:hiview_base",
51  ]
52
53  external_deps = [
54    "googletest:gtest_main",
55    "hilog:libhilog",
56    "ipc:ipc_single",
57    "safwk:system_ability_fwk",
58    "samgr:samgr_proxy",
59  ]
60}
61
62ohos_unittest("AdapterLoglibraryAbilityTest") {
63  module_out_path = module_output_path
64  configs = [ ":unittest_config" ]
65
66  sources = [
67    "unittest/common/adapter_loglibrary_ability_test.cpp",
68    "unittest/common/adapter_loglibrary_test_tools.cpp",
69  ]
70
71  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
72
73  deps = [
74    "$hiview_base:hiview_base",
75    "$hiview_core:hiview_core",
76    "$hiview_service:hiview_service",
77  ]
78
79  external_deps = [
80    "access_token:libaccesstoken_sdk",
81    "access_token:libnativetoken",
82    "access_token:libtoken_setproc",
83    "ffrt:libffrt",
84    "googletest:gtest_main",
85    "hilog:libhilog",
86    "ipc:ipc_single",
87    "safwk:system_ability_fwk",
88    "samgr:samgr_proxy",
89  ]
90}
91