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