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_uhdf_path = "./../.." 19hdf_interface_path = "./../../../../interface" 20 21###########################palTest########################### 22ohos_unittest("DevMgrTest") { 23 module_out_path = "hdf_core/devmgr" 24 sources = [ 25 "$hdf_uhdf_path/ipc/src/hdf_dump.cpp", 26 "unittest/devmgr_test.cpp", 27 ] 28 29 include_dirs = [ 30 "$hdf_framework_path/include/osal", 31 "$hdf_framework_path/include/utils", 32 "$hdf_framework_path/utils/include", 33 "$hdf_uhdf_path/hdi/include", 34 "$hdf_uhdf_path/include/hidl", 35 "$hdf_uhdf_path/ipc/include", 36 "$hdf_interface_path/inner_api/ipc", 37 "unittest/common/", 38 ] 39 40 deps = [ 41 "$hdf_uhdf_path/hdi:libhdi", 42 "$hdf_uhdf_path/utils:libhdf_utils", 43 ] 44 45 if (with_sample) { 46 defines = [ "SAMPLE_DRIVER" ] 47 deps += [ "$hdf_uhdf_path/host/test/unittest/sample_driver:sample_driver" ] 48 } 49 50 if (is_standard_system) { 51 external_deps = [ 52 "c_utils:utils", 53 "hilog:libhilog", 54 ] 55 } else { 56 external_deps = [ "hilog:libhilog" ] 57 } 58 59 external_deps += [ 60 "googletest:gmock_main", 61 "googletest:gtest_main", 62 ] 63} 64 65ohos_unittest("DevHostTest") { 66 module_out_path = "hdf_core/devhost" 67 sources = [ "unittest/devhost_test.cpp" ] 68 69 include_dirs = [ 70 "$hdf_framework_path/core/shared/include", 71 "$hdf_framework_path/core/manager/include", 72 "$hdf_framework_path/include/osal", 73 "$hdf_framework_path/include/utils", 74 "$hdf_framework_path/utils/include", 75 "$hdf_framework_path/core/host/include", 76 "$hdf_uhdf_path/host/include", 77 "$hdf_uhdf_path/manager/include", 78 "$hdf_uhdf_path/ipc/include", 79 ] 80 81 defines = [ "__USER__" ] 82 83 deps = [ 84 "$hdf_uhdf_path/host:libhdf_host", 85 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 86 "$hdf_uhdf_path/utils:libhdf_utils", 87 ] 88 89 if (is_standard_system) { 90 external_deps = [ 91 "c_utils:utils", 92 "hilog:libhilog", 93 ] 94 } else { 95 external_deps = [ "hilog:libhilog" ] 96 } 97 98 external_deps += [ 99 "googletest:gmock_main", 100 "googletest:gtest_main", 101 ] 102} 103 104###########################end########################### 105group("unittest") { 106 testonly = true 107 deps = [ 108 ":DevHostTest", 109 ":DevMgrTest", 110 ] 111} 112