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/sysevent_source"
17
18config("unittest_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    ".",
23    "$hiview_plugin/sysevent_source/control/config/include",
24    "$hiview_plugin/sysevent_source/control/db/include",
25    "$hiview_plugin/sysevent_source/control/include",
26    "$hiview_plugin/sysevent_source/include",
27  ]
28
29  cflags = [ "-D__UNITTEST__" ]
30}
31
32ohos_unittest("SysEventStatTest") {
33  module_out_path = module_output_path
34
35  configs = [ ":unittest_config" ]
36
37  sources = [ "sys_event_stat_test.cpp" ]
38
39  deps = [
40    "$hiview_base:hiviewbase_static_lib_for_tdd",
41    "$hiview_core:hiview_core",
42    "$hiview_plugin/sysevent_source:sysevent_source",
43  ]
44
45  external_deps = [
46    "ffrt:libffrt",
47    "googletest:gtest_main",
48    "hilog:libhilog",
49    "jsoncpp:jsoncpp",
50  ]
51}
52
53ohos_unittest("EventServerTest") {
54  module_out_path = module_output_path
55  configs = [ ":unittest_config" ]
56
57  sources = [ "event_server_test.cpp" ]
58
59  deps = [
60    "$hiview_base:hiviewbase_static_lib_for_tdd",
61    "$hiview_base/utility:hiview_utility",
62    "$hiview_core:hiview_core",
63    "$hiview_plugin/sysevent_source:sysevent_source",
64  ]
65
66  external_deps = [
67    "ffrt:libffrt",
68    "googletest:gtest_main",
69    "hilog:libhilog",
70    "jsoncpp:jsoncpp",
71  ]
72}
73
74ohos_unittest("DailyControllerTest") {
75  module_out_path = module_output_path
76  configs = [ ":unittest_config" ]
77
78  sources = [ "daily_controller_test.cpp" ]
79
80  deps = [
81    "$hiview_base:hiviewbase_static_lib_for_tdd",
82    "$hiview_base/utility:hiview_utility",
83    "$hiview_core:hiview_core",
84    "$hiview_plugin/sysevent_source:sysevent_source",
85  ]
86
87  external_deps = [
88    "cJSON:cjson",
89    "ffrt:libffrt",
90    "googletest:gtest_main",
91    "hilog:libhilog",
92    "relational_store:native_rdb",
93  ]
94
95  resource_config_file =
96      "$hiview_plugin/sysevent_source/test/resource/ohos_test.xml"
97}
98
99ohos_unittest("EventJsonParserTest") {
100  module_out_path = module_output_path
101  configs = [ ":unittest_config" ]
102
103  sources = [ "event_json_parser_test.cpp" ]
104
105  deps = [
106    "$hiview_base:hiviewbase_static_lib_for_tdd",
107    "$hiview_plugin/sysevent_source:sysevent_source",
108  ]
109
110  external_deps = [
111    "ffrt:libffrt",
112    "googletest:gtest_main",
113    "hilog:libhilog",
114    "jsoncpp:jsoncpp",
115  ]
116
117  resource_config_file =
118      "$hiview_plugin/sysevent_source/test/resource/ohos_test.xml"
119}
120