1# Copyright (c) 2021-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") 15import("./../../../uhdf.gni") 16 17hdf_framework_path = "./../../../../../framework" 18hdf_adapter_path = "./../../../../../adapter" 19 20module_output_path = "hdf_core/manager" 21ohos_unittest("hdf_adapter_uhdf_test_manager") { 22 module_out_path = module_output_path 23 include_dirs = [ 24 "$hdf_framework_path/include/platform", 25 "$hdf_framework_path/include/core", 26 "$hdf_framework_path/core/common/include/host", 27 "$hdf_framework_path/core/shared/include", 28 "$hdf_framework_path/include/osal", 29 "$hdf_framework_path/include/utils", 30 "$hdf_framework_path/include", 31 "$hdf_framework_path/test/unittest/include", 32 "$hdf_framework_path/test/unittest/manager", 33 ] 34 35 defines = [ "__USER__" ] 36 sources = [ "$hdf_framework_path/core/manager/test/unittest/common/hdf_lite_manager_test.cpp" ] 37 deps = [ 38 "$hdf_adapter_path/build/test_common:libhdf_test_common", 39 "$hdf_adapter_path/uhdf2/utils:libhdf_utils", 40 ] 41 resource_config_file = 42 "$hdf_adapter_path/uhdf2/test/resource/manager/ohos_test.xml" 43 if (is_standard_system) { 44 external_deps = [ 45 "c_utils:utils", 46 "hilog:libhilog", 47 ] 48 } else { 49 external_deps = [ "hilog:libhilog" ] 50 } 51} 52 53module_output_path = "hdf_core/ioservice" 54ohos_unittest("hdf_adapter_uhdf_test_ioservice") { 55 module_out_path = module_output_path 56 include_dirs = [ 57 "$hdf_framework_path/include/platform", 58 "$hdf_framework_path/include/core", 59 "$hdf_framework_path/core/common/include/host", 60 "$hdf_framework_path/core/shared/include", 61 "$hdf_framework_path/include/osal", 62 "$hdf_framework_path/include/utils", 63 "$hdf_framework_path/include", 64 "$hdf_framework_path/test/unittest/include", 65 "$hdf_framework_path/test/unittest/manager", 66 ] 67 68 defines = [ "__USER__" ] 69 sources = [ "$hdf_framework_path/core/manager/test/unittest/common/hdf_ioservice_test.cpp" ] 70 deps = [ "$hdf_adapter_path/uhdf2/utils:libhdf_utils" ] 71 if (is_standard_system) { 72 external_deps = [ 73 "c_utils:utils", 74 "hilog:libhilog", 75 ] 76 } else { 77 external_deps = [ "hilog:libhilog" ] 78 } 79} 80module_output_path = "hdf_core/sbuf" 81ohos_unittest("hdf_adapter_uhdf_test_sbuf") { 82 module_out_path = module_output_path 83 include_dirs = [ 84 "$hdf_framework_path/include/osal", 85 "$hdf_framework_path/include/utils", 86 "$hdf_framework_path/include", 87 "$hdf_framework_path/test/unittest/include", 88 "$hdf_framework_path/test/unittest/manager", 89 "$hdf_adapter_path/uhdf2/ipc/include", 90 ] 91 92 defines = [ "__USER__" ] 93 sources = [ 94 "$hdf_framework_path/core/manager/test/unittest/common/hdf_sbuf_test.cpp", 95 ] 96 deps = [ 97 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 98 "$hdf_uhdf_path/utils:libhdf_utils", 99 ] 100 if (is_standard_system) { 101 external_deps = [ 102 "c_utils:utils", 103 "hilog:libhilog", 104 "ipc:ipc_single", 105 ] 106 } else { 107 external_deps = [ "hilog:libhilog" ] 108 } 109} 110module_output_path = "hdf_core/pm" 111ohos_unittest("hdf_adapter_uhdf_test_pm") { 112 module_out_path = module_output_path 113 include_dirs = [ 114 "$hdf_framework_path/core/shared/include", 115 "$hdf_framework_path/test/unittest/include", 116 "$hdf_framework_path/test/unittest/pm", 117 ] 118 119 defines = [ "__USER__" ] 120 sources = [ 121 "$hdf_framework_path/core/manager/test/unittest/common/hdf_pm_test.cpp", 122 ] 123 deps = [ "$hdf_adapter_path/uhdf2/utils:libhdf_utils" ] 124 if (is_standard_system) { 125 external_deps = [ 126 "c_utils:utils", 127 "hilog:libhilog", 128 "ipc:ipc_single", 129 ] 130 } else { 131 external_deps = [ "hilog:libhilog" ] 132 } 133} 134module_output_path = "hdf_core/remote" 135ohos_unittest("hdf_adapter_uhdf_test_remote_adapter") { 136 module_out_path = module_output_path 137 include_dirs = [ 138 "$hdf_framework_path/test/unittest/include", 139 "$hdf_framework_path/test/unittest/manager", 140 "$hdf_adapter_path/uhdf2/ipc/include", 141 ] 142 143 defines = [ "__USER__" ] 144 sources = [ "$hdf_framework_path/core/manager/test/unittest/common/hdf_remote_adapter_test.cpp" ] 145 deps = [ 146 "$hdf_uhdf_path/hdi:libhdi", 147 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 148 "$hdf_uhdf_path/utils:libhdf_utils", 149 ] 150 if (is_standard_system) { 151 external_deps = [ 152 "c_utils:utils", 153 "hdf_core:libhdf_ipc_adapter", 154 "hdf_core:libhdf_utils", 155 "hdf_core:libhdi", 156 "hilog:libhilog", 157 "ipc:ipc_single", 158 ] 159 } else { 160 external_deps = [ "hilog:libhilog" ] 161 } 162} 163module_output_path = "hdf_core/shared" 164ohos_unittest("hdf_adapter_uhdf_test_core_shared") { 165 module_out_path = module_output_path 166 include_dirs = [ "$hdf_framework_path/core/shared/include" ] 167 defines = [ "__USER__" ] 168 sources = [ "$hdf_framework_path/core/shared/test/unittest/common/hdf_core_shared_test.cpp" ] 169 deps = [ 170 "$hdf_uhdf_path/hdi:libhdi", 171 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 172 "$hdf_uhdf_path/utils:libhdf_utils", 173 ] 174 if (is_standard_system) { 175 external_deps = [ 176 "c_utils:utils", 177 "hdf_core:libhdf_host", 178 "hilog:libhilog", 179 "ipc:ipc_single", 180 ] 181 } else { 182 external_deps = [ "hilog:libhilog" ] 183 } 184} 185 186module_output_path = "hdf_core/uevent" 187ohos_unittest("hdf_adapter_uhdf_test_uevent") { 188 module_out_path = module_output_path 189 include_dirs = [ "$hdf_framework_path/core/shared/include" ] 190 191 defines = [ "__USER__" ] 192 sources = [ "$hdf_framework_path/core/manager/test/unittest/common/devmgr_uevent_test.cpp" ] 193 194 if (is_standard_system) { 195 external_deps = [ 196 "c_utils:utils", 197 "hdf_core:libhdf_utils", 198 "hdf_core:libhdi", 199 "hilog:libhilog", 200 ] 201 } else { 202 external_deps = [ "hilog:libhilog" ] 203 } 204} 205