# Copyright (C) 2022 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/ohos.gni") import("//build/ohos_var.gni") import("//build/test.gni") module_output_path = "qosmanagertest/" config("test_config") { include_dirs = [ "../include/", "../common/include", "../frameworks/concurrent_task_client/include", "../interfaces/inner_api/", "../interfaces/kits/", "../services/include/", ] cflags = [ "-Wno-unused-variable", "-Wno-unused-function", ] if (target_cpu == "arm64") { defines = [ "ARM64_TEST" ] } } ohos_unittest("concurrent_svc_intf_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/concurrent_svc_intf_test.cpp" ] deps = [ "../frameworks/concurrent_task_client:concurrent_task_client" ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", "ipc:ipc_single", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("concurrent_task_client_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/concurrent_task_client_test.cpp" ] deps = [ "../frameworks/concurrent_task_client:concurrent_task_client" ] external_deps = [ "frame_aware_sched:rtg_interface", "hilog:libhilog", "ipc:ipc_single", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("concurrent_task_controller_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/concurrent_task_controller_test.cpp" ] deps = [ "../etc/param:ffrt_etc", "../frameworks/concurrent_task_client:concurrent_task_client", "../services:concurrentsvc", ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", "init:libbegetutil", "jsoncpp:jsoncpp", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("concurrent_task_service_ability_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/concurrent_task_service_ability_test.cpp" ] deps = [ "../frameworks/concurrent_task_client:concurrent_task_client", "../services:concurrentsvc", ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("qos_interface_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/qos_interface_test.cpp" ] deps = [ "../frameworks/concurrent_task_client:concurrent_task_client", "../services:concurrentsvc", ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("qos_policy_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/qos_policy_test.cpp" ] deps = [ "../frameworks/concurrent_task_client:concurrent_task_client", "../services:concurrentsvc", ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("concurrent_task_service_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/concurrent_task_service_test.cpp" ] deps = [ "../frameworks/concurrent_task_client:concurrent_task_client", "../services:concurrentsvc", ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("qos_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/qos_test.cpp" ] deps = [ "../qos:qos" ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("qos_ndk_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/qos_ndk_test.cpp" ] deps = [ "../frameworks/native:qos_ndk", "../qos:qos", ] external_deps = [ "c_utils:utils", "frame_aware_sched:rtg_interface", "hilog:libhilog", ] if (is_standard_system) { external_deps += [ "googletest:gtest_main" ] } subsystem_name = "resourceschedule" part_name = "qos_manager" } ohos_unittest("config_reader_test") { module_out_path = module_output_path configs = [ ":test_config" ] sources = [ "unittest/phone/config_reader_test.cpp" ] deps = [ "../services:concurrentsvc" ] external_deps = [ "c_utils:utils", "config_policy:configpolicy_util", "frame_aware_sched:rtg_interface", "hilog:libhilog", "init:libbegetutil", "libxml2:libxml2", ] subsystem_name = "resourceschedule" part_name = "qos_manager" } group("concurrent_unittest") { testonly = true deps = [] if (!is_asan) { deps += [ ":concurrent_svc_intf_test", ":concurrent_task_client_test", ":concurrent_task_controller_test", ":concurrent_task_service_ability_test", ":concurrent_task_service_test", ":config_reader_test", ":qos_interface_test", ":qos_ndk_test", ":qos_policy_test", ":qos_test", ] } }