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