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 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("./../../../../../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 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 30 ] 31 32 sources = [ "./../common/usb_device_liteos_sdk_test.cpp" ] 33 public_deps = [ 34 "./../../../../../../base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 35 "./../../../../../hdf_core/adapter/uhdf/manager:hdf_core", 36 "./../../../../../hdf_core/adapter/uhdf/platform:hdf_platform", 37 "./../../../../../hdf_core/adapter/uhdf/posix:hdf_posix_osal", 38 "./../../../../../hdf_core/adapter/uhdf/test/unittest/common:hdf_test_common", 39 "//third_party/bounds_checking_function:libsec_shared", 40 ] 41 cflags = [ 42 "-Wall", 43 "-Wextra", 44 "-Werror", 45 "-fsigned-char", 46 "-fno-common", 47 "-fno-strict-aliasing", 48 ] 49 } 50} else { 51 module_output_path = "hdf/usb" 52 ohos_unittest("usb_device_sdk_if_test") { 53 module_out_path = module_output_path 54 include_dirs = [ 55 "./../../../ddk/common/include", 56 "./../../../ddk/device/include", 57 "./../../../interfaces/ddk/common", 58 "./../../../interfaces/ddk/device", 59 "//third_party/googletest/googletest/include", 60 "./device_sdk", 61 ] 62 63 sources = [ 64 "./usb_device_cdcacm_test.cpp", 65 "./usb_device_sdk_if_test.cpp", 66 ] 67 deps = [ "./../../../ddk:libusb_core" ] 68 69 if (is_standard_system) { 70 external_deps = [ 71 "hdf_core:libhdf_host", 72 "hdf_core:libhdf_ipc_adapter", 73 "hdf_core:libhdf_utils", 74 "hdf_core:libhdi", 75 "hilog:libhilog", 76 ] 77 if (usb_c_utils_enable) { 78 external_deps += [ "c_utils:utils" ] 79 } 80 } else { 81 external_deps = [ "hilog:libhilog" ] 82 } 83 } 84} 85