1# Copyright (c) 2023-2024 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/ohos.gni") 15import("//build/test.gni") 16import("//foundation/resourceschedule/device_standby/standby_service.gni") 17 18module_output_path = "${standby_service_part_name}/unittest" 19 20ohos_unittest("standby_client_unit_test") { 21 module_out_path = module_output_path 22 cflags_cc = [ 23 "-Dprivate=public", 24 "-Dprotected=public", 25 ] 26 27 include_dirs = [ 28 "${standby_innerkits_path}/include", 29 "${standby_innerkits_path}/test/unittest/mock/include", 30 ] 31 32 sources = 33 [ "${standby_innerkits_path}/test/unittest/standby_client_unit_test.cpp" ] 34 35 deps = [ 36 "${standby_innerkits_path}:standby_innerkits", 37 "${standby_service_frameworks_path}:standby_fwk", 38 ] 39 40 external_deps = [ 41 "ability_runtime:abilitykit_native", 42 "ability_runtime:wantagent_innerkits", 43 "c_utils:utils", 44 "hilog:libhilog", 45 "ipc:ipc_single", 46 "resource_schedule_service:resschedsvc", 47 "samgr:samgr_proxy", 48 ] 49 50 subsystem_name = "resourceschedule" 51 part_name = "${standby_service_part_name}" 52} 53 54ohos_unittest("mock_standby_client_unit_test") { 55 module_out_path = module_output_path 56 cflags_cc = [ 57 "-Dprivate=public", 58 "-Dprotected=public", 59 ] 60 61 include_dirs = [ 62 "${standby_innerkits_path}/include", 63 "${standby_innerkits_path}/test/unittest/mock/include", 64 ] 65 66 sources = [ 67 "${standby_innerkits_path}/test/unittest/mock/mock_sa_service.cpp", 68 "${standby_innerkits_path}/test/unittest/mock_standby_client_unit_test.cpp", 69 ] 70 71 deps = [ 72 "${standby_innerkits_path}:standby_innerkits", 73 "${standby_service_frameworks_path}:standby_fwk", 74 ] 75 76 external_deps = [ 77 "ability_runtime:abilitykit_native", 78 "ability_runtime:wantagent_innerkits", 79 "c_utils:utils", 80 "hilog:libhilog", 81 "ipc:ipc_single", 82 "samgr:samgr_proxy", 83 ] 84 85 subsystem_name = "resourceschedule" 86 part_name = "${standby_service_part_name}" 87} 88 89group("unittest") { 90 testonly = true 91 92 deps = [ 93 ":mock_standby_client_unit_test", 94 ":standby_client_unit_test", 95 ] 96} 97