# Copyright (c) 2022-2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/test.gni") import("../../ressched.gni") group("unittest") { testonly = true deps = [ ":comp_sched_plugin_test", ":resschedclient_test", ":resschedfwk_test", ":resschedservice_test", ] } module_output_path = "resource_schedule_service/ressched" ohos_unittest("comp_sched_plugin_test") { module_out_path = module_output_path include_dirs = [ "${ressched_plugins}/component_sched_plugin/include", "${ressched_common}/include", "${ressched_interfaces}/innerkits/ressched_client/include", "${ressched_services}/resschedmgr/resschedfwk/include", "${ressched_services}/resschedmgr/pluginbase/include", ] sources = [ "src/component_sched_plugin_test.cpp" ] deps = [ "${ressched_plugins}/component_sched_plugin:component_sched_plugin", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "resource_schedule_service:resschedsvc", ] } ohos_unittest("resschedservice_test") { module_out_path = module_output_path include_dirs = [ "${ressched_common}/include", "${ressched_interfaces}/innerkits/ressched_client/include", ] sources = [ "src/res_sched_service_test.cpp" ] deps = [ "${ressched_services}:resschedsvc_static", "//third_party/googletest:gtest_main", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "ffrt:libffrt", "ipc:ipc_single", ] sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" } ohos_unittest("resschedclient_test") { module_out_path = module_output_path include_dirs = [ "${ressched_common}/include", "${ressched_interfaces}/innerkits/ressched_client/include", ] sources = [ "src/res_sched_client_test.cpp" ] deps = [ "${ressched_services}:resschedsvc_static", "//third_party/googletest:gtest_main", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "ffrt:libffrt", "ipc:ipc_single", ] } ohos_unittest("resschedfwk_test") { module_out_path = module_output_path resource_config_file = "${ressched_test}/resource/resschedfwk/ohos_test.xml" include_dirs = [ "include", "${ressched_common}/include", "${ressched_interfaces}/innerkits/ressched_client/include", "${ressched_plugins}/socperf_plugin/include", ] sources = [ "src/config_reader_test.cpp", "src/plugin_mgr_test.cpp", "src/plugin_switch_test.cpp", "src/res_sched_mgr_test.cpp", ] deps = [ "${ressched_plugins}/socperf_plugin:socperf_plugin", "${ressched_services}:resschedsvc_static", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", ] defines = [] if (ressched_with_resourceschedule_soc_perf_enable) { external_deps += [ "soc_perf:socperf_client" ] defines += [ "RESSCHED_RESOURCESCHEDULE_SOC_PERF_ENABLE" ] } }