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 "samgr:samgr_proxy", 47 ] 48 49 subsystem_name = "resourceschedule" 50 part_name = "${standby_service_part_name}" 51} 52 53ohos_unittest("mock_standby_client_unit_test") { 54 module_out_path = module_output_path 55 cflags_cc = [ 56 "-Dprivate=public", 57 "-Dprotected=public", 58 ] 59 60 include_dirs = [ 61 "${standby_innerkits_path}/include", 62 "${standby_innerkits_path}/test/unittest/mock/include", 63 ] 64 65 sources = [ 66 "${standby_innerkits_path}/test/unittest/mock/mock_sa_service.cpp", 67 "${standby_innerkits_path}/test/unittest/mock_standby_client_unit_test.cpp", 68 ] 69 70 deps = [ 71 "${standby_innerkits_path}:standby_innerkits", 72 "${standby_service_frameworks_path}:standby_fwk", 73 ] 74 75 external_deps = [ 76 "ability_runtime:abilitykit_native", 77 "ability_runtime:wantagent_innerkits", 78 "c_utils:utils", 79 "hilog:libhilog", 80 "ipc:ipc_single", 81 "samgr:samgr_proxy", 82 ] 83 84 subsystem_name = "resourceschedule" 85 part_name = "${standby_service_part_name}" 86} 87 88group("unittest") { 89 testonly = true 90 91 deps = [ 92 ":mock_standby_client_unit_test", 93 ":standby_client_unit_test", 94 ] 95} 96