# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. if (defined(ohos_lite)) { import("//build/lite/config/test.gni") } else { import("//build/config/sanitizers/sanitizers.gni") import("//build/test.gni") } import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") if (defined(ohos_lite)) { output_path = "$root_out_dir/test/moduletest/hdf/usb" moduletest("usb_host_serial_func_test") { output_extension = "bin" output_dir = output_path include_dirs = [ "//third_party/googletest/googletest/include", "//drivers/peripheral/usb/sample/host/include", "//drivers/hdf_core/adapter/uhdf/posix/include", "//drivers/hdf_core/adapter/khdf/liteos/osal/include", "//drivers/hdf_core/adapter/khdf/liteos/model/usb/host/include", "//drivers/hdf_core/framework/include/utils", "//drivers/hdf_core/framework/include/osal", "//drivers/hdf_core/framework/core/adapter/syscall/include", "//drivers/hdf_core/framework/include/core", "//drivers/hdf_core/framework/core/shared/include", "//drivers/hdf_core/framework/core/common/include/host", "//drivers/hdf_core/framework/utils/include", "//drivers/hdf_core/framework/include", "//third_party/bounds_checking_function/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "//drivers/peripheral/usb/serial/include", "//drivers/peripheral/usb/ddk/common/include", "//drivers/peripheral/usb/ddk/device/include", "//drivers/peripheral/usb/ddk/host/include", "//drivers/peripheral/usb/interfaces/ddk/common", "//drivers/peripheral/usb/interfaces/ddk/host", "//drivers/peripheral/usb/gadget/function/include", "common", ] sources = [ "./common/liteos/usb_host_serial_func_test.cpp", "//drivers/peripheral/usb/sample/host/src/usbhost_ddk_test.c", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//commonlibrary/utils_lite:utils", "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", ] defines = [ "__LITEOS_USB_HOST_DDK_TEST__" ] } moduletest("usb_host_raw_api_func_test") { output_extension = "bin" output_dir = output_path include_dirs = [ "//third_party/googletest/googletest/include", "//drivers/peripheral/usb/sample/host/include", "//drivers/hdf_core/adapter/uhdf/posix/include", "//drivers/hdf_core/adapter/khdf/liteos/osal/include", "//drivers/hdf_core/adapter/khdf/liteos/model/usb/host/include", "//drivers/hdf_core/framework/include/utils", "//drivers/hdf_core/framework/include/osal", "//drivers/hdf_core/framework/core/adapter/syscall/include", "//drivers/hdf_core/framework/include/core", "//drivers/hdf_core/framework/core/shared/include", "//drivers/hdf_core/framework/core/common/include/host", "//drivers/hdf_core/framework/utils/include", "//drivers/hdf_core/framework/include", "//third_party/bounds_checking_function/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "//drivers/peripheral/usb/serial/include", "//drivers/peripheral/usb/ddk/common/include", "//drivers/peripheral/usb/ddk/device/include", "//drivers/peripheral/usb/ddk/host/include", "//drivers/peripheral/usb/interfaces/ddk/common", "//drivers/peripheral/usb/interfaces/ddk/host", "//drivers/peripheral/usb/gadget/function/include", "common", ] sources = [ "./common/liteos/usb_host_raw_api_func_test.cpp", "//drivers/peripheral/usb/sample/host/src/usbhost_ddk_test.c", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//commonlibrary/utils_lite:utils", "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", ] defines = [ "__LITEOS_USB_HOST_DDK_TEST__" ] } moduletest("usb_host_serial_loopback") { output_extension = "bin" output_dir = output_path include_dirs = [ "//third_party/googletest/googletest/include", "//drivers/peripheral/usb/sample/host/include", "//drivers/hdf_core/adapter/uhdf/posix/include", "//drivers/hdf_core/adapter/khdf/liteos/osal/include", "//drivers/hdf_core/adapter/khdf/liteos/model/usb/host/include", "//drivers/hdf_core/framework/include/utils", "//drivers/hdf_core/framework/include/osal", "//drivers/hdf_core/framework/core/adapter/syscall/include", "//drivers/hdf_core/framework/include/core", "//drivers/hdf_core/framework/core/shared/include", "//drivers/hdf_core/framework/core/common/include/host", "//drivers/hdf_core/framework/utils/include", "//drivers/hdf_core/framework/include", "//third_party/bounds_checking_function/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "//drivers/peripheral/usb/serial/include", "//drivers/peripheral/usb/ddk/common/include", "//drivers/peripheral/usb/ddk/device/include", "//drivers/peripheral/usb/ddk/host/include", "//drivers/peripheral/usb/interfaces/ddk/common", "//drivers/peripheral/usb/interfaces/ddk/host", "//drivers/peripheral/usb/gadget/function/include", "common", ] sources = [ "./common/liteos/usb_host_serial_loopback.cpp", "//drivers/peripheral/usb/sample/host/src/usbhost_ddk_test.c", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//commonlibrary/utils_lite:utils", "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", ] defines = [ "__LITEOS_USB_HOST_DDK_TEST__" ] } moduletest("usb_device_serial_loopback") { output_extension = "bin" output_dir = output_path include_dirs = [ "//third_party/googletest/googletest/include", "//drivers/peripheral/usb/sample/device/liteos/lib/include", "$hdf_framework_path/core/shared/include", "$hdf_framework_path/core/host/include", "$hdf_framework_path/core/master/include", "$hdf_framework_path/include/core", "$hdf_framework_path/include/utils", "$hdf_framework_path/utils/include", "$hdf_framework_path/include/osal", "//drivers/hdf_core/adapter/uhdf/posix/include", "//third_party/bounds_checking_function/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "common", ] sources = [ "./common/liteos/usb_device_serial_loopback.cpp", "//drivers/peripheral/usb/sample/device/liteos/lib/src/lib_acm_test.c", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//commonlibrary/utils_lite:utils", "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", ] } moduletest("usb_device_serial_func_test") { output_extension = "bin" output_dir = output_path include_dirs = [ "//third_party/googletest/googletest/include", "//drivers/peripheral/usb/sample/device/liteos/lib/include", "$hdf_framework_path/core/shared/include", "$hdf_framework_path/core/host/include", "$hdf_framework_path/core/master/include", "$hdf_framework_path/include/core", "$hdf_framework_path/include/utils", "$hdf_framework_path/utils/include", "$hdf_framework_path/include/osal", "//drivers/hdf_core/adapter/uhdf/posix/include", "//third_party/bounds_checking_function/include", "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", "common", ] sources = [ "./common/liteos/usb_device_serial_func_test.cpp", "//drivers/peripheral/usb/sample/device/liteos/lib/src/lib_acm_test.c", ] deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", "//commonlibrary/utils_lite:utils", "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", ] } group("hdf_peripheral_usb_test_module") { deps = [ ":usb_device_serial_func_test", ":usb_device_serial_loopback", ":usb_host_raw_api_func_test", ":usb_host_serial_func_test", ":usb_host_serial_loopback", ] } } else { module_output_path = "hdf/usb" ohos_moduletest("usb_device_serial_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_device_serial_func_test.cpp", "./common/usb_utils.cpp", ] external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", ] } ohos_moduletest("usb_device_net_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_device_net_func_test.cpp", "./common/usb_utils.cpp", ] deps = [] } ohos_moduletest("usb_device_compose_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_device_compose_func_test.cpp", "./common/usb_utils.cpp", ] deps = [] } ohos_moduletest("usb_device_performance_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_device_performance_test.cpp", "./common/usb_utils.cpp", ] deps = [] external_deps = [ "hdf_core:libhdf_utils" ] } ohos_moduletest("usb_host_serial_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_host_serial_func_test.cpp", "./common/usb_utils.cpp", ] external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", ] } ohos_moduletest("usb_host_raw_api_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_host_raw_api_func_test.cpp", "./common/usb_utils.cpp", ] external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", ] } ohos_moduletest("usb_host_net_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_host_net_func_test.cpp", "./common/usb_utils.cpp", ] deps = [] } ohos_moduletest("usb_host_compose_func_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_host_compose_func_test.cpp", "./common/usb_utils.cpp", ] deps = [] } ohos_moduletest("usb_host_performance_test") { module_out_path = module_output_path include_dirs = [ "//third_party/googletest/googletest/include", "common", ] sources = [ "./common/usb_host_performance_test.cpp", "./common/usb_utils.cpp", ] deps = [] external_deps = [ "hdf_core:libhdf_utils" ] } group("hdf_moduletest_usb") { testonly = true deps = [ ":usb_device_performance_test", ":usb_device_serial_func_test", ":usb_host_performance_test", ":usb_host_raw_api_func_test", ":usb_host_serial_func_test", ] } }