# 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("../../../cgroup_sched/cgroup_sched.gni") import("../../ressched.gni") group("unittest") { testonly = true deps = [ ":resschedfwk_test", ":resschedservice_test", ] } module_output_path = "resource_schedule_service/ressched" ohos_unittest("resschedservice_test") { module_out_path = module_output_path cflags = [ "-Dprivate=public", "-Dprotected=public", ] include_dirs = [ "./include", "${cgroup_sched_framework}/sched_controller/include", "${cgroup_sched_framework}/process_group/include", "${cgroup_sched_framework}/utils/include", "${ressched_common}/include", "${ressched_interfaces}/innerkits/ressched_client/include", ] sources = [ "${ressched_common}/src/oobe_datashare_utils.cpp", "${ressched_common}/src/oobe_manager.cpp", "src/event_listener_mgr_test.cpp", "src/oobe_datashare_utils_test.cpp", "src/oobe_mgr_test.cpp", "src/res_sched_client_test.cpp", "src/res_sched_service_mock_test.cpp", "src/res_sched_service_test.cpp", "src/scene_recognize_test.cpp", ] deps = [ "${cgroup_sched_framework}:cgroup_sched", "${ressched_services}:resschedsvc_static", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:zuri", "ability_runtime:ability_manager", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "c_utils:utils", "data_share:datashare_consumer", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", "window_manager:libdm", ] sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" } ohos_unittest("resschedfwk_test") { module_out_path = module_output_path resource_config_file = "${ressched_test}/resource/resschedfwk/ohos_test.xml" cflags = [ "-Dprivate=public", "-Dprotected=public", ] include_dirs = [ "include", "${ressched_common}/include", "${ressched_interfaces}/innerkits/ressched_client/include", "${ressched_plugins}/socperf_plugin/include", ] sources = [ "src/config_reader_test.cpp", "src/notifier_mgr_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 = [ "ability_runtime:ability_manager", "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" ] } sanitize = { cfi = true cfi_cross_dso = true debug = false } branch_protector_ret = "pac_ret" }