# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//build/test.gni") import("//foundation/ability/ability_runtime/ability_runtime.gni") config("module_private_config") { visibility = [ ":*" ] include_dirs = [ "${ability_runtime_innerkits_path}/ability_manager/include", "${ability_runtime_innerkits_path}/app_manager/include/appmgr", "${ability_runtime_path}/interfaces/kits/native/ability/native", "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", "${ability_runtime_path}/interfaces/kits/native/appkit/app", "${ability_runtime_path}/interfaces/kits/native/appkit/app/task", "${ability_runtime_test_path}/mock/services_abilitymgr_test/libs/aakit/include", "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include", "${ability_runtime_services_path}/abilitymgr/include", "${ability_runtime_services_path}/common/include", "${distributeddatamgr_path}/distributeddatamgr/interfaces/innerkits/app_distributeddata/include", "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include", "${ability_base_kits_path}/extractortool/include", "${ability_runtime_test_path}/mock/services_appmgr_test/include", "${ability_runtime_path}/interfaces/kits/native/ability/ability_runtime", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ "AMS_LOG_TAG = \"AbilityUnitTest\"" ] if (ability_runtime_graphics) { include_dirs += [ "${global_path}/i18n/frameworks/intl/include", "${form_fwk_path}/interfaces/kits/native/include", ] } } config("module_ability_context_config") { visibility = [ ":*" ] include_dirs = [ "${ability_runtime_innerkits_path}/app_manager/include/appmgr", "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", "${ability_runtime_test_path}/mock/frameworks_kits_appkit_native_test/include", "${ability_runtime_innerkits_path}/ability_manager/include", "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy/include", "//third_party/googletest/googlemock/include", "${ability_runtime_path}/interfaces/kits/native/ability/native", "${ability_runtime_path}/interfaces/kits/native/appkit/app", "${multimodalinput_path}/interfaces/native/innerkits/event/include", "//third_party/libuv/include", "${global_path}/resource_management/interfaces/inner_api/include", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } defines = [ "AMS_LOG_TAG = \"AbilityUnitTest\"" ] } ohos_unittest("photo_editor_extension_module_loader_test") { sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = "ability_runtime/photo_editor_extension" sources = [ "${ability_runtime_native_path}/ability/native/photo_editor_extension_ability/photo_editor_extension_module_loader.cpp", "photo_editor_extension_module_loader_test.cpp", ] cflags = [] include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/ability/native/photo_editor_extension_ability" ] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_native_path}/ability/native:photo_editor_extension", "${ability_runtime_native_path}/ability/native:ui_extension", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_native", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "c_utils:utils", "hilog:libhilog", "napi:ace_napi", ] } ohos_unittest("photo_editor_extension_test") { sanitize = { cfi = true cfi_cross_dso = true debug = false } module_out_path = "ability_runtime/photo_editor_extension" include_dirs = [ "${ability_runtime_test_path}/mock/frameworks_kits_ability_native_test/include", "${ability_runtime_path}/interfaces/kits/native/ability/native/photo_editor_extension_ability", ] sources = [ "photo_editor_extension_test.cpp" ] configs = [ ":module_private_config" ] deps = [ "${ability_runtime_innerkits_path}/ability_manager:ability_manager", "${ability_runtime_innerkits_path}/runtime:runtime", "${ability_runtime_native_path}/ability/native:abilitykit_native", "${ability_runtime_native_path}/ability/native:photo_editor_extension", "${ability_runtime_native_path}/ability/native:ui_extension", "${ability_runtime_native_path}/appkit:app_context", "${ability_runtime_native_path}/appkit:appkit_native", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest_main", ] external_deps = [ "ability_base:base", "ability_base:want", "bundle_framework:appexecfwk_base", "c_utils:utils", "eventhandler:libeventhandler", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_core", "napi:ace_napi", ] } group("unittest") { testonly = true deps = [ ":photo_editor_extension_module_loader_test", ":photo_editor_extension_test", ] }