• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/hdf_core/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    ]
53
54    sources = [
55      "//drivers/peripheral/usb/test/unittest/device_sdk/usb_device_cdcacm_test.cpp",
56      "//drivers/peripheral/usb/test/unittest/device_sdk/usb_device_sdk_io_test.cpp",
57    ]
58    deps = [ "//drivers/peripheral/usb/ddk:libusb_core" ]
59
60    if (is_standard_system) {
61      external_deps = [
62        "c_utils:utils",
63        "hdf_core:libhdf_host",
64        "hdf_core:libhdf_ipc_adapter",
65        "hdf_core:libhdf_utils",
66        "hdf_core:libhdi",
67        "hiviewdfx_hilog_native:libhilog",
68      ]
69    } else {
70      external_deps = [ "hilog:libhilog" ]
71    }
72  }
73
74  group("hdf_manual_test_usb") {
75    testonly = true
76    deps = [
77      ":usb_device_sdk_io_test",
78      "host_sdk:hdf_unittest_usb_host",
79    ]
80  }
81}
82