• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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.
13import("//build/test.gni")
14import("//foundation/distributeddatamgr/udmf/udmf.gni")
15
16module_output_path = "udmf/ndkimpl"
17
18###############################################################################
19config("module_private_config") {
20  include_dirs = [
21    "${udmf_interfaces_path}/ndk/data",
22    "${udmf_interfaces_path}/innerkits/data",
23    "${udmf_interfaces_path}/innerkits/common",
24    "${udmf_framework_path}/common",
25    "${udmf_framework_path}/ndkimpl/data",
26  ]
27}
28
29common_deps = [
30  "${udmf_interfaces_path}/innerkits:udmf_client",
31  "${udmf_interfaces_path}/innerkits:utd_client",
32  "${udmf_interfaces_path}/ndk:libudmf",
33]
34
35common_external_deps = [
36  "ability_base:want",
37  "access_token:libaccesstoken_sdk",
38  "access_token:libnativetoken",
39  "access_token:libtoken_setproc",
40  "c_utils:utils",
41  "image_framework:image",
42  "image_framework:image_native",
43  "image_framework:pixelmap",
44  "samgr:samgr_proxy",
45]
46
47ohos_unittest("UtdTest") {
48  module_out_path = module_output_path
49
50  sources = [ "utd_test.cpp" ]
51
52  configs = [ ":module_private_config" ]
53
54  deps = common_deps
55
56  external_deps = common_external_deps
57}
58
59ohos_unittest("UdsTest") {
60  module_out_path = module_output_path
61
62  sources = [ "uds_test.cpp" ]
63
64  configs = [ ":module_private_config" ]
65
66  deps = common_deps
67
68  external_deps = common_external_deps
69}
70
71ohos_unittest("UdmfTest") {
72  module_out_path = module_output_path
73
74  sources = [
75    "${udmf_framework_path}/innerkitsimpl/data/application_defined_record.cpp",
76    "${udmf_framework_path}/innerkitsimpl/data/audio.cpp",
77    "${udmf_framework_path}/innerkitsimpl/data/file.cpp",
78    "${udmf_framework_path}/innerkitsimpl/data/folder.cpp",
79    "${udmf_framework_path}/innerkitsimpl/data/html.cpp",
80    "${udmf_framework_path}/innerkitsimpl/data/image.cpp",
81    "${udmf_framework_path}/innerkitsimpl/data/link.cpp",
82    "${udmf_framework_path}/innerkitsimpl/data/plain_text.cpp",
83    "${udmf_framework_path}/innerkitsimpl/data/system_defined_appitem.cpp",
84    "${udmf_framework_path}/innerkitsimpl/data/system_defined_form.cpp",
85    "${udmf_framework_path}/innerkitsimpl/data/system_defined_pixelmap.cpp",
86    "${udmf_framework_path}/innerkitsimpl/data/system_defined_record.cpp",
87    "${udmf_framework_path}/innerkitsimpl/data/text.cpp",
88    "${udmf_framework_path}/innerkitsimpl/data/unified_record.cpp",
89    "udmf_test.cpp",
90  ]
91
92  configs = [ ":module_private_config" ]
93
94  deps = common_deps
95
96  external_deps = common_external_deps
97}
98
99ohos_unittest("DataProviderImplTest") {
100  module_out_path = module_output_path
101
102  sources = [ "data_provider_impl_test.cpp" ]
103
104  configs = [ ":module_private_config" ]
105
106  deps = common_deps
107
108  external_deps = common_external_deps
109
110  defines = [
111    "private=public",
112    "protected=public",
113  ]
114}
115
116###############################################################################
117group("unittest") {
118  testonly = true
119
120  deps = [
121    ":DataProviderImplTest",
122    ":UdmfTest",
123    ":UdsTest",
124    ":UtdTest",
125  ]
126}
127###############################################################################
128