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("./../../../usb.gni") 16 17module_output_path = "drivers_peripheral_usb/usb" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "${usb_driver_path}/test/UsbSubscriberTest", 25 ] 26} 27 28ohos_unittest("test_transfer") { 29 sources = [ 30 "${usb_driver_path}/test/UsbSubscriberTest/UsbSubscriberTest.cpp", 31 "src/usbd_transfer_test.cpp", 32 ] 33 34 include_dirs = [ "${usb_driver_path}/test/UsbSubscriberTest" ] 35 36 configs = [ ":module_private_config" ] 37 38 deps = [ 39 "${usb_driver_path}/ddk:libusb_core", 40 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 41 "//third_party/googletest:gtest_main", 42 ] 43 44 external_deps = [ 45 "c_utils:utils", 46 "drivers_interface_usb:libusb_proxy_1.0", 47 "eventhandler:libeventhandler", 48 "hdf_core:libhdf_utils", 49 "hilog:libhilog", 50 "ipc:ipc_single", 51 "safwk:system_ability_fwk", 52 "samgr:samgr_proxy", 53 ] 54 module_out_path = module_output_path 55} 56ohos_unittest("test_device") { 57 sources = [ 58 "${usb_driver_path}/test/UsbSubscriberTest/UsbSubscriberTest.cpp", 59 "src/usbd_device_test.cpp", 60 ] 61 62 include_dirs = [ "${usb_driver_path}/test/UsbSubscriberTest" ] 63 64 configs = [ ":module_private_config" ] 65 66 deps = [ 67 "${usb_driver_path}/ddk:libusb_core", 68 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 69 "//third_party/googletest:gtest_main", 70 ] 71 72 external_deps = [ 73 "c_utils:utils", 74 "drivers_interface_usb:libusb_proxy_1.0", 75 "eventhandler:libeventhandler", 76 "hdf_core:libhdf_utils", 77 "hilog:libhilog", 78 "ipc:ipc_single", 79 "safwk:system_ability_fwk", 80 "samgr:samgr_proxy", 81 ] 82 module_out_path = module_output_path 83} 84 85ohos_unittest("test_function") { 86 sources = [ "src/usbd_function_test.cpp" ] 87 88 configs = [ ":module_private_config" ] 89 90 deps = [ 91 "${usb_driver_path}/ddk:libusb_core", 92 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 93 "//third_party/googletest:gtest_main", 94 ] 95 96 external_deps = [ 97 "c_utils:utils", 98 "drivers_interface_usb:libusb_proxy_1.0", 99 "eventhandler:libeventhandler", 100 "hdf_core:libhdf_host", 101 "hdf_core:libhdf_utils", 102 "hilog:libhilog", 103 "ipc:ipc_single", 104 "safwk:system_ability_fwk", 105 "samgr:samgr_proxy", 106 ] 107 module_out_path = module_output_path 108} 109 110ohos_unittest("test_request") { 111 sources = [ 112 "${usb_driver_path}/test/UsbSubscriberTest/UsbSubscriberTest.cpp", 113 "src/usbd_interface_test.cpp", 114 "src/usbd_request_test.cpp", 115 ] 116 117 include_dirs = [ "${usb_driver_path}/test/UsbSubscriberTest" ] 118 119 configs = [ ":module_private_config" ] 120 121 deps = [ 122 "${usb_driver_path}/ddk:libusb_core", 123 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 124 "//third_party/googletest:gtest_main", 125 ] 126 127 external_deps = [ 128 "c_utils:utils", 129 "drivers_interface_usb:libusb_proxy_1.0", 130 "eventhandler:libeventhandler", 131 "hdf_core:libhdf_utils", 132 "hilog:libhilog", 133 "ipc:ipc_single", 134 "safwk:system_ability_fwk", 135 "samgr:samgr_proxy", 136 ] 137 module_out_path = module_output_path 138} 139 140ohos_unittest("test_usbfnmtp") { 141 sources = [ "src/usbfn_mtp_test.cpp" ] 142 143 configs = [ ":module_private_config" ] 144 145 deps = [ 146 "${usb_driver_path}/ddk:libusb_core", 147 "${usb_driver_path}/gadget/function/mtp:libusbfn_mtp_interface_service_1.0", 148 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 149 "//third_party/googletest:gtest_main", 150 ] 151 152 external_deps = [ 153 "c_utils:utils", 154 "drivers_interface_usb:libusb_proxy_1.0", 155 "drivers_interface_usb:libusbfn_mtp_proxy_1.0", 156 "eventhandler:libeventhandler", 157 "hdf_core:libhdf_host", 158 "hdf_core:libhdf_utils", 159 "hilog:libhilog", 160 "ipc:ipc_single", 161 ] 162 module_out_path = module_output_path 163} 164 165group("hal_test") { 166 testonly = true 167 deps = [] 168} 169