14d949f91Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd.
24d949f91Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
34d949f91Sopenharmony_ci# you may not use this file except in compliance with the License.
44d949f91Sopenharmony_ci# You may obtain a copy of the License at
54d949f91Sopenharmony_ci#
64d949f91Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
74d949f91Sopenharmony_ci#
84d949f91Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
94d949f91Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
104d949f91Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114d949f91Sopenharmony_ci# See the License for the specific language governing permissions and
124d949f91Sopenharmony_ci# limitations under the License.
134d949f91Sopenharmony_ci
144d949f91Sopenharmony_ciimport("//build/test.gni")
154d949f91Sopenharmony_ciimport("//foundation/multimedia/image_effect/config.gni")
164d949f91Sopenharmony_ci
174d949f91Sopenharmony_cimodule_output_path = "image_effect/image_effect_unittest"
184d949f91Sopenharmony_ci
194d949f91Sopenharmony_cibase_include_dirs = [
204d949f91Sopenharmony_ci  "$image_effect_root_dir/interfaces/inner_api/native/memory",
214d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/base",
224d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/capi",
234d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/pipeline/include/core",
244d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/efilter/filterimpl/crop",
254d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/utils/common",
264d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/utils/dfx",
274d949f91Sopenharmony_ci]
284d949f91Sopenharmony_ci
294d949f91Sopenharmony_cibase_sources = [
304d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/capi/native_common_utils.cpp",
314d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/base/external_loader.cpp",
324d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/manager/memory_manager/effect_memory.cpp",
334d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/manager/memory_manager/effect_memory_manager.cpp",
344d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/pipeline/core/filter_base.cpp",
354d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/pipeline/core/pipeline_core.cpp",
364d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/effect/pipeline/core/port.cpp",
374d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/efilter/filterimpl/crop/crop_efilter.cpp",
384d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/utils/common/common_utils.cpp",
394d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/utils/common/effect_json_helper.cpp",
404d949f91Sopenharmony_ci  "$image_effect_root_dir/frameworks/native/utils/dfx/error_code.cpp",
414d949f91Sopenharmony_ci]
424d949f91Sopenharmony_ci
434d949f91Sopenharmony_ciohos_unittest("image_effect_unittest") {
444d949f91Sopenharmony_ci  module_out_path = module_output_path
454d949f91Sopenharmony_ci  resource_config_file = "$image_effect_root_dir/test/resource/ohos_test.xml"
464d949f91Sopenharmony_ci
474d949f91Sopenharmony_ci  include_dirs = base_include_dirs
484d949f91Sopenharmony_ci
494d949f91Sopenharmony_ci  include_dirs += [
504d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native/effect/render_environment/gpu_render",
514d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native/effect/render_environment/utils",
524d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native/efilter/filterimpl/brightness",
534d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native/efilter/filterimpl/contrast",
544d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native/efilter/filterimpl/crop",
554d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native/capi",
564d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/mock/include",
574d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/common",
584d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/utils",
594d949f91Sopenharmony_ci  ]
604d949f91Sopenharmony_ci
614d949f91Sopenharmony_ci  sources = base_sources
624d949f91Sopenharmony_ci
634d949f91Sopenharmony_ci  sources += [
644d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestEffectMemoryManager.cpp",
654d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestEffectPipeline.cpp",
664d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestImageEffect.cpp",
674d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestJsonHelper.cpp",
684d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestPort.cpp",
694d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestRenderEnvironment.cpp",
704d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/TestUtils.cpp",
714d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/image_effect_capi_unittest.cpp",
724d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/image_effect_inner_unittest.cpp",
734d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/mock/src/mock_picture.cpp",
744d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/mock/src/mock_pixel_map.cpp",
754d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/mock/src/mock_producer_surface.cpp",
764d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/native_image_effect_unittest.cpp",
774d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/utils/test_native_buffer_utils.cpp",
784d949f91Sopenharmony_ci    "$image_effect_root_dir/test/unittest/utils/test_pixel_map_utils.cpp",
794d949f91Sopenharmony_ci  ]
804d949f91Sopenharmony_ci
814d949f91Sopenharmony_ci  deps = [
824d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native:image_effect",
834d949f91Sopenharmony_ci    "$image_effect_root_dir/frameworks/native:image_effect_impl",
844d949f91Sopenharmony_ci    "//third_party/googletest:gmock_main",
854d949f91Sopenharmony_ci    "//third_party/googletest:gtest_main",
864d949f91Sopenharmony_ci  ]
874d949f91Sopenharmony_ci
884d949f91Sopenharmony_ci  external_deps = [
894d949f91Sopenharmony_ci    "ability_base:zuri",
904d949f91Sopenharmony_ci    "cJSON:cjson",
914d949f91Sopenharmony_ci    "c_utils:utils",
924d949f91Sopenharmony_ci    "drivers_interface_display:display_commontype_idl_headers",
934d949f91Sopenharmony_ci    "graphic_2d:EGL",
944d949f91Sopenharmony_ci    "graphic_2d:GLESv3",
954d949f91Sopenharmony_ci    "graphic_surface:surface",
964d949f91Sopenharmony_ci    "graphic_surface:sync_fence",
974d949f91Sopenharmony_ci    "hilog:libhilog",
984d949f91Sopenharmony_ci    "hitrace:hitrace_meter",
994d949f91Sopenharmony_ci    "image_framework:image_native",
1004d949f91Sopenharmony_ci    "image_framework:picture",
1014d949f91Sopenharmony_ci    "image_framework:pixelmap",
1024d949f91Sopenharmony_ci    "ipc:ipc_single",
1034d949f91Sopenharmony_ci    "libexif:libexif",
1044d949f91Sopenharmony_ci    "napi:ace_napi",
1054d949f91Sopenharmony_ci  ]
1064d949f91Sopenharmony_ci
1074d949f91Sopenharmony_ci  use_exceptions = true
1084d949f91Sopenharmony_ci
1094d949f91Sopenharmony_ci  cflags = [
1104d949f91Sopenharmony_ci    "-fPIC",
1114d949f91Sopenharmony_ci    "-Werror=unused",
1124d949f91Sopenharmony_ci    "-fno-access-control",  # Ignore Private Member Access Control
1134d949f91Sopenharmony_ci  ]
1144d949f91Sopenharmony_ci
1154d949f91Sopenharmony_ci  cflags_cc = cflags
1164d949f91Sopenharmony_ci}
117