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")
15
16ohos_unittest("face_auth_service_test") {
17  sanitize = {
18    integer_overflow = true
19    ubsan = true
20    boundary_sanitize = true
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24    blocklist = "../../cfi_blocklist.txt"
25  }
26  branch_protector_ret = "pac_ret"
27  module_out_path = "useriam/face_auth"
28
29  sources = [
30    "face_auth_all_in_one_executor_hdi_unit_test.cpp",
31    "face_auth_driver_hdi_unit_test.cpp",
32    "face_auth_executor_callback_hdi_unit_test.cpp",
33    "face_auth_service_test.cpp",
34    "sa_command_manager_unit_test.cpp",
35    "state_machine_test.cpp",
36  ]
37
38  include_dirs = [ "mock" ]
39
40  deps = [
41    "../../frameworks/ipc:faceauth_framework_stub",
42    "../../services:faceauthservice_source_set",
43    "../../services_ex:faceauthservice_ex_source_set",
44    "//third_party/googletest:gmock_main",
45    "//third_party/googletest:gtest_main",
46  ]
47
48  external_deps = [
49    "access_token:libaccesstoken_sdk",
50    "access_token:libnativetoken",
51    "access_token:libtoken_setproc",
52    "access_token:libtokenid_sdk",
53    "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
54    "drivers_interface_face_auth:libface_auth_proxy_2.0",
55    "graphic_surface:surface",
56    "hilog:libhilog",
57    "user_auth_framework:userauth_executors",
58  ]
59
60  remove_configs = [ "//build/config/compiler:no_exceptions" ]
61
62  subsystem_name = "useriam"
63  part_name = "face_auth"
64}
65
66ohos_unittest("face_auth_screen_brightness_test") {
67  sanitize = {
68    integer_overflow = true
69    ubsan = true
70    boundary_sanitize = true
71    cfi = true
72    cfi_cross_dso = true
73    debug = false
74    blocklist = "../../cfi_blocklist.txt"
75  }
76  branch_protector_ret = "pac_ret"
77  module_out_path = "useriam/face_auth"
78
79  include_dirs = [ "mock" ]
80
81  sources = [ "face_auth_screen_brightness_test.cpp" ]
82
83  deps = [
84    "../../services:faceauthservice_source_set",
85    "//third_party/googletest:gmock_main",
86    "//third_party/googletest:gtest_main",
87  ]
88
89  external_deps = [
90    "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
91    "drivers_interface_face_auth:libface_auth_proxy_2.0",
92    "graphic_surface:surface",
93    "hilog:libhilog",
94    "user_auth_framework:userauth_executors",
95  ]
96
97  remove_configs = [ "//build/config/compiler:no_exceptions" ]
98
99  subsystem_name = "useriam"
100  part_name = "face_auth"
101}
102
103ohos_unittest("face_auth_perm_test") {
104  sanitize = {
105    integer_overflow = true
106    ubsan = true
107    boundary_sanitize = true
108    cfi = true
109    cfi_cross_dso = true
110    debug = false
111    blocklist = "../../cfi_blocklist.txt"
112  }
113  branch_protector_ret = "pac_ret"
114  module_out_path = "useriam/face_auth"
115
116  sources = [ "face_auth_service_perm_test.cpp" ]
117
118  include_dirs = [ "mock" ]
119
120  deps = [
121    "../../frameworks/ipc:faceauth_framework_stub",
122    "../../services:faceauthservice_source_set",
123    "//third_party/googletest:gmock_main",
124    "//third_party/googletest:gtest_main",
125  ]
126
127  external_deps = [
128    "access_token:libaccesstoken_sdk",
129    "access_token:libnativetoken",
130    "drivers_interface_camera:libbuffer_producer_sequenceable_1.0",
131    "drivers_interface_face_auth:libface_auth_proxy_2.0",
132    "graphic_surface:surface",
133    "hilog:libhilog",
134    "user_auth_framework:userauth_executors",
135  ]
136
137  remove_configs = [ "//build/config/compiler:no_exceptions" ]
138
139  subsystem_name = "useriam"
140  part_name = "face_auth"
141}
142
143group("faceauth_unittest") {
144  testonly = true
145  deps = [
146    ":face_auth_perm_test",
147    ":face_auth_screen_brightness_test",
148    ":face_auth_service_test",
149  ]
150}
151