• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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")
15
16module_output_path = "ability_runtime/intent_test"
17
18###############################################################################
19config("module_private_config") {
20  visibility = [ ":*" ]
21  include_dirs = [
22    "//utils/native/base/include",
23    "//sdk/appexecfwk/appexecfwk_base/include",
24    "//foundation/aafwk/standard/interfaces/innerkits/uri/include",
25    "//foundation/aafwk/standard/interfaces/innerkits/want/include",
26    "//foundation/aafwk/standard/interfaces/innerkits/intent/include",
27    "//foundation/appexecfwk/standard/common/log/include",
28  ]
29
30  defines = [
31    "ABILITYBASE_LOG_TAG = \"WantUnitTest\"",
32    "ABILITYBASE_LOG_DOMAIN = 0xD002210",
33  ]
34}
35
36config("module_private_want_param_wrapper_config") {
37  visibility = [ ":*" ]
38  include_dirs = [
39    "//utils/native/base/include",
40    "//sdk/appexecfwk/appexecfwk_base/include",
41    "//foundation/aafwk/standard/interfaces/innerkits/want/include",
42    "//foundation/aafwk/standard/frameworks/kits/content/cpp/src",
43  ]
44
45  defines = [
46    "ABILITYBASE_LOG_TAG = \"WantUnitTest\"",
47    "ABILITYBASE_LOG_DOMAIN = 0xD002210",
48  ]
49}
50
51ohos_unittest("intent_parcelable_test") {
52  module_out_path = module_output_path
53  sources = []
54
55  configs = [
56    ":module_private_config",
57    #"//foundation/aafwk/standard/interfaces/innerkits/intent:intent_public_config",
58  ]
59
60  deps = [
61    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
62    "//third_party/googletest:gtest_main",
63    "//utils/native/base:utils",
64  ]
65
66  external_deps = [
67    "bundle_framework:appexecfwk_base",
68    "ipc:ipc_core",
69  ]
70}
71
72ohos_unittest("intent_base_test") {
73  module_out_path = module_output_path
74  sources = []
75
76  configs = [
77    ":module_private_config",
78    #"//foundation/aafwk/standard/interfaces/innerkits/intent:intent_public_config",
79  ]
80
81  deps = [
82    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
83    "//third_party/googletest:gtest_main",
84    "//utils/native/base:utils",
85  ]
86
87  external_deps = [
88    "bundle_framework:appexecfwk_base",
89    "ipc:ipc_core",
90  ]
91}
92
93ohos_unittest("intent_parse_to_uri_test") {
94  module_out_path = module_output_path
95  sources = []
96
97  configs = [
98    ":module_private_config",
99    #"//foundation/aafwk/standard/interfaces/innerkits/intent:intent_public_config",
100  ]
101
102  deps = [
103    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
104    "//third_party/googletest:gtest_main",
105    "//utils/native/base:utils",
106  ]
107
108  external_deps = [
109    "bundle_framework:appexecfwk_base",
110    "ipc:ipc_core",
111  ]
112}
113
114ohos_unittest("intent_parameters_test") {
115  module_out_path = module_output_path
116  sources = [
117    "../src/ohos/aafwk/content/intent.cpp",
118    "../src/ohos/aafwk/content/intent_params.cpp",
119    "unittest/common/intent_parameters_test.cpp",
120  ]
121
122  configs = [
123    ":module_private_config",
124    #"//foundation/aafwk/standard/interfaces/innerkits/intent:intent_public_config",
125  ]
126
127  deps = [
128    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
129    "//third_party/googletest:gtest_main",
130    "//utils/native/base:utils",
131  ]
132
133  external_deps = [
134    "ability_base:want",
135    "ipc:ipc_core",
136  ]
137}
138
139ohos_unittest("intent_params_test") {
140  module_out_path = module_output_path
141  sources = []
142
143  configs = [
144    ":module_private_config",
145    #"//foundation/aafwk/standard/interfaces/innerkits/intent:intent_public_config",
146  ]
147
148  deps = [
149    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
150    "//third_party/googletest:gtest_main",
151    "//utils/native/base:utils",
152  ]
153
154  external_deps = [
155    "bundle_framework:appexecfwk_base",
156    "ipc:ipc_core",
157  ]
158}
159
160ohos_unittest("intent_filter_test") {
161  module_out_path = module_output_path
162  sources = [
163    "../src/ohos/aafwk/content/intent.cpp",
164    "../src/ohos/aafwk/content/intent_filter.cpp",
165    "../src/ohos/aafwk/content/intent_params.cpp",
166    "unittest/common/intent_filter_test.cpp",
167  ]
168
169  configs = [
170    ":module_private_config",
171    #"//foundation/aafwk/standard/interfaces/innerkits/intent:intent_public_config",
172  ]
173
174  deps = [
175    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
176    "//third_party/googletest:gtest_main",
177    "//utils/native/base:utils",
178  ]
179
180  external_deps = [ "ability_base:want" ]
181}
182
183ohos_unittest("operation_test") {
184  module_out_path = module_output_path
185  sources = [
186    "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content/operation_builder.h",
187    "unittest/common/operation_test.cpp",
188  ]
189
190  configs = [
191    ":module_private_config",
192    "//foundation/aafwk/standard/interfaces/innerkits/want:want_public_config",
193  ]
194
195  deps = [
196    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
197    "//foundation/aafwk/standard/interfaces/innerkits/uri:zuri",
198    "//foundation/aafwk/standard/interfaces/innerkits/want:want",
199    "//third_party/googletest:gtest_main",
200    "//utils/native/base:utils",
201  ]
202
203  external_deps = [ "bundle_framework:appexecfwk_base" ]
204}
205
206ohos_unittest("patterns_matcher_test") {
207  module_out_path = module_output_path
208  sources = [
209    "../src/ohos/aafwk/content/patterns_matcher.cpp",
210    "unittest/common/patterns_matcher_test.cpp",
211  ]
212
213  configs = [
214    ":module_private_config",
215    "//foundation/aafwk/standard/interfaces/innerkits/want:want_public_config",
216  ]
217
218  deps = [
219    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
220    "//foundation/appexecfwk/standard/common:libappexecfwk_common",
221    "//third_party/googletest:gtest_main",
222    "//utils/native/base:utils",
223  ]
224
225  external_deps = [
226    "bundle_framework:appexecfwk_base",
227    "hiviewdfx_hilog_native:libhilog",
228  ]
229}
230
231ohos_unittest("skills_test") {
232  module_out_path = module_output_path
233  sources = [
234    "../src/ohos/aafwk/content/skills.cpp",
235    "unittest/common/skills_test.cpp",
236  ]
237
238  configs = [
239    ":module_private_config",
240    "//foundation/aafwk/standard/interfaces/innerkits/want:want_public_config",
241  ]
242
243  deps = [
244    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
245    "//foundation/aafwk/standard/interfaces/innerkits/uri:zuri",
246    "//foundation/aafwk/standard/interfaces/innerkits/want:want",
247    "//foundation/appexecfwk/standard/common:libappexecfwk_common",
248    "//third_party/googletest:gtest_main",
249    "//utils/native/base:utils",
250  ]
251
252  external_deps = [
253    "bundle_framework:appexecfwk_base",
254    "hiviewdfx_hilog_native:libhilog",
255  ]
256}
257
258ohos_unittest("want_params_test") {
259  module_out_path = module_output_path
260  sources = [
261    "../src/ohos/aafwk/content/want_params.cpp",
262    "../src/ohos/aafwk/content/want_params_wrapper.cpp",
263    "unittest/common/want_params_test.cpp",
264  ]
265
266  configs = [
267    ":module_private_config",
268    "//foundation/aafwk/standard/interfaces/innerkits/want:want_public_config",
269  ]
270
271  deps = [
272    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
273    "//foundation/appexecfwk/standard/common:libappexecfwk_common",
274    "//third_party/googletest:gtest_main",
275    "//utils/native/base:utils",
276  ]
277
278  external_deps = [
279    "bundle_framework:appexecfwk_base",
280    "hiviewdfx_hilog_native:libhilog",
281    "ipc:ipc_core",
282  ]
283}
284
285ohos_unittest("want_params_wrapper_test") {
286  module_out_path = module_output_path
287  sources = [
288    "../src/ohos/aafwk/content/want_params.cpp",
289    "../src/ohos/aafwk/content/want_params_wrapper.cpp",
290    "unittest/common/want_params_wrapper_test.cpp",
291  ]
292
293  configs = [ ":module_private_want_param_wrapper_config" ]
294
295  deps = [
296    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
297    "//foundation/aafwk/standard/interfaces/innerkits/uri:zuri",
298    "//foundation/aafwk/standard/interfaces/innerkits/want:want",
299    "//foundation/appexecfwk/standard/common:libappexecfwk_common",
300    "//third_party/googletest:gtest_main",
301    "//utils/native/base:utils",
302  ]
303
304  external_deps = [
305    "bundle_framework:appexecfwk_base",
306    "hiviewdfx_hilog_native:libhilog",
307    "ipc:ipc_core",
308  ]
309}
310
311ohos_unittest("want_test") {
312  module_out_path = module_output_path
313  sources = [ "unittest/common/want_test.cpp" ]
314
315  configs = [
316    ":module_private_config",
317    "//foundation/aafwk/standard/interfaces/innerkits/want:want_public_config",
318  ]
319
320  deps = [
321    "//foundation/aafwk/standard/interfaces/innerkits/base:base",
322    "//foundation/aafwk/standard/interfaces/innerkits/uri:zuri",
323    "//foundation/aafwk/standard/interfaces/innerkits/want:want",
324    "//foundation/appexecfwk/standard/common:libappexecfwk_common",
325    "//third_party/googletest:gtest_main",
326    "//utils/native/base:utils",
327  ]
328
329  external_deps = [
330    "bundle_framework:appexecfwk_base",
331    "hiviewdfx_hilog_native:libhilog",
332    "ipc:ipc_core",
333  ]
334}
335
336###############################################################################
337
338group("unittest") {
339  testonly = true
340  deps = []
341
342  deps += [
343    ":intent_base_test",
344    ":intent_filter_test",
345    ":intent_parameters_test",
346    ":intent_params_test",
347    ":intent_parse_to_uri_test",
348    ":operation_test",
349    ":patterns_matcher_test",
350    ":skills_test",
351    ":want_params_test",
352    ":want_params_wrapper_test",
353    ":want_test",
354  ]
355}
356###############################################################################
357