1# Copyright (c) 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/ohos.gni") 15import("//build/test.gni") 16import("./../../usb.gni") 17 18module_output_path = "drivers_peripheral_usb/usb" 19 20ohos_benchmarktest("hdf_usb_benchmark_function_test") { 21 module_out_path = module_output_path 22 23 include_dirs = [] 24 25 sources = [ "usb_benchmark_function_test.cpp" ] 26 27 deps = [ 28 "${usb_driver_path}/hdi_service:libusb_interface_service_1.2", 29 "${usb_driver_path}/hdi_service:libusb_port_interface_service_2.0", 30 ] 31 32 if (is_standard_system) { 33 external_deps = [ 34 "drivers_interface_usb:libusb_proxy_1.0", 35 "drivers_interface_usb:libusb_proxy_2.0", 36 "hdf_core:libhdf_host", 37 "hdf_core:libhdf_utils", 38 "hilog:libhilog", 39 "ipc:ipc_single", 40 ] 41 if (usb_c_utils_enable) { 42 external_deps += [ "c_utils:utils" ] 43 } 44 } else { 45 external_deps = [ "hilog:libhilog" ] 46 } 47 external_deps += [ "ipc:ipc_single" ] 48 external_deps += [ 49 "benchmark:benchmark", 50 "googletest:gtest_main", 51 ] 52} 53 54ohos_benchmarktest("hdf_usb_benchmark_device_test") { 55 module_out_path = module_output_path 56 57 include_dirs = [ "../UsbSubscriberTest" ] 58 59 sources = [ 60 "../UsbSubscriberTest/UsbSubscriberTest.cpp", 61 "usb_benchmark_device_test.cpp", 62 ] 63 64 deps = [ "${usb_driver_path}/hdi_service:libusb_interface_service_1.2" ] 65 66 if (is_standard_system) { 67 external_deps = [ 68 "drivers_interface_usb:libusb_proxy_1.0", 69 "hdf_core:libhdf_host", 70 "hdf_core:libhdf_utils", 71 "hilog:libhilog", 72 "ipc:ipc_single", 73 ] 74 if (usb_c_utils_enable) { 75 external_deps += [ "c_utils:utils" ] 76 } 77 } else { 78 external_deps = [ "hilog:libhilog" ] 79 } 80 external_deps += [ "ipc:ipc_single" ] 81 external_deps += [ 82 "benchmark:benchmark", 83 "googletest:gtest_main", 84 ] 85} 86 87ohos_benchmarktest("hdf_usb_benchmark_request_test") { 88 module_out_path = module_output_path 89 90 include_dirs = [ "../UsbSubscriberTest" ] 91 92 sources = [ 93 "../UsbSubscriberTest/UsbSubscriberTest.cpp", 94 "usb_benchmark_request_test.cpp", 95 ] 96 97 deps = [ "${usb_driver_path}/hdi_service:libusb_interface_service_1.2" ] 98 99 if (is_standard_system) { 100 external_deps = [ 101 "drivers_interface_usb:libusb_proxy_1.2", 102 "hdf_core:libhdf_host", 103 "hdf_core:libhdf_utils", 104 "hilog:libhilog", 105 "ipc:ipc_single", 106 ] 107 if (usb_c_utils_enable) { 108 external_deps += [ "c_utils:utils" ] 109 } 110 } else { 111 external_deps = [ "hilog:libhilog" ] 112 } 113 external_deps += [ "ipc:ipc_single" ] 114 external_deps += [ 115 "benchmark:benchmark", 116 "googletest:gtest_main", 117 ] 118} 119 120ohos_benchmarktest("hdf_usb_benchmark_transfer_test") { 121 module_out_path = module_output_path 122 123 include_dirs = [ "../UsbSubscriberTest" ] 124 125 sources = [ 126 "../UsbSubscriberTest/UsbSubscriberTest.cpp", 127 "usb_benchmark_transfer_test.cpp", 128 ] 129 130 deps = [ "${usb_driver_path}/hdi_service:libusb_interface_service_1.2" ] 131 132 if (is_standard_system) { 133 external_deps = [ 134 "drivers_interface_usb:libusb_proxy_1.2", 135 "hdf_core:libhdf_host", 136 "hdf_core:libhdf_utils", 137 "hilog:libhilog", 138 "ipc:ipc_single", 139 ] 140 if (usb_c_utils_enable) { 141 external_deps += [ "c_utils:utils" ] 142 } 143 } else { 144 external_deps = [ "hilog:libhilog" ] 145 } 146 external_deps += [ "ipc:ipc_single" ] 147 external_deps += [ 148 "benchmark:benchmark", 149 "googletest:gtest_main", 150 ] 151} 152 153ohos_benchmarktest("hdi_usb_benchmark_driver_test") { 154 module_out_path = module_output_path 155 156 include_dirs = [ "../../utils/include" ] 157 158 sources = [ "usb_benchmark_driver_test.cpp" ] 159 160 deps = [ "./../../ddk_service/usb_service:usb_ddk_target" ] 161 162 external_deps = [ 163 "benchmark:benchmark", 164 "c_utils:utils", 165 "drivers_interface_usb:libusb_ddk_proxy_1.1", 166 "googletest:gtest_main", 167 "hilog:libhilog", 168 ] 169} 170 171group("hdf_usb_benchmark") { 172 testonly = true 173 deps = [ 174 ":hdf_usb_benchmark_device_test", 175 ":hdf_usb_benchmark_function_test", 176 ":hdf_usb_benchmark_request_test", 177 ":hdf_usb_benchmark_transfer_test", 178 ] 179} 180