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") 15import("//drivers/peripheral/usb/usb.gni") 16 17module_output_path = "hdf/usb" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "//utils/system/safwk/native/include", 25 "${usb_driver_path}/test/UsbSubscriberTest", 26 ] 27} 28 29ohos_unittest("test_transfer") { 30 sources = [ 31 "${usb_driver_path}/test/UsbSubscriberTest/UsbSubscriberTest.cpp", 32 "src/usbd_transfer_test.cpp", 33 ] 34 35 include_dirs = [ "${usb_driver_path}/test/UsbSubscriberTest" ] 36 37 configs = [ ":module_private_config" ] 38 39 deps = [ 40 "${usb_driver_path}/ddk:libusb_core", 41 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 42 "//third_party/googletest:gtest_main", 43 ] 44 45 external_deps = [ 46 "c_utils:utils", 47 "drivers_interface_usb:libusb_proxy_1.0", 48 "eventhandler:libeventhandler", 49 "hdf_core:libhdf_utils", 50 "hiviewdfx_hilog_native:libhilog", 51 "ipc:ipc_single", 52 "safwk:system_ability_fwk", 53 "samgr:samgr_proxy", 54 ] 55 module_out_path = module_output_path 56} 57ohos_unittest("test_device") { 58 sources = [ 59 "${usb_driver_path}/test/UsbSubscriberTest/UsbSubscriberTest.cpp", 60 "src/usbd_device_test.cpp", 61 ] 62 63 include_dirs = [ "${usb_driver_path}/test/UsbSubscriberTest" ] 64 65 configs = [ ":module_private_config" ] 66 67 deps = [ 68 "${usb_driver_path}/ddk:libusb_core", 69 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 70 "//third_party/googletest:gtest_main", 71 ] 72 73 external_deps = [ 74 "c_utils:utils", 75 "drivers_interface_usb:libusb_proxy_1.0", 76 "eventhandler:libeventhandler", 77 "hdf_core:libhdf_utils", 78 "hiviewdfx_hilog_native:libhilog", 79 "ipc:ipc_single", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 ] 83 module_out_path = module_output_path 84} 85 86ohos_unittest("test_function") { 87 sources = [ "src/usbd_function_test.cpp" ] 88 89 configs = [ ":module_private_config" ] 90 91 deps = [ 92 "${usb_driver_path}/ddk:libusb_core", 93 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 94 "//third_party/googletest:gtest_main", 95 ] 96 97 external_deps = [ 98 "c_utils:utils", 99 "drivers_interface_usb:libusb_proxy_1.0", 100 "eventhandler:libeventhandler", 101 "hdf_core:libhdf_utils", 102 "hiviewdfx_hilog_native: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_request_test.cpp", 114 ] 115 116 include_dirs = [ "${usb_driver_path}/test/UsbSubscriberTest" ] 117 118 configs = [ ":module_private_config" ] 119 120 deps = [ 121 "${usb_driver_path}/ddk:libusb_core", 122 "${usb_driver_path}/hdi_service:libusb_interface_service_1.0", 123 "//third_party/googletest:gtest_main", 124 ] 125 126 external_deps = [ 127 "c_utils:utils", 128 "drivers_interface_usb:libusb_proxy_1.0", 129 "eventhandler:libeventhandler", 130 "hdf_core:libhdf_utils", 131 "hiviewdfx_hilog_native:libhilog", 132 "ipc:ipc_single", 133 "safwk:system_ability_fwk", 134 "samgr:samgr_proxy", 135 ] 136 module_out_path = module_output_path 137} 138 139group("hal_test") { 140 testonly = true 141 deps = [] 142} 143