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  ]
50}
51
52ohos_unittest("EventServerTest") {
53  module_out_path = module_output_path
54  configs = [ ":unittest_config" ]
55
56  sources = [ "event_server_test.cpp" ]
57
58  deps = [
59    "$hiview_base:hiviewbase_static_lib_for_tdd",
60    "$hiview_base/utility:hiview_utility",
61    "$hiview_core:hiview_core",
62    "$hiview_plugin/sysevent_source:sysevent_source",
63  ]
64
65  external_deps = [
66    "ffrt:libffrt",
67    "googletest:gtest_main",
68    "hilog:libhilog",
69  ]
70}
71
72ohos_unittest("DailyControllerTest") {
73  module_out_path = module_output_path
74  configs = [ ":unittest_config" ]
75
76  sources = [ "daily_controller_test.cpp" ]
77
78  deps = [
79    "$hiview_base:hiviewbase_static_lib_for_tdd",
80    "$hiview_base/utility:hiview_utility",
81    "$hiview_core:hiview_core",
82    "$hiview_plugin/sysevent_source:sysevent_source",
83  ]
84
85  external_deps = [
86    "cJSON:cjson",
87    "ffrt:libffrt",
88    "googletest:gtest_main",
89    "hilog:libhilog",
90    "relational_store:native_rdb",
91  ]
92
93  resource_config_file =
94      "$hiview_plugin/sysevent_source/test/resource/ohos_test.xml"
95}
96
97ohos_unittest("EventJsonParserTest") {
98  module_out_path = module_output_path
99  configs = [ ":unittest_config" ]
100
101  sources = [ "event_json_parser_test.cpp" ]
102
103  deps = [
104    "$hiview_base:hiviewbase_static_lib_for_tdd",
105    "$hiview_plugin/sysevent_source:sysevent_source",
106  ]
107
108  external_deps = [
109    "ffrt:libffrt",
110    "googletest:gtest_main",
111    "hilog:libhilog",
112  ]
113
114  resource_config_file =
115      "$hiview_plugin/sysevent_source/test/resource/ohos_test.xml"
116}
117