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