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 14import("//base/usb/usb_manager/usbmgr.gni") 15import("//build/test.gni") 16 17module_output_path = "${usb_manager_part_name}/usb_unittest_test" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ "include" ] 23} 24 25ohos_unittest("test_usbdevicepipe") { 26 module_out_path = module_output_path 27 sources = [ "src/usb_device_pipe_test.cpp" ] 28 29 configs = [ 30 "${utils_path}:utils_config", 31 ":module_private_config", 32 ] 33 34 deps = [ 35 "${usb_manager_path}/interfaces/innerkits:usbsrv_client", 36 "${usb_manager_path}/services:usbservice", 37 "//third_party/googletest:gtest_main", 38 ] 39 40 external_deps = [ 41 "ability_base:want", 42 "bundle_framework:appexecfwk_base", 43 "ces_standard:cesfwk_innerkits", 44 "eventhandler:libeventhandler", 45 "hiviewdfx_hilog_native:libhilog", 46 "ipc:ipc_core", 47 "safwk:system_ability_fwk", 48 "samgr_standard:samgr_proxy", 49 "usb_device_driver:usbd_client", 50 "utils_base:utils", 51 ] 52} 53 54ohos_unittest("test_bulkcallback") { 55 module_out_path = module_output_path 56 sources = [ 57 "src/usb_bulkcallback_test.cpp", 58 "src/usb_callback_test.cpp", 59 ] 60 61 configs = [ 62 "${utils_path}:utils_config", 63 ":module_private_config", 64 ] 65 66 deps = [ 67 "${usb_manager_path}/interfaces/innerkits:usbsrv_client", 68 "${usb_manager_path}/services:usbservice", 69 "//third_party/googletest:gtest_main", 70 ] 71 72 external_deps = [ 73 "ability_base:want", 74 "bundle_framework:appexecfwk_base", 75 "ces_standard:cesfwk_innerkits", 76 "eventhandler:libeventhandler", 77 "hiviewdfx_hilog_native:libhilog", 78 "ipc:ipc_core", 79 "safwk:system_ability_fwk", 80 "samgr_standard:samgr_proxy", 81 "usb_device_driver:usbd_client", 82 "utils_base:utils", 83 ] 84} 85 86ohos_unittest("test_usbrequest") { 87 module_out_path = module_output_path 88 sources = [ "src/usb_request_test.cpp" ] 89 90 configs = [ 91 "${utils_path}:utils_config", 92 ":module_private_config", 93 ] 94 95 deps = [ 96 "${usb_manager_path}/interfaces/innerkits:usbsrv_client", 97 "${usb_manager_path}/services:usbservice", 98 "//third_party/googletest:gtest_main", 99 ] 100 101 external_deps = [ 102 "ability_base:want", 103 "bundle_framework:appexecfwk_base", 104 "ces_standard:cesfwk_innerkits", 105 "eventhandler:libeventhandler", 106 "hiviewdfx_hilog_native:libhilog", 107 "ipc:ipc_core", 108 "safwk:system_ability_fwk", 109 "samgr_standard:samgr_proxy", 110 "usb_device_driver:usbd_client", 111 "utils_base:utils", 112 ] 113} 114 115ohos_unittest("test_usbcore") { 116 module_out_path = module_output_path 117 sources = [ "src/usb_core_test.cpp" ] 118 119 configs = [ 120 "${utils_path}:utils_config", 121 ":module_private_config", 122 ] 123 124 deps = [ 125 "${usb_manager_path}/interfaces/innerkits:usbsrv_client", 126 "${usb_manager_path}/services:usbservice", 127 "//third_party/googletest:gtest_main", 128 ] 129 130 external_deps = [ 131 "ability_base:want", 132 "bundle_framework:appexecfwk_base", 133 "ces_standard:cesfwk_innerkits", 134 "eventhandler:libeventhandler", 135 "hiviewdfx_hilog_native:libhilog", 136 "ipc:ipc_core", 137 "safwk:system_ability_fwk", 138 "samgr_standard:samgr_proxy", 139 "usb_device_driver:usbd_client", 140 "utils_base:utils", 141 ] 142} 143 144group("unittest") { 145 testonly = true 146 deps = [] 147} 148