• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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/ohos.gni")
15import("//build/test.gni")
16import("//foundation/ability/ability_runtime/ability_runtime.gni")
17
18config("module_private_config") {
19  visibility = [ ":*" ]
20  include_dirs = [
21    "${ability_runtime_innerkits_path}/ability_manager/include",
22    "${ability_runtime_innerkits_path}/app_manager/include/appmgr",
23    "${ability_runtime_path}/interfaces/kits/native/ability/native",
24    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper",
25    "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include",
26    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
27    "${ability_runtime_path}/interfaces/kits/native/appkit/app/task",
28    "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit/include",
29    "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include",
30    "${ability_runtime_services_path}/abilitymgr/include/utils",
31    "${ability_runtime_services_path}/abilitymgr/include",
32
33    "${ability_runtime_services_path}/common/include",
34    "${ability_runtime_test_path}/mock/services_appmgr_test/include",
35    "${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime",
36  ]
37  cflags = []
38  if (target_cpu == "arm") {
39    cflags += [ "-DBINDER_IPC_32BIT" ]
40  }
41  defines = [ "AMS_LOG_TAG = \"AbilityUnitTest\"" ]
42}
43
44config("module_ability_context_config") {
45  visibility = [ ":*" ]
46  include_dirs = [
47    "${ability_runtime_innerkits_path}/app_manager/include/appmgr",
48    "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include",
49    "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include",
50    "${ability_runtime_innerkits_path}/ability_manager/include",
51    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include",
52    "//third_party/googletest/googlemock/include",
53    "${ability_runtime_path}/interfaces/kits/native/ability/native",
54    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
55    "${multimodalinput_path}/interfaces/native/innerkits/event/include",
56    "//third_party/libuv/include",
57    "${global_path}/resource_management/interfaces/inner_api/include",
58  ]
59  cflags = []
60  if (target_cpu == "arm") {
61    cflags += [ "-DBINDER_IPC_32BIT" ]
62  }
63  defines = [ "AMS_LOG_TAG = \"AbilityUnitTest\"" ]
64}
65
66ohos_unittest("photo_editor_extension_module_loader_test") {
67  sanitize = {
68    cfi = true
69    cfi_cross_dso = true
70    debug = false
71  }
72
73  module_out_path = "ability_runtime/ability_runtime/photo_editor_extension"
74
75  sources = [
76    "${ability_runtime_native_path}/ability/native/photo_editor_extension_ability/photo_editor_extension_module_loader.cpp",
77    "photo_editor_extension_module_loader_test.cpp",
78  ]
79
80  cflags = []
81
82  include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/ability/native/photo_editor_extension_ability" ]
83
84  if (target_cpu == "arm") {
85    cflags += [ "-DBINDER_IPC_32BIT" ]
86  }
87
88  deps = [
89    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
90    "${ability_runtime_innerkits_path}/runtime:runtime",
91    "${ability_runtime_native_path}/ability/native:abilitykit_native",
92    "${ability_runtime_native_path}/ability/native:photo_editor_extension",
93    "${ability_runtime_native_path}/ability/native:ui_extension",
94    "${ability_runtime_native_path}/appkit:app_context",
95    "${ability_runtime_native_path}/appkit:appkit_native",
96  ]
97
98  external_deps = [
99    "c_utils:utils",
100    "googletest:gmock_main",
101    "googletest:gtest_main",
102    "hilog:libhilog",
103    "ipc:ipc_napi",
104    "napi:ace_napi",
105  ]
106}
107
108ohos_unittest("photo_editor_extension_test") {
109  sanitize = {
110    cfi = true
111    cfi_cross_dso = true
112    debug = false
113  }
114
115  module_out_path = "ability_runtime/ability_runtime/photo_editor_extension"
116
117  include_dirs = [
118    "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include",
119    "${ability_runtime_path}/interfaces/kits/native/ability/native/photo_editor_extension_ability",
120  ]
121
122  sources = [ "photo_editor_extension_test.cpp" ]
123
124  configs = [ ":module_private_config" ]
125
126  deps = [
127    "${ability_runtime_innerkits_path}/ability_manager:ability_manager",
128    "${ability_runtime_innerkits_path}/runtime:runtime",
129    "${ability_runtime_native_path}/ability/native:abilitykit_native",
130    "${ability_runtime_native_path}/ability/native:abilitykit_utils",
131    "${ability_runtime_native_path}/ability/native:extensionkit_native",
132    "${ability_runtime_native_path}/ability/native:photo_editor_extension",
133    "${ability_runtime_native_path}/ability/native:ui_extension",
134    "${ability_runtime_native_path}/appkit:app_context",
135    "${ability_runtime_native_path}/appkit:appkit_native",
136  ]
137
138  external_deps = [
139    "ability_base:base",
140    "ability_base:extractortool",
141    "ability_base:want",
142    "bundle_framework:appexecfwk_base",
143    "c_utils:utils",
144    "eventhandler:libeventhandler",
145    "googletest:gmock_main",
146    "googletest:gtest_main",
147    "hilog:libhilog",
148    "init:libbegetutil",
149    "ipc:ipc_core",
150    "ipc:ipc_napi",
151    "napi:ace_napi",
152    "samgr:samgr_proxy",
153  ]
154
155  if (ability_runtime_graphics) {
156    external_deps += [
157      "form_fwk:fmskit_native",
158      "i18n:intl_util",
159    ]
160  }
161}
162
163group("unittest") {
164  testonly = true
165  deps = [
166    ":photo_editor_extension_module_loader_test",
167    ":photo_editor_extension_test",
168  ]
169}
170