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/ohos.gni")
15import("//build/ohos_var.gni")
16import("//build/test.gni")
17import("../frameaware.gni")
18
19module_output_path = "frameawareschedtest/"
20
21frame_aware_sched_configs =
22    [ "../interfaces/innerkits/frameintf:frame_msg_intf_config" ]
23
24frame_aware_sched_deps = [ "../interfaces/innerkits/frameintf:frame_msg_intf" ]
25
26ohos_unittest("frame_ui_intf_test") {
27  module_out_path = module_output_path
28
29  sources = [ "unittest/phone/frame_ui_intf_test.cpp" ]
30
31  configs = frame_aware_sched_configs
32
33  deps = [ "../interfaces/innerkits/frameintf:frame_ui_intf" ]
34
35  if (is_standard_system) {
36    external_deps = [ "googletest:gtest_main" ]
37  }
38  part_name = "frame_aware_sched"
39  subsystem_name = "resourceschedule"
40}
41
42ohos_unittest("frame_msg_intf_test") {
43  module_out_path = module_output_path
44
45  sources = [ "unittest/phone/frame_msg_intf_test.cpp" ]
46
47  configs = frame_aware_sched_configs
48
49  deps = frame_aware_sched_deps
50
51  external_deps = [
52    "c_utils:utils",
53    "eventhandler:libeventhandler",
54    "ffrt:libffrt",
55  ]
56
57  if (is_standard_system) {
58    external_deps += [ "googletest:gtest_main" ]
59  }
60
61  part_name = "frame_aware_sched"
62  subsystem_name = "resourceschedule"
63}
64
65ohos_unittest("rtg_interface_test") {
66  module_out_path = module_output_path
67
68  sources = [ "unittest/phone/rtg_interface_test.cpp" ]
69
70  include_dirs = [
71    "../common/include",
72    "../frameworks/core/frame_aware_policy/include",
73  ]
74
75  deps = frame_aware_sched_deps
76
77  if (is_standard_system) {
78    external_deps = [ "googletest:gtest_main" ]
79  }
80
81  part_name = "frame_aware_sched"
82  subsystem_name = "resourceschedule"
83}
84
85ohos_unittest("intellisense_server_test") {
86  module_out_path = module_output_path
87
88  sources = [ "unittest/phone/intellisense_server_test.cpp" ]
89
90  include_dirs = [
91    "../common/include",
92    "../frameworks/core/frame_aware_policy/include",
93  ]
94
95  deps = frame_aware_sched_deps
96
97  if (is_standard_system) {
98    external_deps = [ "googletest:gtest_main" ]
99  }
100
101  part_name = "frame_aware_sched"
102  subsystem_name = "resourceschedule"
103}
104
105group("frame_unittest") {
106  testonly = true
107  deps = []
108  if (!is_asan) {
109    deps += [
110      ":frame_msg_intf_test",
111      ":intellisense_server_test",
112      ":rtg_interface_test",
113    ]
114  }
115}
116