• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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")
15import("../../../../access_token.gni")
16
17ohos_unittest("libdatabase_test") {
18  subsystem_name = "security"
19  part_name = "access_token"
20  module_out_path = part_name + "/" + part_name
21
22  include_dirs = [
23    "${access_token_path}/frameworks/accesstoken/include",
24    "${access_token_path}/frameworks/common/include",
25    "${access_token_path}/interfaces/innerkits/accesstoken/include",
26    "${access_token_path}/services/common/database/include",
27    "${access_token_path}/services/accesstokenmanager/main/cpp/include/callback",
28    "${access_token_path}/services/accesstokenmanager/main/cpp/include/database",
29    "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission",
30    "${access_token_path}/services/accesstokenmanager/main/cpp/include/token",
31    "//third_party/googletest/include",
32  ]
33
34  sources = [
35    "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/permission_state_change_callback_proxy.cpp",
36    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_storage.cpp",
37    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_translator.cpp",
38    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/sqlite_storage.cpp",
39    "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/token_field_const.cpp",
40    "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_validator.cpp",
41    "unittest/database_test.cpp",
42  ]
43
44  configs = [ "${access_token_path}/config:coverage_flags" ]
45
46  cflags_cc = [ "-DHILOG_ENABLE" ]
47
48  deps = [
49    "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx",
50    "${access_token_path}/frameworks/common:accesstoken_common_cxx",
51    "${access_token_path}/services/common/database:accesstoken_database_cxx",
52    "//third_party/sqlite:sqlite",
53  ]
54
55  external_deps = [
56    "c_utils:utils",
57    "hilog:libhilog",
58    "hisysevent:libhisysevent",
59    "ipc:ipc_core",
60  ]
61}
62
63group("unittest") {
64  testonly = true
65  deps = [ ":libdatabase_test" ]
66}
67