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") 15 16process_group_module_output_path = 17 "resource_schedule_service/process_group_test" 18 19config("process_group_module_private_config") { 20 visibility = [ ":*" ] 21 22 include_dirs = [ "../../framework/process_group/include" ] 23} 24 25ohos_unittest("ProcessGroupSubTest") { 26 module_out_path = process_group_module_output_path 27 28 include_dirs = [ 29 "../../framework/process_group/include", 30 "../../framework/sched_controller/include", 31 ] 32 33 sources = [ 34 "cgroup_sched_test.cpp", 35 "process_group_sub_test.cpp", 36 ] 37 38 cflags = [ 39 "-Dprivate=public", 40 "-Dprotected=public", 41 ] 42 43 if (target_cpu == "arm") { 44 cflags += [ "-DBINDER_IPC_32BIT" ] 45 } 46 47 configs = [ ":process_group_module_private_config" ] 48 49 deps = [ 50 "../../framework:cgroup_sched", 51 "../../framework/process_group:libprocess_group", 52 "//third_party/googletest:gtest_main", 53 ] 54 55 external_deps = [ 56 "ability_runtime:app_manager", 57 "c_utils:utils", 58 "ffrt:libffrt", 59 "hilog:libhilog", 60 "samgr:samgr_proxy", 61 "window_manager:libwm", 62 ] 63} 64 65ohos_unittest("ResschedUtilsTest") { 66 module_out_path = process_group_module_output_path 67 68 include_dirs = [ 69 "../../framework/utils/include", 70 "../../framework/sched_controller/include", 71 ] 72 73 sources = [ "ressched_utils_test.cpp" ] 74 75 cflags = [] 76 77 if (target_cpu == "arm") { 78 cflags += [ "-DBINDER_IPC_32BIT" ] 79 } 80 81 configs = [ ":process_group_module_private_config" ] 82 83 deps = [ 84 "//third_party/googletest:gtest_main", 85 "//third_party/json:nlohmann_json_static", 86 ] 87 88 external_deps = [ 89 "ability_runtime:app_manager", 90 "c_utils:utils", 91 "hilog:libhilog", 92 "resource_schedule_service:cgroup_sched", 93 ] 94} 95 96ohos_executable("process_proup_test") { 97 module_install_dir = "bin/process_group" 98 include_dirs = [] 99 100 sources = [ "./cgroup_setting_test.cpp" ] 101 102 cflags = [] 103 if (target_cpu == "arm") { 104 cflags += [ "-DBINDER_IPC_32BIT" ] 105 } 106 107 deps = [ "../../framework/process_group:libprocess_group" ] 108 109 install_enable = true 110 part_name = "resource_schedule_service" 111 subsystem_name = "resourceschedule" 112} 113 114group("unittest") { 115 testonly = true 116 deps = [ 117 ":ProcessGroupSubTest", 118 ":ResschedUtilsTest", 119 ] 120} 121