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
17config("accesstoken_test_config") {
18  include_dirs = [
19    "${access_token_path}/interfaces/innerkits/accesstoken/include",
20    "${access_token_path}/interfaces/innerkits/privacy/include",
21    "../../accesstoken/include",
22    "../../common/include",
23    "../../privacy/include",
24  ]
25}
26
27ohos_unittest("libaccesstoken_framework_test") {
28  subsystem_name = "security"
29  part_name = "access_token"
30  module_out_path = part_name + "/" + part_name
31  sanitize = {
32    cfi = true
33    cfi_cross_dso = true
34    debug = false
35  }
36  branch_protector_ret = "pac_ret"
37
38  sources = [
39    "accesstoken_parcel_test.cpp",
40    "common_test.cpp",
41    "privacy_parcel_test.cpp",
42  ]
43
44  configs = [
45    ":accesstoken_test_config",
46    "${access_token_path}/config:coverage_flags",
47  ]
48
49  deps = [
50    "../../accesstoken:accesstoken_communication_adapter_cxx",
51    "../../common:accesstoken_common_cxx",
52    "../../privacy:privacy_communication_adapter_cxx",
53  ]
54
55  external_deps = [
56    "c_utils:utils",
57    "ipc:ipc_single",
58    "json:nlohmann_json_static",
59    "openssl:libcrypto_shared",
60  ]
61}
62
63group("unittest") {
64  testonly = true
65  deps = [ ":libaccesstoken_framework_test" ]
66}
67