1# Copyright (c) 2025 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("./../../../usbmgr.gni") 16 17module_output_path = "${usb_manager_part_name}/serial_unittest" 18 19config("module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ 23 "include", 24 "${usb_manager_path}/services/native/include", 25 "${usb_manager_path}/interfaces/kits/js/napi/include", 26 ] 27} 28 29ohos_unittest("test_serial") { 30 module_out_path = module_output_path 31 sources = [ 32 "src/grant_sys_permission.cpp", 33 "src/serial_test.cpp", 34 ] 35 36 configs = [ 37 "${utils_path}:utils_config", 38 ":module_private_config", 39 ] 40 41 deps = [ 42 "${usb_manager_path}/interfaces/innerkits:usbsrv_client", 43 "${usb_manager_path}/services:usbservice", 44 ] 45 46 external_deps = [ 47 "ability_base:want", 48 "access_token:libaccesstoken_sdk", 49 "access_token:libnativetoken", 50 "access_token:libtoken_setproc", 51 "bundle_framework:appexecfwk_base", 52 "bundle_framework:appexecfwk_core", 53 "cJSON:cjson", 54 "c_utils:utils", 55 "common_event_service:cesfwk_innerkits", 56 "eventhandler:libeventhandler", 57 "googletest:gtest_main", 58 "hilog:libhilog", 59 "ipc:ipc_core", 60 "napi:ace_napi", 61 "relational_store:native_dataability", 62 "relational_store:native_rdb", 63 "safwk:system_ability_fwk", 64 "samgr:samgr_proxy", 65 ] 66} 67 68ohos_unittest("test_serialright") { 69 module_out_path = module_output_path 70 sources = [ 71 "src/grant_sys_permission.cpp", 72 "src/serial_right_test.cpp", 73 ] 74 75 configs = [ 76 "${utils_path}:utils_config", 77 ":module_private_config", 78 ] 79 80 deps = [ 81 "${usb_manager_path}/interfaces/innerkits:usbsrv_client", 82 "${usb_manager_path}/services:usbservice", 83 ] 84 85 external_deps = [ 86 "ability_base:want", 87 "access_token:libaccesstoken_sdk", 88 "access_token:libnativetoken", 89 "access_token:libtoken_setproc", 90 "bundle_framework:appexecfwk_base", 91 "bundle_framework:appexecfwk_core", 92 "cJSON:cjson", 93 "c_utils:utils", 94 "common_event_service:cesfwk_innerkits", 95 "eventhandler:libeventhandler", 96 "googletest:gtest_main", 97 "hilog:libhilog", 98 "ipc:ipc_core", 99 "napi:ace_napi", 100 "relational_store:native_dataability", 101 "relational_store:native_rdb", 102 "safwk:system_ability_fwk", 103 "samgr:samgr_proxy", 104 ] 105} 106 107group("serial_unittest") { 108 testonly = true 109 deps = [ 110 ":test_serial", 111 ":test_serialright", 112 ] 113} 114