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 "ipc:ipc_single", 55 ] 56 } else { 57 external_deps = [ "hilog:libhilog" ] 58 } 59 60 external_deps += [ 61 "googletest:gmock_main", 62 "googletest:gtest_main", 63 ] 64} 65 66ohos_unittest("DevHostTest") { 67 module_out_path = "hdf_core/devhost" 68 sources = [ "unittest/devhost_test.cpp" ] 69 70 include_dirs = [ 71 "$hdf_framework_path/core/shared/include", 72 "$hdf_framework_path/core/manager/include", 73 "$hdf_framework_path/include/osal", 74 "$hdf_framework_path/include/utils", 75 "$hdf_framework_path/utils/include", 76 "$hdf_framework_path/core/host/include", 77 "$hdf_uhdf_path/host/include", 78 "$hdf_uhdf_path/manager/include", 79 "$hdf_uhdf_path/ipc/include", 80 ] 81 82 defines = [ "__USER__" ] 83 84 deps = [ 85 "$hdf_uhdf_path/host:libhdf_host", 86 "$hdf_uhdf_path/ipc:libhdf_ipc_adapter", 87 "$hdf_uhdf_path/utils:libhdf_utils", 88 ] 89 90 if (is_standard_system) { 91 external_deps = [ 92 "c_utils:utils", 93 "hilog:libhilog", 94 ] 95 } else { 96 external_deps = [ "hilog:libhilog" ] 97 } 98 99 external_deps += [ 100 "googletest:gmock_main", 101 "googletest:gtest_main", 102 ] 103} 104 105###########################end########################### 106group("unittest") { 107 testonly = true 108 deps = [ 109 ":DevHostTest", 110 ":DevMgrTest", 111 ] 112} 113