1# Copyright (c) 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("../../../device_status.gni")
16
17module_output_path = "${device_status_part_name}/unit_out"
18
19ohos_unittest("InteractionManagerTest") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25
26  branch_protector_ret = "pac_ret"
27
28  module_out_path = module_output_path
29  include_dirs = [
30    "${device_status_interfaces_path}/innerkits/interaction/include",
31    "${device_status_utils_path}",
32    "${device_status_utils_path}/include",
33  ]
34
35  defines = []
36
37  sources = [ "src/interaction_manager_test.cpp" ]
38
39  configs = []
40
41  deps = [ "${device_status_interfaces_path}/innerkits:devicestatus_client" ]
42  external_deps = [
43    "access_token:libaccesstoken_sdk",
44    "access_token:libnativetoken_shared",
45    "access_token:libtokensetproc_shared",
46    "c_utils:utils",
47    "graphic_2d:librender_service_client",
48    "hilog:libhilog",
49    "image_framework:image_native",
50    "input:libmmi-client",
51    "window_manager:libdm",
52  ]
53}
54
55ohos_unittest("InteractionDragDrawingTest") {
56  sanitize = {
57    cfi = true
58    cfi_cross_dso = true
59    debug = false
60  }
61
62  module_out_path = module_output_path
63  include_dirs = [
64    "${device_status_interfaces_path}/innerkits/interaction/include",
65    "${device_status_utils_path}",
66    "${device_status_utils_path}/include",
67  ]
68
69  sources = [ "src/interaction_drag_drawing_test.cpp" ]
70
71  deps = [ "${device_status_interfaces_path}/innerkits:devicestatus_client" ]
72  external_deps = [
73    "c_utils:utils",
74    "graphic_2d:librender_service_client",
75    "hilog:libhilog",
76    "image_framework:image_native",
77    "input:libmmi-client",
78  ]
79}
80
81ohos_unittest("InteractionMouseLocationTest") {
82  sanitize = {
83    cfi = true
84    cfi_cross_dso = true
85    debug = false
86  }
87
88  branch_protector_ret = "pac_ret"
89  module_out_path = module_output_path
90  include_dirs = [
91    "${device_status_interfaces_path}/innerkits/interaction/include",
92    "${device_status_utils_path}",
93    "${device_status_utils_path}/include",
94  ]
95
96  sources = [
97    "${device_status_utils_path}/src/utility.cpp",
98    "src/mouse_location_listener_test.cpp",
99  ]
100
101  deps = [ "${device_status_interfaces_path}/innerkits:devicestatus_client" ]
102  external_deps = [
103    "access_token:libaccesstoken_sdk",
104    "access_token:libnativetoken_shared",
105    "access_token:libtokensetproc_shared",
106    "c_utils:utils",
107    "device_manager:devicemanagersdk",
108    "graphic_2d:librender_service_client",
109    "hilog:libhilog",
110    "image_framework:image_native",
111    "input:libmmi-client",
112    "window_manager:libdm",
113  ]
114}
115
116group("unittest") {
117  testonly = true
118  deps = [
119    ":InteractionDragDrawingTest",
120    ":InteractionMouseLocationTest",
121  ]
122  if (build_variant == "root" && root_perf_main != "root_main") {
123    deps += [ ":InteractionManagerTest" ]
124  }
125}
126