1# Copyright (c) 2022 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( 16 "//foundation/resourceschedule/resource_schedule_service/ressched/ressched.gni") 17 18group("unittest") { 19 testonly = true 20 deps = [ 21 ":resschedfwk_test", 22 ":resschedservice_test" 23 ] 24} 25 26config("ut_resschedfwk_config") { 27 include_dirs = [ 28 "include", 29 "//foundation/resourceschedule/resource_schedule_service/soc_perf/include", 30 "//foundation/resourceschedule/resource_schedule_service/soc_perf/include/client", 31 ] 32} 33 34config("ut_resschedservice_config") { 35 include_dirs = [ "resschedservice/include" ] 36} 37 38module_output_path = "resource_schedule_service/ressched" 39 40private_external_deps = [ 41 "eventhandler:libeventhandler", 42 "ipc:ipc_core", 43] 44 45private_deps = [ 46 "${ressched_interfaces}/innerkits/ressched_client:ressched_client", 47 "${ressched_plugins}/socperf_plugin:socperf_plugin", 48 "${ressched_services}:resschedsvc", 49 "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog", 50 "//commonlibrary/c_utils/base:utils", 51 "//third_party/googletest:gtest_main", 52] 53 54ohos_unittest("resschedservice_test") { 55 module_out_path = module_output_path 56 57 sources = [ 58 "src/res_sched_service_test.cpp", 59 ] 60 61 configs = [ 62 ":ut_resschedservice_config", 63 "${ressched_services}:ressched_config", 64 ] 65 66 deps = [ 67 "//third_party/googletest:gtest_main", 68 "${ressched_services}:resschedsvc", 69 ] 70 71 external_deps = [ 72 "ipc:ipc_core", 73 "c_utils:utils", 74 ] 75} 76 77ohos_unittest("resschedfwk_test") { 78 module_out_path = module_output_path 79 resource_config_file = "//foundation/resourceschedule/resource_schedule_service/ressched/test/resource/resschedfwk/ohos_test.xml" 80 sources = [ 81 "src/config_reader_test.cpp", 82 "src/plugin_mgr_test.cpp", 83 "src/plugin_switch_test.cpp", 84 "src/res_sched_mgr_test.cpp", 85 ] 86 configs = [ 87 ":ut_resschedfwk_config", 88 "${ressched_interfaces}/innerkits/ressched_client:client_public_config", 89 "${ressched_services}:ressched_config", 90 "${ressched_plugins}/socperf_plugin:socperf_plugin_config", 91 ] 92 93 deps = private_deps 94 95 external_deps = private_external_deps 96} 97