1# Copyright (c) 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 14import("//build/test.gni") 15import("//drivers/external_device_manager/extdevmgr.gni") 16module_output_path = "external_device_manager/unittest" 17usb_bus_extension_include_path = "${ext_mgr_path}/services/native/driver_extension_manager/include/bus_extension/usb" 18ohos_unittest("bus_extension_usb_test") { 19 module_out_path = "${module_output_path}" 20 sources = [ 21 "bus_extension_usb_test/src/usb_bus_extension_test.cpp", 22 "bus_extension_usb_test/src/usb_driver_info_test.cpp", 23 "bus_extension_usb_test/src/usb_impl_mock.cpp", 24 "bus_extension_usb_test/src/usb_subscriber_test.cpp", 25 ] 26 include_dirs = [ 27 "//third_party/jsoncpp/include/json", 28 "bus_extension_usb_test/include", 29 "${usb_bus_extension_include_path}", 30 ] 31 deps = [ 32 "${ext_mgr_path}/services/native/driver_extension_manager/src/bus_extension/usb:driver_extension_usb_bus", 33 "${ext_mgr_path}/services/native/driver_extension_manager/src/drivers_pkg_manager:drivers_pkg_manager", 34 "//third_party/googletest:gmock_main", 35 "//third_party/googletest:gtest_main", 36 "//third_party/jsoncpp:jsoncpp", 37 ] 38 external_deps = [ 39 "bundle_framework:appexecfwk_base", 40 "c_utils:utils", 41 "drivers_interface_usb:libusb_proxy_1.0", 42 "hilog:libhilog", 43 "samgr:samgr_proxy", 44 ] 45 configs = [ "${utils_path}:utils_config" ] 46} 47ohos_unittest("driver_extension_controller_test") { 48 module_out_path = "${module_output_path}" 49 sources = [ 50 "driver_extension_controller_test/src/driver_extension_controller_test.cpp", 51 ] 52 deps = [ 53 "${ext_mgr_path}/services/native/driver_extension_manager/src/driver_controller:driver_extension_controller", 54 "//third_party/googletest:gmock_main", 55 "//third_party/googletest:gtest_main", 56 ] 57 external_deps = [ 58 "ability_runtime:ability_manager", 59 "access_token:libaccesstoken_sdk", 60 "access_token:libnativetoken", 61 "access_token:libtoken_setproc", 62 "c_utils:utils", 63 "hilog:libhilog", 64 "samgr:samgr_proxy", 65 ] 66 configs = [ "${utils_path}:utils_config" ] 67} 68 69ohos_unittest("drivers_pkg_manager_test") { 70 module_out_path = "${module_output_path}" 71 sources = [ 72 "drivers_pkg_manager_test/src/driver_pkg_manager_test.cpp", 73 "drivers_pkg_manager_test/src/drv_bundle_callback_test.cpp", 74 ] 75 include_dirs = [ 76 "${ext_mgr_path}/services/native/driver_extension_manager/include/drivers_pkg_manager", 77 "${usb_bus_extension_include_path}", 78 ] 79 deps = [ 80 "${ext_mgr_path}/services/native/driver_extension_manager/src/drivers_pkg_manager:drivers_pkg_manager", 81 "//third_party/googletest:gmock_main", 82 "//third_party/googletest:gtest_main", 83 ] 84 external_deps = [ 85 "ability_base:want", 86 "bundle_framework:appexecfwk_base", 87 "bundle_framework:appexecfwk_core", 88 "c_utils:utils", 89 "common_event_service:cesfwk_core", 90 "common_event_service:cesfwk_innerkits", 91 "drivers_interface_usb:libusb_proxy_1.0", 92 "hilog:libhilog", 93 "ipc:ipc_core", 94 "os_account:os_account_innerkits", 95 "samgr:samgr_proxy", 96 ] 97 configs = [ "${utils_path}:utils_config" ] 98} 99 100ohos_unittest("driver_extension_manager_client_test") { 101 module_out_path = "${module_output_path}" 102 103 sources = [ "driver_extension_manager_client_test/driver_extension_manager_client_test.cpp" ] 104 105 include_dirs = [ "${ext_mgr_path}/services/zidl/include" ] 106 107 deps = [ "${ext_mgr_path}/interfaces/innerkits:driver_ext_mgr_client" ] 108 109 external_deps = [ 110 "c_utils:utils", 111 "hilog:libhilog", 112 "ipc:ipc_single", 113 "samgr:samgr_proxy", 114 ] 115} 116 117group("external_device_manager_ut") { 118 testonly = true 119 deps = [ 120 ":bus_extension_usb_test", 121 ":driver_extension_controller_test", 122 ":driver_extension_manager_client_test", 123 ":drivers_pkg_manager_test", 124 "device_manager_js_test:DeviceManagerJsTest", 125 "device_manager_test:device_manager_test", 126 ] 127} 128