• 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_module + "/sys_event_service_adapter"
18
19group("unittest") {
20  testonly = true
21  deps = [
22    ":EventCheckerUnitTest",
23    ":EventServiceAdapterUtilsTest",
24    ":SysEventServiceOhosUnitTest",
25  ]
26}
27
28config("unittest_config") {
29  include_dirs = [
30    "unittest/common",
31    "$hiview_adapter/utility/include",
32    "$hiview_plugin/sysevent_source/include",
33    "$hiview_core/include",
34    "$hiview_base/include",
35  ]
36
37  cflags_cc = [ "-D__UNITTEST__" ]
38}
39
40ohos_unittest("SysEventServiceOhosUnitTest") {
41  module_out_path = module_output_path
42  configs = [ ":unittest_config" ]
43
44  sources = [
45    "unittest/common/data_share_test.cpp",
46    "unittest/common/event_query_wrapper_builder_test.cpp",
47    "unittest/common/sys_event_service_ohos_test.cpp",
48  ]
49
50  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
51
52  deps = [
53    "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter",
54    "$hiview_adapter/plugins/eventservice/service/idl:sys_event_service_ohos",
55    "$hiview_base:hiview_base",
56    "$hiview_core:hiview_core",
57    "$hiview_plugin/sys_dispatcher:sys_dispatcher",
58  ]
59
60  external_deps = [
61    "ffrt:libffrt",
62    "googletest:gtest_main",
63    "hilog:libhilog",
64    "init:libbeget_proxy",
65    "init:libbegetutil",
66    "ipc:ipc_single",
67    "jsoncpp:jsoncpp",
68    "relational_store:native_rdb",
69    "safwk:system_ability_fwk",
70    "samgr:samgr_proxy",
71  ]
72}
73
74ohos_unittest("EventCheckerUnitTest") {
75  module_out_path = module_output_path
76  configs = [ ":unittest_config" ]
77
78  sources = [ "unittest/common/event_checker_test.cpp" ]
79
80  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
81
82  deps = [
83    "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter",
84    "$hiview_adapter/plugins/eventservice/service/idl:sys_event_service_ohos",
85    "$hiview_base:hiview_base",
86    "$hiview_core:hiview_core",
87  ]
88
89  external_deps = [
90    "googletest:gtest_main",
91    "hilog:libhilog",
92    "init:libbeget_proxy",
93    "init:libbegetutil",
94    "ipc:ipc_single",
95    "jsoncpp:jsoncpp",
96    "relational_store:native_rdb",
97    "safwk:system_ability_fwk",
98    "samgr:samgr_proxy",
99  ]
100}
101
102ohos_unittest("EventServiceAdapterUtilsTest") {
103  module_out_path = module_output_path
104  configs = [ ":unittest_config" ]
105
106  sources = [ "unittest/common/event_service_adapter_utils_test.cpp" ]
107
108  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
109
110  deps = [
111    "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter",
112    "$hiview_adapter/plugins/eventservice/service/idl:sys_event_service_ohos",
113    "$hiview_base:hiview_base",
114    "$hiview_core:hiview_core",
115  ]
116
117  external_deps = [
118    "googletest:gtest_main",
119    "hilog:libhilog",
120    "init:libbeget_proxy",
121    "init:libbegetutil",
122    "ipc:ipc_single",
123    "jsoncpp:jsoncpp",
124    "relational_store:native_rdb",
125    "safwk:system_ability_fwk",
126    "samgr:samgr_proxy",
127  ]
128}
129