• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2023 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("../../ressched.gni")
16
17group("unittest") {
18  testonly = true
19  deps = [
20    ":resschedclient_test",
21    ":resschedfwk_test",
22    ":resschedservice_test",
23  ]
24}
25
26module_output_path = "resource_schedule_service/ressched"
27
28ohos_unittest("resschedservice_test") {
29  module_out_path = module_output_path
30  include_dirs = [
31    "${ressched_common}/include",
32    "${ressched_interfaces}/innerkits/ressched_client/include",
33  ]
34
35  sources = [ "src/res_sched_service_test.cpp" ]
36
37  deps = [
38    "${ressched_services}:resschedsvc_static",
39    "//third_party/googletest:gtest_main",
40  ]
41
42  external_deps = [
43    "c_utils:utils",
44    "ipc:ipc_single",
45  ]
46}
47
48ohos_unittest("resschedclient_test") {
49  module_out_path = module_output_path
50  include_dirs = [
51    "${ressched_common}/include",
52    "${ressched_interfaces}/innerkits/ressched_client/include",
53  ]
54
55  sources = [ "src/res_sched_client_test.cpp" ]
56
57  deps = [
58    "${ressched_services}:resschedsvc_static",
59    "//third_party/googletest:gtest_main",
60  ]
61
62  external_deps = [
63    "access_token:libaccesstoken_sdk",
64    "access_token:libnativetoken",
65    "access_token:libtoken_setproc",
66    "c_utils:utils",
67    "ipc:ipc_single",
68  ]
69}
70
71ohos_unittest("resschedfwk_test") {
72  module_out_path = module_output_path
73  resource_config_file = "${ressched_test}/resource/resschedfwk/ohos_test.xml"
74  include_dirs = [
75    "include",
76    "${ressched_common}/include",
77    "${ressched_interfaces}/innerkits/ressched_client/include",
78    "${ressched_plugins}/socperf_plugin/include",
79  ]
80
81  sources = [
82    "src/config_reader_test.cpp",
83    "src/plugin_mgr_test.cpp",
84    "src/plugin_switch_test.cpp",
85    "src/res_sched_mgr_test.cpp",
86  ]
87
88  deps = [
89    "${ressched_plugins}/socperf_plugin:socperf_plugin",
90    "${ressched_services}:resschedsvc_static",
91    "//third_party/googletest:gtest_main",
92  ]
93
94  external_deps = [
95    "c_utils:utils",
96    "eventhandler:libeventhandler",
97    "hilog:libhilog",
98    "ipc:ipc_single",
99  ]
100
101  defines = []
102
103  if (ressched_with_resourceschedule_soc_perf_enable) {
104    external_deps += [ "soc_perf:socperf_client" ]
105    defines += [ "RESSCHED_RESOURCESCHEDULE_SOC_PERF_ENABLE" ]
106  }
107}
108