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/test.gni") 16} else { 17 import("//build/config/sanitizers/sanitizers.gni") 18 import("//build/test.gni") 19 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 20} 21 22if (defined(ohos_lite)) { 23 unittest("hdf_usb_device_sdk_if_test") { 24 output_extension = "bin" 25 output_dir = "$root_out_dir/test/unittest/hdf" 26 include_dirs = [ 27 "//third_party/googletest/googletest/include", 28 "//third_party/bounds_checking_function/include", 29 "//drivers/hdf_core/framework/ability/sbuf/include", 30 "//drivers/hdf_core/framework/include/platform", 31 "//drivers/hdf_core/framework/include/core", 32 "//drivers/hdf_core/framework/include/osal", 33 "//drivers/hdf_core/adapter/uhdf/posix/include", 34 "//drivers/hdf_core/framework/include/utils", 35 "//drivers/hdf_core/framework/include/config", 36 "//drivers/hdf_core/framework/include", 37 "//drivers/hdf_core/framework/test/unittest/include", 38 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 39 ] 40 41 sources = [ "//drivers/peripheral/usb/test/unittest/common/usb_device_liteos_sdk_test.cpp" ] 42 deps = [ 43 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 44 "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", 45 "//drivers/hdf_core/adapter/uhdf/platform:hdf_platform", 46 "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", 47 "//drivers/hdf_core/adapter/uhdf/test/unittest/common:hdf_test_common", 48 ] 49 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 50 cflags = [ 51 "-Wall", 52 "-Wextra", 53 "-Werror", 54 "-fsigned-char", 55 "-fno-common", 56 "-fno-strict-aliasing", 57 ] 58 } 59} else { 60 module_output_path = "hdf/usb" 61 ohos_unittest("usb_device_sdk_if_test") { 62 module_out_path = module_output_path 63 include_dirs = [ 64 "//drivers/peripheral/usb/ddk/common/include", 65 "//drivers/peripheral/usb/ddk/device/include", 66 "//drivers/peripheral/usb/interfaces/ddk/common", 67 "//drivers/peripheral/usb/interfaces/ddk/device", 68 "//third_party/googletest/googletest/include", 69 "//drivers/peripheral/usb/test/unittest/device_sdk", 70 ] 71 72 sources = [ 73 "//drivers/peripheral/usb/test/unittest/device_sdk/usb_device_cdcacm_test.cpp", 74 "//drivers/peripheral/usb/test/unittest/device_sdk/usb_device_sdk_if_test.cpp", 75 ] 76 deps = [ "//drivers/peripheral/usb/ddk:libusb_core" ] 77 78 if (is_standard_system) { 79 external_deps = [ 80 "c_utils:utils", 81 "hdf_core:libhdf_host", 82 "hdf_core:libhdf_ipc_adapter", 83 "hdf_core:libhdf_utils", 84 "hdf_core:libhdi", 85 "hiviewdfx_hilog_native:libhilog", 86 ] 87 } else { 88 external_deps = [ "hilog:libhilog" ] 89 } 90 } 91} 92