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.1",
29    "//third_party/benchmark",
30    "//third_party/googletest:gtest_main",
31  ]
32
33  if (is_standard_system) {
34    external_deps = [
35      "drivers_interface_usb:libusb_proxy_1.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}
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 = [
61    "${usb_driver_path}/hdi_service:libusb_interface_service_1.1",
62    "//third_party/benchmark",
63    "//third_party/googletest:gtest_main",
64  ]
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}
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 = [
94    "${usb_driver_path}/hdi_service:libusb_interface_service_1.1",
95    "//third_party/benchmark",
96    "//third_party/googletest:gtest_main",
97  ]
98
99  if (is_standard_system) {
100    external_deps = [
101      "drivers_interface_usb:libusb_proxy_1.0",
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}
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 = [
127    "${usb_driver_path}/hdi_service:libusb_interface_service_1.1",
128    "//third_party/benchmark",
129    "//third_party/googletest:gtest_main",
130  ]
131
132  if (is_standard_system) {
133    external_deps = [
134      "drivers_interface_usb:libusb_proxy_1.1",
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}
148
149group("hdf_usb_benchmark") {
150  testonly = true
151  deps = [
152    ":hdf_usb_benchmark_device_test",
153    ":hdf_usb_benchmark_function_test",
154    ":hdf_usb_benchmark_request_test",
155    ":hdf_usb_benchmark_transfer_test",
156  ]
157}
158