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/base/event_export" 18 19group("unittest") { 20 testonly = true 21 deps = [ 22 ":EventExportConfigTest", 23 ":EventExportDbMgrTest", 24 ":EventExportMgrTest", 25 ] 26} 27 28config("event_export_config_test_config") { 29 visibility = [ ":*" ] 30 31 include_dirs = [ "unittest/common" ] 32 33 cflags = [] 34} 35 36ohos_unittest("EventExportConfigTest") { 37 module_out_path = module_output_path 38 39 configs = [ ":event_export_config_test_config" ] 40 41 sources = [ "unittest/common/event_export_config_test.cpp" ] 42 43 deps = [ 44 "$hiview_base:hiviewbase_static_lib_for_tdd", 45 "../../event_export:event_export_engine", 46 ] 47 48 external_deps = [ 49 "cJSON:cjson", 50 "googletest:gmock", 51 "googletest:gtest_main", 52 "hilog:libhilog", 53 ] 54 55 resource_config_file = "resource/ohos_test.xml" 56} 57 58config("event_db_mgr_test_config") { 59 visibility = [ ":*" ] 60 61 include_dirs = [ "unittest/common" ] 62 63 cflags = [] 64} 65 66ohos_unittest("EventExportDbMgrTest") { 67 module_out_path = module_output_path 68 69 configs = [ ":event_db_mgr_test_config" ] 70 71 sources = [ "unittest/common/event_export_db_mgr_test.cpp" ] 72 73 deps = [ 74 "$hiview_base:hiviewbase_static_lib_for_tdd", 75 "../../event_export:event_export_engine", 76 ] 77 78 external_deps = [ 79 "googletest:gmock", 80 "googletest:gtest_main", 81 "hilog:libhilog", 82 "relational_store:native_rdb", 83 ] 84} 85 86config("event_export_mgr_test_config") { 87 visibility = [ ":*" ] 88 89 include_dirs = [ "unittest/common" ] 90 91 cflags = [] 92} 93 94ohos_unittest("EventExportMgrTest") { 95 module_out_path = module_output_path 96 97 configs = [ ":event_export_mgr_test_config" ] 98 99 sources = [ "unittest/common/event_export_mgr_test.cpp" ] 100 101 deps = [ 102 "$hiview_base:hiviewbase", 103 "../../event_export:event_export_engine", 104 ] 105 106 external_deps = [ 107 "ability_base:zuri", 108 "ability_runtime:ability_manager", 109 "ability_runtime:dataobs_manager", 110 "cJSON:cjson", 111 "data_share:datashare_common", 112 "data_share:datashare_consumer", 113 "googletest:gmock", 114 "googletest:gtest_main", 115 "hilog:libhilog", 116 "ipc:ipc_core", 117 "relational_store:native_rdb", 118 ] 119} 120