• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2025 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("//foundation/distributeddatamgr/data_share/datashare.gni")
16
17group("unittest") {
18  testonly = true
19  deps = []
20
21  deps += [
22    ":DataShareStubTest",
23  ]
24}
25
26config("permission_config") {
27  visibility = [ ":*" ]
28  include_dirs = [
29    "${datashare_common_native_path}/include",
30    "${datashare_native_permission_path}/include",
31  ]
32
33  cflags = []
34  if (target_cpu == "arm") {
35    cflags += [ "-DBINDER_IPC_32BIT" ]
36  }
37}
38
39ohos_unittest("DataShareStubTest") {
40  module_out_path = "data_share/data_share/native/provider"
41
42  include_dirs = [
43    "${datashare_innerapi_path}/consumer/include",
44    "${datashare_innerapi_path}/common/include",
45    "${datashare_native_provider_path}/include",
46    "${datashare_native_proxy_path}/include",
47  ]
48
49  sources = [ "${datashare_base_path}/test/unittest/native/provider/src/datashare_stub_test.cpp" ]
50
51  deps = [
52    "${datashare_innerapi_path}:datashare_consumer_static",
53    "${datashare_innerapi_path}:datashare_provider",
54    "${datashare_innerapi_path}/common:datashare_common_static",
55  ]
56
57  external_deps = [
58    "ability_base:want",
59    "ability_base:zuri",
60    "ability_runtime:ability_manager",
61    "ability_runtime:abilitykit_native",
62    "ability_runtime:dataobs_manager",
63    "ability_runtime:extension_manager",
64    "access_token:libaccesstoken_sdk",
65    "access_token:libnativetoken",
66    "access_token:libtoken_setproc",
67    "c_utils:utils",
68    "common_event_service:cesfwk_innerkits",
69    "hilog:libhilog",
70    "hitrace:hitrace_meter",
71    "ipc:ipc_single",
72    "ipc:ipc_napi",
73    "relational_store:rdb_data_ability_adapter",
74    "samgr:samgr_proxy",
75  ]
76
77  sanitize = {
78    integer_overflow = true
79    ubsan = true
80    boundary_sanitize = true
81    cfi = true
82    cfi_cross_dso = true
83    cfi_vcall_icall_only = true
84    blocklist = "${datashare_base_path}/cfi_blocklist.txt"
85  }
86
87  cflags = [
88    "-fvisibility=hidden",
89    "-Dprivate=public",
90    "-Dprotected=public",
91  ]
92}