• 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.
13
14import("//base/hiviewdfx/hiview/hiview.gni")
15import("//build/test.gni")
16
17module_output_path = "hiview/hiview"
18
19group("unittest") {
20  testonly = true
21  deps = [
22    ":EventCheckerUnitTest",
23    ":SysEventServiceOhosUnitTest",
24  ]
25}
26
27config("unittest_config") {
28  include_dirs = [
29    "unittest/common",
30    "$hiview_adapter/utility/include",
31    "$hiview_plugin/sysevent_source/include",
32    "$hiview_core/include",
33    "$hiview_base/include",
34  ]
35
36  cflags_cc = [ "-D__UNITTEST__" ]
37}
38
39ohos_unittest("SysEventServiceOhosUnitTest") {
40  module_out_path = module_output_path
41  configs = [ ":unittest_config" ]
42
43  sources = [
44    "unittest/common/data_share_test.cpp",
45    "unittest/common/event_query_wrapper_builder_test.cpp",
46    "unittest/common/sys_event_service_ohos_test.cpp",
47  ]
48
49  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
50
51  deps = [
52    "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter",
53    "$hiview_adapter/plugins/eventservice/service/idl:sys_event_service_ohos",
54    "$hiview_base:hiview_base",
55    "$hiview_core:hiview_core",
56    "$hiview_plugin/sys_dispatcher:sys_dispatcher",
57  ]
58
59  external_deps = [
60    "ffrt:libffrt",
61    "googletest:gtest_main",
62    "hilog:libhilog",
63    "init:libbeget_proxy",
64    "init:libbegetutil",
65    "ipc:ipc_single",
66    "jsoncpp:jsoncpp",
67    "relational_store:native_rdb",
68    "safwk:system_ability_fwk",
69    "samgr:samgr_proxy",
70  ]
71}
72
73ohos_unittest("EventCheckerUnitTest") {
74  module_out_path = module_output_path
75  configs = [ ":unittest_config" ]
76
77  sources = [ "unittest/common/event_checker_test.cpp" ]
78
79  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
80
81  deps = [
82    "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter",
83    "$hiview_base:hiview_base",
84    "$hiview_core:hiview_core",
85  ]
86
87  external_deps = [
88    "googletest:gtest_main",
89    "hilog:libhilog",
90    "init:libbeget_proxy",
91    "init:libbegetutil",
92    "ipc:ipc_single",
93    "jsoncpp:jsoncpp",
94    "relational_store:native_rdb",
95    "safwk:system_ability_fwk",
96    "samgr:samgr_proxy",
97  ]
98}
99