• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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 = [ ":SysEventServiceOhosUnitTest" ]
22}
23
24config("unittest_config") {
25  include_dirs = [
26    "//third_party/jsoncpp/include",
27    "//third_party/bounds_checking_function/include",
28    "unittest/common",
29    "$hiview_plugin/eventservice/include",
30    "$hiview_base/include",
31  ]
32
33  cflags_cc = [ "-D__UNITTEST__" ]
34}
35
36ohos_unittest("SysEventServiceOhosUnitTest") {
37  module_out_path = module_output_path
38  configs = [ ":unittest_config" ]
39
40  sources = [
41    "$hiview_plugin/eventservice/event_json_parser.cpp",
42    "$hiview_plugin/eventservice/flat_json_parser.cpp",
43    "$hiview_plugin/eventservice/service/sys_event_stat.cpp",
44    "$hiview_plugin/eventservice/store/sys_event_db_backup.cpp",
45    "$hiview_plugin/eventservice/store/sys_event_db_cleaner.cpp",
46    "$hiview_plugin/eventservice/store/sys_event_db_mgr.cpp",
47    "$hiview_plugin/eventservice/sys_event_service.cpp",
48    "unittest/common/sys_event_callback_ohos_test.cpp",
49    "unittest/common/sys_event_service_ohos_test.cpp",
50  ]
51
52  cflags_cc = [ "-DTEST_LOCAL_SRC" ]
53
54  deps = [
55    "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter",
56    "$hiview_adapter/plugins/eventservice/service/idl:sys_event_service_ohos",
57    "$hiview_base:hiview_base",
58    "$hiview_core:hiview_core",
59    "//third_party/googletest:gtest_main",
60    "//third_party/jsoncpp:jsoncpp",
61  ]
62
63  external_deps = [
64    "init:libbeget_proxy",
65    "init:libbegetutil",
66    "ipc:ipc_core",
67    "safwk:system_ability_fwk",
68    "samgr:samgr_proxy",
69  ]
70}
71