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")
15import("../screenlock.gni")
16
17module_output_path = "screenlock/screenlock_service"
18
19ohos_unittest("ScreenLockServiceTest") {
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25  module_out_path = module_output_path
26  include_dirs = [
27    "unittest",
28    "${screenlock_mgr_path}/frameworks/native/include",
29    "${screenlock_mgr_path}/services/include",
30    "${screenlock_mgr_path}/utils/include",
31  ]
32
33  sources = [
34    "unittest/screenlock_callback_test.cpp",
35    "unittest/screenlock_client_test.cpp",
36    "unittest/screenlock_notify_test_instance.cpp",
37    "unittest/screenlock_preferences_test.cpp",
38    "unittest/screenlock_service_test.cpp",
39    "unittest/screenlock_strongauth_test.cpp",
40  ]
41
42  external_deps = [
43    "ability_base:base",
44    "ability_base:want",
45    "ability_runtime:ability_manager",
46    "ability_runtime:app_manager",
47    "access_token:libaccesstoken_sdk",
48    "access_token:libtoken_setproc",
49    "access_token:libtokenid_sdk",
50    "c_utils:utils",
51    "common_event_service:cesfwk_innerkits",
52    "eventhandler:libeventhandler",
53    "hilog:libhilog",
54    "hitrace:hitrace_meter",
55    "ipc:ipc_single",
56    "os_account:os_account_innerkits",
57    "samgr:samgr_proxy",
58    "time_service:time_client",
59    "user_auth_framework:userauth_client",
60    "window_manager:libdm",
61  ]
62
63  deps = [
64    "${screenlock_mgr_path}/interfaces/inner_api:screenlock_client_static",
65    "${screenlock_mgr_path}/services:screenlock_server_static",
66    "${screenlock_mgr_path}/utils:screenlock_utils",
67    "//third_party/googletest:gtest_main",
68  ]
69
70  defines = []
71}
72
73group("unittest") {
74  testonly = true
75
76  deps = []
77
78  deps += [ ":ScreenLockServiceTest" ]
79}
80