• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2024 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("../../../../access_token.gni")
16
17ohos_unittest("libdatabase_test") {
18  subsystem_name = "accesscontrol"
19  module_out_path = module_output_path_unittest_accesstoken
20  sanitize = {
21    cfi = true
22    cfi_cross_dso = true
23    debug = false
24  }
25  branch_protector_ret = "pac_ret"
26
27  include_dirs = [
28    "${access_token_path}/frameworks/accesstoken/include",
29    "${access_token_path}/frameworks/common/include",
30    "${access_token_path}/interfaces/innerkits/accesstoken/include",
31    "${access_token_path}/services/common/database/include",
32    "${access_token_path}/services/common/utils/include",
33    "${access_token_path}/services/accesstokenmanager/main/cpp/include/callback",
34    "${access_token_path}/services/accesstokenmanager/main/cpp/include/database",
35    "${access_token_path}/services/accesstokenmanager/main/cpp/include/dfx",
36    "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission",
37    "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission",
38  ]
39
40  sources = [
41    "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/accesstoken_callback_proxys.cpp",
42    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_db.cpp",
43    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_db_util.cpp",
44    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/access_token_open_callback.cpp",
45    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_translator.cpp",
46    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/token_field_const.cpp",
47    "unittest/database_test.cpp",
48  ]
49
50  configs = [ "${access_token_path}/config:coverage_flags" ]
51
52  cflags_cc = [ "-DHILOG_ENABLE" ]
53
54  deps = [
55    "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx",
56    "${access_token_path}/frameworks/common:accesstoken_common_cxx",
57    "${access_token_path}/frameworks/common:accesstoken_hisysevent",
58    "${access_token_path}/services/common:accesstoken_service_common",
59  ]
60
61  external_deps = [
62    "c_utils:utils",
63    "hilog:libhilog",
64    "hisysevent:libhisysevent",
65    "ipc:ipc_single",
66    "relational_store:native_rdb",
67    "sqlite:sqlite",
68  ]
69}
70
71group("unittest") {
72  testonly = true
73  deps = [ ":libdatabase_test" ]
74}
75