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. 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 "//third_party/bounds_checking_function/include", 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_base:hiview_base", 55 "$hiview_core:hiview_core", 56 "$hiview_plugin/sys_dispatcher:sys_dispatcher", 57 ] 58 59 external_deps = [ 60 "googletest:gtest_main", 61 "hilog:libhilog", 62 "init:libbeget_proxy", 63 "init:libbegetutil", 64 "ipc:ipc_single", 65 "jsoncpp:jsoncpp", 66 "relational_store:native_rdb", 67 "safwk:system_ability_fwk", 68 "samgr:samgr_proxy", 69 ] 70} 71 72ohos_unittest("EventCheckerUnitTest") { 73 module_out_path = module_output_path 74 configs = [ ":unittest_config" ] 75 76 sources = [ "unittest/common/event_checker_test.cpp" ] 77 78 cflags_cc = [ "-DTEST_LOCAL_SRC" ] 79 80 deps = [ 81 "$hiview_adapter/plugins/eventservice/service:sys_event_service_adapter", 82 "$hiview_base:hiview_base", 83 "$hiview_core:hiview_core", 84 ] 85 86 external_deps = [ 87 "googletest:gtest_main", 88 "hilog:libhilog", 89 "init:libbeget_proxy", 90 "init:libbegetutil", 91 "ipc:ipc_single", 92 "jsoncpp:jsoncpp", 93 "relational_store:native_rdb", 94 "safwk:system_ability_fwk", 95 "samgr:samgr_proxy", 96 ] 97} 98