1# Copyright (c) 2021-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("./../../usb.gni") 15if (defined(ohos_lite)) { 16 import("//build/lite/config/component/lite_component.gni") 17 import("//build/lite/config/test.gni") 18 lite_component("hdf_manual_test_usb_device") { 19 if (ohos_build_type == "debug") { 20 deps = [ 21 "./../../performance:hdf_usb_device_sdk_io_test", 22 "device_sdk:hdf_usb_device_sdk_if_test", 23 ] 24 } 25 features = [] 26 } 27 lite_component("hdf_manual_test_usb_host") { 28 if (ohos_build_type == "debug") { 29 deps = [ 30 "host_sdk:usb_host_raw_io_test", 31 "host_sdk:usb_host_raw_test", 32 "host_sdk:usb_host_sdk_io_test", 33 "host_sdk:usb_host_sdk_test", 34 ] 35 } 36 features = [] 37 } 38} else { 39 import("//build/config/sanitizers/sanitizers.gni") 40 import("//build/test.gni") 41 import("./../../../../hdf_core/adapter/uhdf2/uhdf.gni") 42 43 module_output_path = "hdf/usb" 44 ohos_unittest("usb_device_sdk_io_test") { 45 module_out_path = module_output_path 46 include_dirs = [ 47 "./../../../ddk/common/include", 48 "./../../../ddk/device/include", 49 "./../../../interfaces/ddk/common", 50 "./../../../interfaces/ddk/device", 51 "//third_party/googletest/googletest/include", 52 "./../device_sdk", 53 "${usb_driver_path}/utils/include", 54 ] 55 56 sources = [ 57 "./../device_sdk/usb_device_cdcacm_test.cpp", 58 "./../device_sdk/usb_device_sdk_io_test.cpp", 59 ] 60 deps = [ "./../../../ddk:libusb_core" ] 61 62 if (is_standard_system) { 63 external_deps = [ 64 "hdf_core:libhdf_host", 65 "hdf_core:libhdf_ipc_adapter", 66 "hdf_core:libhdf_utils", 67 "hdf_core:libhdi", 68 "hilog:libhilog", 69 ] 70 if (usb_c_utils_enable) { 71 external_deps += [ "c_utils:utils" ] 72 } 73 } else { 74 external_deps = [ "hilog:libhilog" ] 75 } 76 } 77 78 group("hdf_manual_test_usb") { 79 testonly = true 80 deps = [ 81 ":usb_device_sdk_io_test", 82 "host_sdk:hdf_unittest_usb_host", 83 ] 84 } 85} 86