1# Copyright (c) 2022-2023 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("//build/test.gni") 15 16module_output_path = "hisysevent/hisysevent_native" 17 18group("unittest") { 19 testonly = true 20 deps = [ 21 ":HiSysEventCWrapperTest", 22 ":HiSysEventToolUnitTest", 23 ] 24} 25 26config("unittest_config") { 27 include_dirs = [ 28 "//base/hiviewdfx/hisysevent/frameworks/native/c_wrapper/include", 29 "//base/hiviewdfx/hisysevent/frameworks/native/include", 30 ] 31 32 cflags_cc = [ "-D__UNITTEST__" ] 33} 34 35ohos_unittest("HiSysEventToolUnitTest") { 36 module_out_path = module_output_path 37 38 configs = [ ":unittest_config" ] 39 40 sources = [ 41 "//base/hiviewdfx/hisysevent/frameworks/native/hisysevent_json_decorator.cpp", 42 "//base/hiviewdfx/hisysevent/frameworks/native/hisysevent_tool.cpp", 43 "//base/hiviewdfx/hisysevent/frameworks/native/hisysevent_tool_listener.cpp", 44 "//base/hiviewdfx/hisysevent/frameworks/native/hisysevent_tool_query.cpp", 45 "//base/hiviewdfx/hisysevent/frameworks/native/json_flatten_parser.cpp", 46 "//base/hiviewdfx/hisysevent/frameworks/native/test/unittest/common/hisysevent_tool_unit_test.cpp", 47 ] 48 49 cflags_cc = [ "-DTEST_LOCAL_SRC" ] 50 51 deps = [ 52 "../../../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd", 53 "../../../../../interfaces/native/innerkits/hisysevent_manager:hisyseventmanager_static_lib_for_tdd", 54 ] 55 56 external_deps = [ 57 "c_utils:utils", 58 "hilog:libhilog", 59 "ipc:ipc_single", 60 "jsoncpp:jsoncpp", 61 "samgr:samgr_proxy", 62 ] 63} 64 65ohos_unittest("HiSysEventCWrapperTest") { 66 module_out_path = module_output_path 67 68 configs = [ ":unittest_config" ] 69 70 sources = [ "./hisysevent_c_wrapper_test.cpp" ] 71 72 cflags_cc = [ "-DTEST_LOCAL_SRC" ] 73 74 deps = [ 75 "../../../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd", 76 "../../../../../interfaces/native/innerkits/hisysevent_manager:hisyseventmanager_static_lib_for_tdd", 77 "../../../c_wrapper:hisysevent_c_wrapper", 78 ] 79 80 external_deps = [ 81 "c_utils:utils", 82 "hilog:libhilog", 83 "ipc:ipc_single", 84 "jsoncpp:jsoncpp", 85 "samgr:samgr_proxy", 86 ] 87} 88