1# Copyright (c) 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. 13import("//base/hiviewdfx/hiview/hiview.gni") 14import("//build/test.gni") 15 16module_output_path = hiview_module + "/event_validator" 17 18config("unittest_config") { 19 visibility = [ ":*" ] 20 21 include_dirs = [ 22 ".", 23 "$hiview_plugin/event_validator/control/config/include", 24 "$hiview_plugin/event_validator/control/db/include", 25 "$hiview_plugin/event_validator/control/include", 26 "$hiview_plugin/event_validator/include", 27 ] 28 29 cflags = [ "-D__UNITTEST__" ] 30} 31 32ohos_unittest("DailyControllerTest") { 33 module_out_path = module_output_path 34 configs = [ ":unittest_config" ] 35 36 sources = [ "daily_controller_test.cpp" ] 37 38 deps = [ 39 "$hiview_base:hiviewbase_static_lib_for_tdd", 40 "$hiview_base/utility:hiview_utility", 41 "$hiview_core:hiview_core", 42 "$hiview_plugin/event_validator:event_validator", 43 ] 44 45 external_deps = [ 46 "cJSON:cjson", 47 "c_utils:utils", 48 "ffrt:libffrt", 49 "googletest:gtest_main", 50 "hilog:libhilog", 51 "relational_store:native_rdb", 52 ] 53 54 resource_config_file = 55 "$hiview_plugin/event_validator/test/resource/ohos_test.xml" 56} 57 58ohos_unittest("EventValidatorTest") { 59 branch_protector_ret = "pac_ret" 60 61 sanitize = { 62 cfi = true 63 cfi_cross_dso = true 64 cfi_vcall_icall_only = true 65 debug = false 66 } 67 68 module_out_path = module_output_path 69 configs = [ ":unittest_config" ] 70 71 sources = [ "event_validator_test.cpp" ] 72 73 deps = [ 74 "$hiview_base:hiviewbase", 75 "$hiview_core:hiview_core", 76 "$hiview_plugin/event_validator:event_validator", 77 ] 78 79 external_deps = [ 80 "cJSON:cjson", 81 "c_utils:utils", 82 "ffrt:libffrt", 83 "googletest:gtest_main", 84 "hilog:libhilog", 85 "jsoncpp:jsoncpp", 86 "relational_store:native_rdb", 87 ] 88} 89