1# Copyright (c) 2021-2022 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 = "hiviewdfx/hicollie" 17hicollie_part_path = "//base/hiviewdfx/hicollie" 18 19############################################################################### 20config("module_private_config") { 21 visibility = [ ":*" ] 22 include_dirs = [ 23 ".", 24 "${hicollie_part_path}/frameworks/native/test", 25 "${hicollie_part_path}/interfaces/native/innerkits/include/xcollie", 26 "//commonlibrary/c_utils/base/include", 27 ] 28} 29 30##############################unittest########################################## 31ohos_unittest("XCollieUnitTest") { 32 module_out_path = module_output_path 33 sources = [ 34 "${hicollie_part_path}/frameworks/native/test/xcollie_checker_test.cpp", 35 "xcollie_interface_test.cpp", 36 ] 37 38 configs = [ ":module_private_config" ] 39 40 deps = [ "//third_party/googletest:gtest_main" ] 41 external_deps = [ 42 "c_utils:utils", 43 "hicollie_native:libhicollie", 44 "hilog_native:libhilog", 45 "hisysevent_native:libhisysevent", 46 ] 47} 48 49ohos_unittest("WatchdogUnitTest") { 50 module_out_path = module_output_path 51 sources = [ "watchdog_interface_test.cpp" ] 52 53 configs = [ ":module_private_config" ] 54 55 deps = [ "//third_party/googletest:gtest_main" ] 56 external_deps = [ 57 "c_utils:utils", 58 "eventhandler:libeventhandler", 59 "hicollie_native:libhicollie", 60 "hilog_native:libhilog", 61 "hisysevent_native:libhisysevent", 62 ] 63} 64 65ohos_unittest("HandlerCheckerTest") { 66 module_out_path = module_output_path 67 include_dirs = [ 68 ".", 69 "${hicollie_part_path}/frameworks/native/", 70 "//commonlibrary/c_utils/base/include", 71 ] 72 sources = [ "handler_checker_test.cpp" ] 73 74 configs = [ ":module_private_config" ] 75 76 deps = [ 77 "${hicollie_part_path}/frameworks/native:libhicollie_source", 78 "//third_party/googletest:gtest_main", 79 ] 80 81 external_deps = [ 82 "c_utils:utils", 83 "eventhandler:libeventhandler", 84 "hicollie_native:libhicollie", 85 "hilog_native:libhilog", 86 ] 87} 88 89ohos_unittest("XCollieCheckerInterfaceUnitTest") { 90 module_out_path = module_output_path 91 sources = [ 92 "${hicollie_part_path}/frameworks/native/test/xcollie_checker_test.cpp", 93 "xcollie_checker_interface_test.cpp", 94 ] 95 96 configs = [ ":module_private_config" ] 97 98 deps = [ "//third_party/googletest:gtest_main" ] 99 external_deps = [ 100 "c_utils:utils", 101 "hicollie_native:libhicollie", 102 "hilog_native:libhilog", 103 ] 104} 105 106ohos_unittest("XCollieInnerTestUnitTest") { 107 module_out_path = module_output_path 108 include_dirs = [ 109 ".", 110 "${hicollie_part_path}/frameworks/native/", 111 "//commonlibrary/c_utils/base/include", 112 ] 113 sources = [ 114 "${hicollie_part_path}/frameworks/native/test/xcollie_checker_test.cpp", 115 "xcollie_inner_test.cpp", 116 ] 117 118 configs = [ ":module_private_config" ] 119 120 deps = [ 121 "${hicollie_part_path}/frameworks/native:libhicollie_source", 122 "//third_party/googletest:gtest_main", 123 ] 124 external_deps = [ 125 "c_utils:utils", 126 "hicollie_native:libhicollie", 127 "hilog_native:libhilog", 128 ] 129} 130 131############################################################################### 132group("unittest") { 133 testonly = true 134 deps = [ 135 # deps file 136 ":HandlerCheckerTest", 137 ":WatchdogUnitTest", 138 ":XCollieCheckerInterfaceUnitTest", 139 ":XCollieInnerTestUnitTest", 140 ":XCollieUnitTest", 141 ] 142} 143############################################################################### 144