1# Copyright (c) 2021-2025 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_module + "/event_export" 18 19group("unittest") { 20 testonly = true 21 deps = [ 22 ":EventExportConfigTest", 23 ":EventExportDbMgrTest", 24 ":EventExportMgrTest", 25 ":EventExportWriteTest", 26 ] 27} 28 29config("event_export_config_test_config") { 30 visibility = [ ":*" ] 31 32 include_dirs = [ "unittest/common" ] 33 34 cflags = [] 35} 36 37ohos_unittest("EventExportConfigTest") { 38 module_out_path = module_output_path 39 40 configs = [ ":event_export_config_test_config" ] 41 42 sources = [ "unittest/common/event_export_config_test.cpp" ] 43 44 deps = [ 45 "$hiview_base:hiviewbase_static_lib_for_tdd", 46 "../../event_export:event_export_engine", 47 ] 48 49 external_deps = [ 50 "cJSON:cjson", 51 "c_utils:utils", 52 "ffrt:libffrt", 53 "googletest:gmock", 54 "googletest:gtest_main", 55 "hilog:libhilog", 56 "jsoncpp:jsoncpp", 57 ] 58 59 resource_config_file = "resource/ohos_test.xml" 60} 61 62config("event_db_mgr_test_config") { 63 visibility = [ ":*" ] 64 65 include_dirs = [ "unittest/common" ] 66 67 cflags = [] 68} 69 70ohos_unittest("EventExportDbMgrTest") { 71 module_out_path = module_output_path 72 73 configs = [ ":event_db_mgr_test_config" ] 74 75 sources = [ "unittest/common/event_export_db_mgr_test.cpp" ] 76 77 deps = [ 78 "$hiview_base:hiviewbase_static_lib_for_tdd", 79 "../../event_export:event_export_engine", 80 ] 81 82 external_deps = [ 83 "c_utils:utils", 84 "ffrt:libffrt", 85 "googletest:gmock", 86 "googletest:gtest_main", 87 "hilog:libhilog", 88 "relational_store:native_rdb", 89 ] 90} 91 92config("event_export_mgr_test_config") { 93 visibility = [ ":*" ] 94 95 include_dirs = [ "unittest/common" ] 96 97 cflags = [] 98} 99 100ohos_unittest("EventExportMgrTest") { 101 module_out_path = module_output_path 102 103 configs = [ ":event_export_mgr_test_config" ] 104 105 sources = [ "unittest/common/event_export_mgr_test.cpp" ] 106 107 deps = [ 108 "$hiview_base:hiviewbase", 109 "../../event_export:event_export_engine", 110 ] 111 112 external_deps = [ 113 "ability_base:zuri", 114 "cJSON:cjson", 115 "data_share:datashare_consumer", 116 "ffrt:libffrt", 117 "googletest:gmock", 118 "googletest:gtest_main", 119 "hilog:libhilog", 120 "init:libbeget_proxy", 121 "init:libbegetutil", 122 "ipc:ipc_core", 123 "jsoncpp:jsoncpp", 124 "relational_store:native_rdb", 125 ] 126 127 resource_config_file = "resource/ohos_test.xml" 128} 129 130ohos_unittest("EventExportWriteTest") { 131 module_out_path = module_output_path 132 133 configs = [ ":event_export_mgr_test_config" ] 134 135 sources = [ "unittest/common/event_export_write_test.cpp" ] 136 137 deps = [ 138 "$hiview_base:hiviewbase", 139 "../../event_export:event_export_engine", 140 ] 141 142 external_deps = [ 143 "ability_base:zuri", 144 "cJSON:cjson", 145 "data_share:datashare_consumer", 146 "ffrt:libffrt", 147 "googletest:gmock", 148 "googletest:gtest_main", 149 "hilog:libhilog", 150 "init:libbeget_proxy", 151 "init:libbegetutil", 152 "ipc:ipc_core", 153 "relational_store:native_rdb", 154 ] 155}