1# Copyright (c) 2021-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. 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_native_path}/ability/native:abilitykit_native", 91 "${ability_runtime_native_path}/ability/native:photo_editor_extension", 92 "${ability_runtime_native_path}/ability/native:ui_extension", 93 "${ability_runtime_native_path}/appkit:app_context", 94 "${ability_runtime_native_path}/appkit:appkit_native", 95 ] 96 97 external_deps = [ 98 "c_utils:utils", 99 "googletest:gmock_main", 100 "googletest:gtest_main", 101 "hilog:libhilog", 102 "ipc:ipc_napi", 103 "napi:ace_napi", 104 ] 105} 106 107ohos_unittest("photo_editor_extension_test") { 108 sanitize = { 109 cfi = true 110 cfi_cross_dso = true 111 debug = false 112 } 113 114 module_out_path = "ability_runtime/ability_runtime/photo_editor_extension" 115 116 include_dirs = [ 117 "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", 118 "${ability_runtime_path}/interfaces/kits/native/ability/native/photo_editor_extension_ability", 119 ] 120 121 sources = [ "photo_editor_extension_test.cpp" ] 122 123 configs = [ ":module_private_config" ] 124 125 deps = [ 126 "${ability_runtime_innerkits_path}/ability_manager:ability_manager", 127 "${ability_runtime_innerkits_path}/runtime:runtime", 128 "${ability_runtime_native_path}/ability/native:abilitykit_native", 129 "${ability_runtime_native_path}/ability/native:photo_editor_extension", 130 "${ability_runtime_native_path}/ability/native:ui_extension", 131 "${ability_runtime_native_path}/appkit:app_context", 132 "${ability_runtime_native_path}/appkit:appkit_native", 133 ] 134 135 external_deps = [ 136 "ability_base:base", 137 "ability_base:extractortool", 138 "ability_base:want", 139 "bundle_framework:appexecfwk_base", 140 "c_utils:utils", 141 "eventhandler:libeventhandler", 142 "googletest:gmock_main", 143 "googletest:gtest_main", 144 "hilog:libhilog", 145 "init:libbegetutil", 146 "ipc:ipc_core", 147 "ipc:ipc_napi", 148 "napi:ace_napi", 149 "samgr:samgr_proxy", 150 ] 151 152 if (ability_runtime_graphics) { 153 external_deps += [ 154 "form_fwk:fmskit_native", 155 "i18n:intl_util", 156 ] 157 } 158} 159 160group("unittest") { 161 testonly = true 162 deps = [ 163 ":photo_editor_extension_module_loader_test", 164 ":photo_editor_extension_test", 165 ] 166} 167