# Copyright (c) 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/test.gni")
import("//foundation/graphic/graphic_2d/graphic_config.gni")
import("//foundation/graphic/graphic_2d/frameworks/text/config.gni")
import("${graphic_2d_root}/rosen/modules/render_service_base/config.gni")
module_output_path = "graphic_2d/graphic_2d/graphic_test"
drawing_engine_sources = []
hardware_manager_sources = []
open_capability_sources = [
"open_capability/pixmap/create_pixel_map_from_surface_test.cpp",
"open_capability/pixmap/pixelmap_display_test.cpp",
]
rs_display_effect_sources = [
"rs_display_effect/animation/anim_callback_animation_test.cpp",
"rs_display_effect/animation/anim_curve_animation_test.cpp",
"rs_display_effect/animation/anim_curve_animation_test2.cpp",
"rs_display_effect/animation/anim_custom_modifier_test.cpp",
"rs_display_effect/animation/anim_geometry_transition_test.cpp",
"rs_display_effect/animation/animation_combination_test.cpp",
"rs_display_effect/animation/animation_protocol_test.cpp",
"rs_display_effect/animation/animation_control_test.cpp",
"rs_display_effect/animation/custom_curve_test.cpp",
"rs_display_effect/animation/interactive_animation_test.cpp",
"rs_display_effect/animation/keyframe_animation_test.cpp",
"rs_display_effect/animation/path_animation_test.cpp",
"rs_display_effect/animation/point_custom_modifier_test.cpp",
"rs_display_effect/animation/spring_animation_test.cpp",
"rs_display_effect/animation/transition_test.cpp",
"rs_display_effect/content_display/canvas_drawing_node_test.cpp",
"rs_display_effect/content_display/content_effectnode_test.cpp",
"rs_display_effect/content_display/custom_draw_test.cpp",
"rs_display_effect/content_display/modifier_ng_native_test.cpp",
"rs_display_effect/content_display/rs_image_native_test.cpp",
"rs_display_effect/property_display/appearance_alpha_behind_window_filter_test.cpp",
"rs_display_effect/property_display/point_light_feathering_test.cpp",
"rs_display_effect/property_display/appearance_alpha_border_radius_test.cpp",
"rs_display_effect/property_display/appearance_alpha_border_test.cpp",
"rs_display_effect/property_display/appearance_alpha_clip_test.cpp",
"rs_display_effect/property_display/appearance_alpha_compositing_filter_test.cpp",
"rs_display_effect/property_display/appearance_alpha_g2cornerradius_test.cpp",
"rs_display_effect/property_display/appearance_alpha_material_filter_test.cpp",
"rs_display_effect/property_display/appearance_alpha_outlineborder_radius_test.cpp",
"rs_display_effect/property_display/appearance_alpha_outlineborder_test.cpp",
"rs_display_effect/property_display/appearance_alpha_particle_effect_test.cpp",
"rs_display_effect/property_display/appearance_alpha_pixelstretch_test.cpp",
"rs_display_effect/property_display/appearance_alpha_point_light_test.cpp",
"rs_display_effect/property_display/appearance_alpha_shadow_test.cpp",
"rs_display_effect/property_display/appearance_alpha_spherize_test.cpp",
"rs_display_effect/property_display/appearance_alpha_test.cpp",
"rs_display_effect/property_display/appearance_alpha_visibility_test.cpp",
"rs_display_effect/property_display/appearance_behind_window_filter_test.cpp",
"rs_display_effect/property_display/appearance_border_radius_test.cpp",
"rs_display_effect/property_display/appearance_border_test.cpp",
"rs_display_effect/property_display/appearance_clip_test.cpp",
"rs_display_effect/property_display/appearance_compositing_filter_test.cpp",
"rs_display_effect/property_display/appearance_double_sided_test.cpp",
"rs_display_effect/property_display/appearance_g2cornerradius_test.cpp",
"rs_display_effect/property_display/appearance_hdr_brightness_test.cpp",
"rs_display_effect/property_display/appearance_material_filter_test.cpp",
"rs_display_effect/property_display/appearance_outlineborder_radius_test.cpp",
"rs_display_effect/property_display/appearance_outlineborder_test.cpp",
"rs_display_effect/property_display/appearance_particle_effect_test.cpp",
"rs_display_effect/property_display/appearance_pixelstretch_test.cpp",
"rs_display_effect/property_display/appearance_point_light_test.cpp",
"rs_display_effect/property_display/appearance_shadow_test.cpp",
"rs_display_effect/property_display/appearance_spherize_test.cpp",
"rs_display_effect/property_display/appearance_visibility_test.cpp",
"rs_display_effect/property_display/background_alpha_blender_test.cpp",
"rs_display_effect/property_display/background_alpha_blur_test.cpp",
"rs_display_effect/property_display/background_alpha_color_test.cpp",
"rs_display_effect/property_display/background_alpha_effect_test.cpp",
"rs_display_effect/property_display/background_alpha_image_test.cpp",
"rs_display_effect/property_display/background_alpha_useeffect_test.cpp",
"rs_display_effect/property_display/background_blender_test.cpp",
"rs_display_effect/property_display/background_blur_test.cpp",
"rs_display_effect/property_display/background_color_test.cpp",
"rs_display_effect/property_display/background_effect_test.cpp",
"rs_display_effect/property_display/background_image_test.cpp",
"rs_display_effect/property_display/background_shader_test.cpp",
"rs_display_effect/property_display/background_useeffect_test.cpp",
"rs_display_effect/property_display/color_picker_modifier_test.cpp",
"rs_display_effect/property_display/display_node_properties_test.cpp",
"rs_display_effect/property_display/fg_alpha_blur_test.cpp",
"rs_display_effect/property_display/fg_alpha_colorbrightness_test.cpp",
"rs_display_effect/property_display/fg_alpha_colorfilter_test.cpp",
"rs_display_effect/property_display/fg_alpha_envfgcolor_test.cpp",
"rs_display_effect/property_display/fg_alpha_fgcolor_test.cpp",
"rs_display_effect/property_display/fg_alpha_light_test.cpp",
"rs_display_effect/property_display/fg_alpha_lightupeffect_test.cpp",
"rs_display_effect/property_display/fg_alpha_mask_test.cpp",
"rs_display_effect/property_display/fg_alpha_hdr_brightness_test.cpp",
"rs_display_effect/property_display/fg_alpha_sdf_light_test.cpp",
"rs_display_effect/property_display/fg_alpha_shader_test.cpp",
"rs_display_effect/property_display/fg_blur_test.cpp",
"rs_display_effect/property_display/fg_colorbrightness_test.cpp",
"rs_display_effect/property_display/fg_colorfilter_test.cpp",
"rs_display_effect/property_display/fg_dynamicdimdegree_test.cpp",
"rs_display_effect/property_display/fg_dynamiclightup_test.cpp",
"rs_display_effect/property_display/fg_envfgcolor_test.cpp",
"rs_display_effect/property_display/fg_fgcolor_test.cpp",
"rs_display_effect/property_display/fg_lightupeffect_test.cpp",
"rs_display_effect/property_display/fg_mask_test.cpp",
"rs_display_effect/property_display/fg_sdf_light_test.cpp",
"rs_display_effect/property_display/fg_shader_test.cpp",
"rs_display_effect/property_display/geom_alpha_bounds_test.cpp",
"rs_display_effect/property_display/geom_alpha_cameradistance_test.cpp",
"rs_display_effect/property_display/geom_alpha_clip_test.cpp",
"rs_display_effect/property_display/geom_alpha_cornerradius_test.cpp",
"rs_display_effect/property_display/geom_alpha_frame_test.cpp",
"rs_display_effect/property_display/geom_alpha_persp_test.cpp",
"rs_display_effect/property_display/geom_alpha_pivotandrotation_test.cpp",
"rs_display_effect/property_display/geom_alpha_rotation_test.cpp",
"rs_display_effect/property_display/geom_bounds_size_test.cpp",
"rs_display_effect/property_display/geom_bounds_test.cpp",
"rs_display_effect/property_display/geom_cameradistance_test.cpp",
"rs_display_effect/property_display/geom_clip_radius_test.cpp",
"rs_display_effect/property_display/geom_clip_test.cpp",
"rs_display_effect/property_display/geom_cornerradius_test.cpp",
"rs_display_effect/property_display/geom_frame_position_test.cpp",
"rs_display_effect/property_display/geom_frame_size_test.cpp",
"rs_display_effect/property_display/geom_frame_test.cpp",
"rs_display_effect/property_display/geom_persp_test.cpp",
"rs_display_effect/property_display/geom_pivotandrotation_test.cpp",
"rs_display_effect/property_display/geom_rotation_test.cpp",
"rs_display_effect/property_display/geom_scale_test.cpp",
"rs_display_effect/property_display/geom_skew_test.cpp",
"rs_display_effect/property_display/geom_transform_test.cpp",
"rs_display_effect/property_display/geom_translation_test.cpp",
"rs_display_effect/property_display/material_quality_level_test.cpp",
"rs_display_effect/property_display/modifier_attach_property_test.cpp",
"rs_display_effect/property_display/modifier_bounds_applygeometry_test.cpp",
"rs_display_effect/property_display/modifier_detach_property_test.cpp",
"rs_display_effect/property_display/particle_ripple_test.cpp",
"rs_display_effect/property_display/particle_velocity_test.cpp",
"rs_display_effect/property_display/rs_canvas_node_getbitmap_getpixelmap_test.cpp",
"rs_display_effect/property_display/rs_canvas_node_setpixelmap_test.cpp",
"rs_display_effect/property_display/rs_node_comprehensive_test.cpp",
"rs_display_effect/property_display/rs_node_name_colorpicker_test.cpp",
"rs_display_effect/property_display/surface_composite_layer_test.cpp",
"rs_display_effect/property_display/surface_node_properties_test.cpp",
"rs_display_effect/property_display/surface_texture_export_test.cpp",
]
rs_effect_feature_sources = [
"rs_effect_feature/effect_background_blur_test.cpp",
"rs_effect_feature/effect_ai_bar_glow_test.cpp",
"rs_effect_feature/effect_aurora_noise_test.cpp",
"rs_effect_feature/effect_linear_gradient_blur_test.cpp",
"rs_effect_feature/effect_light_cave_test.cpp",
"rs_effect_feature/effect_particle_circular_halo_test.cpp",
"rs_effect_feature/effect_pixel_stretch_test.cpp",
"rs_effect_feature/effect_gradient_flow_colors_test.cpp",
"rs_effect_feature/effect_wavy_ripple_light_test.cpp",
"rs_effect_feature/effect_distort_chroma_test.cpp",
"rs_effect_feature/ng_effect_test/ng_colorgradient_effect_test.cpp",
"rs_effect_feature/ng_effect_test/ng_effect_test.cpp",
"rs_effect_feature/ng_mask_test/ng_mask_image_test.cpp",
"rs_effect_feature/ng_mask_test/ng_mask_use_effect_test.cpp",
"rs_effect_feature/ng_mask_test/ng_mask_ripple_test.cpp",
"rs_effect_feature/ng_mask_test/ng_mask_radial_gradient_test.cpp",
"rs_effect_feature/ng_mask_test/ng_mask_wave_gradient_test.cpp",
"rs_effect_feature/ng_mask_test/ng_mask_pixel_map_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_harmonium_effect_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_wavy_ripple_light_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_border_light_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_circle_flowlight_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_contour_diagonal_flow_light_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_dot_matrix_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_aurora_noise_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_particle_circular_halo_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_light_cave_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_gradient_flow_colors_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_rounded_rect_flowlight_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_distort_chroma_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_ai_bar_glow_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_ai_bar_rect_halo_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_color_gradient_effect_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_frosted_glass_effect_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_spatial_point_light_test.cpp",
"rs_effect_feature/ng_shader_test/ng_shader_border_sdf_test.cpp",
"rs_effect_feature/ng_effect_test/ng_substracted_rect_test.cpp",
"rs_effect_feature/ng_effect_test/ng_hdrdarken_blender_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_content_light_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_dispersion_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_frosted_glass_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_gasify_blur_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_gasify_scale_twist_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_gasify_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_grid_warp_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_particle_ablation_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_magnifier_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_distortion_collapse_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_blur_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_edge_light_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_frosted_glass_blur_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_mask_transition_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_sdf_edge_light_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_variable_radius_blur_test.cpp",
"rs_effect_feature/ng_shape_test/ng_filter_sdf_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_test_utils.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_shape_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_distort_op_shape_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_path_shape_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_ellipse_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_sub_op_shape_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_rrect_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_triangle_test.cpp",
"rs_effect_feature/ng_shape_test/ng_sdf_test_utils.cpp",
"rs_effect_feature/ui_filter_test/ui_filter_test.cpp",
"rs_effect_feature/ui_filter_test/ui_filter_test_data_manager.cpp",
"rs_effect_feature/ui_filter_test/ui_filter_test_factory.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_bezier_warp_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_blur_extend_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_direction_light_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_dispersion_extend_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_edge_light_extend_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_material_blur_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_other_extend_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_sound_wave_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_heat_distortion_test.cpp",
"rs_effect_feature/ng_filter_test/ng_filter_blur_bubbles_rise_test.cpp",
"rs_effect_feature/ng_effect_test/ng_mask_frame_gradient_test.cpp",
]
rs_framework_sources = [
"rs_framework/uni_render_ui/surface_test.cpp",
]
rs_func_feature_sources = [
"rs_func_feature/color_space_and_hdr/color_space_test.cpp",
"rs_func_feature/component_capture/demo.cpp",
"rs_func_feature/multi_instance/demo.cpp",
"rs_func_feature/multi_screen/logical_display_node_test.cpp",
"rs_func_feature/multi_screen/multi_screen_test.cpp",
"rs_func_feature/multi_screen/screen_manager_test.cpp",
"rs_func_feature/screen_capture/display_node_capture_test.cpp",
"rs_func_feature/special_layer/security_layer_test.cpp",
"rs_func_feature/special_layer/skip_layer_test.cpp",
"rs_func_feature/special_layer/snapshot_skip_layer_test.cpp",
"rs_func_feature/surface_capture/surface_capture_demo.cpp",
"rs_func_feature/surface_capture/self_surface_capture_demo.cpp",
"rs_func_feature/solonode_surface_capture/solonode_surface_capture_demo.cpp",
"rs_func_feature/ui_capture_in_range/ui_capture_in_range_demo.cpp",
"rs_func_feature/window_freeze_immediately/window_freeze_immediately_demo.cpp",
"rs_func_feature/watermark/watermark.cpp",
"rs_func_feature/accessibility/curtain_screen_test.cpp",
"rs_func_feature/clonenode/clone_node_test.cpp",
"rs_func_feature/register_buffer_available_callback/register_buffer_available_callback_test.cpp",
"rs_func_feature/camera_rotation_feature/rotation_correction_test.cpp",
"rs_func_feature/render_group/render_group_test.cpp",
]
rs_perform_feature_sources = [
"rs_perform_feature/dirty_region/boundary_test.cpp",
"rs_perform_feature/dirty_region/dirty_region_manager_test.cpp",
"rs_perform_feature/dirty_region/filter_test.cpp",
"rs_perform_feature/dirty_region/merge_dirty_rect_test.cpp",
"rs_perform_feature/dirty_region/merge_dirty_history_test.cpp",
"rs_perform_feature/dirty_region/partialrender_filter_test.cpp",
"rs_perform_feature/dirty_region/pixel_stretch_dirty_test.cpp",
"rs_perform_feature/dirty_region/subsurface_test.cpp",
"rs_perform_feature/dirty_region/uni_render_util_test.cpp",
"rs_perform_feature/dirty_region/update_self_draw_rect_test.cpp",
"rs_perform_feature/hwc/hwc_test.cpp",
"rs_perform_feature/gpu_composer/gpu_composer_test.cpp",
]
effect_kit_sources = [
"effect_kit/oh_filter_test/oh_filter_blur_cascade_test.cpp",
"effect_kit/oh_filter_test/oh_filter_blurwithdirection_test.cpp",
"effect_kit/oh_filter_test/oh_filter_cascade_test.cpp",
"effect_kit/oh_filter_test/oh_filter_gammacorrection_test.cpp",
"effect_kit/oh_filter_test/oh_filter_mapcolorbybrightness_test.cpp",
"effect_kit/oh_filter_test/oh_filter_masktransition_test.cpp",
"effect_kit/oh_filter_test/oh_filter_reededglass_test.cpp",
"effect_kit/oh_filter_test/oh_filter_waterdroplettransition_test.cpp",
"effect_kit/oh_filter_test/oh_filter_waterglass_test.cpp",
"effect_kit/oh_filter_test/oh_filter_test_utils.cpp",
]
group("test") {
testonly = true
deps = [
":RSGraphicTest",
":RenderServiceRenderProfilerTest",
]
}
## Build RSGraphicTest
ohos_unittest("RSGraphicTest") {
module_out_path = module_output_path
sources = []
sources += drawing_engine_sources
sources += hardware_manager_sources
sources += open_capability_sources
sources += rs_display_effect_sources
sources += rs_effect_feature_sources
sources += rs_framework_sources
sources += rs_func_feature_sources
sources += rs_perform_feature_sources
sources += effect_kit_sources
include_dirs = [
"$graphic_2d_root/rosen/modules/effect",
"$rosen_text_root/adapter/skia",
"rs_effect_feature/ng_shape_test",
]
deps = [
"$graphic_2d_root/graphic_test/graphic_test_framework:rs_graphic_test_main",
"$graphic_2d_root/rosen/modules/effect/effect_ndk:native_effect_ndk",
"$rosen_text_root:rosen_text",
]
defines = []
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libnativetoken",
"access_token:libtoken_setproc",
"c_utils:utils",
"eventhandler:libeventhandler",
"graphic_surface:surface",
"hilog:libhilog",
"init:libbegetutil",
"selinux_adapter:librestorecon",
"image_framework:image_native",
"image_framework:pixelmap",
"image_framework:pixelmap_ndk",
"napi:ace_napi",
"cJSON:cjson",
"googletest:gtest",
"graphics_effect:graphics_effect_core",
"hitrace:hitrace_meter",
"libpng:libpng",
"window_manager:libdm",
"zlib:libz",
]
defines += gpu_defines
cflags = [
"-Wall",
"-Werror",
"-g3",
"-Dprivate=public",
"-Dprotected=public",
]
subsystem_name = "graphic"
part_name = "graphic_2d"
}
## Build RenderServiceRenderProfilerTest
ohos_unittest("RenderServiceRenderProfilerTest") {
module_out_path = module_output_path
enable_profiler_cmd_test = false
sources = [
"render_service_render_profiler_test.cpp"
]
include_dirs = [
"$graphic_2d_root/rosen/modules/render_service_profiler",
]
sanitize = {
cfi = true
cfi_cross_dso = true
debug = false
}
deps = [
"$graphic_2d_root/rosen/modules/render_service:librender_service",
"$graphic_2d_root/rosen/modules/render_service_base:librender_service_base",
"$graphic_2d_root/rosen/modules/render_service_client:librender_service_client",
]
if (enable_profiler_cmd_test) {
deps += [ "$graphic_2d_root/graphic_test/graphic_test_framework:rs_graphic_test_main" ]
}
defines = []
external_deps = [
"c_utils:utils",
"hilog:libhilog",
"image_framework:image_native",
"window_manager:libdm",
"window_manager:sms",
]
if (rosen_is_ohos && graphic_2d_feature_rs_enable_profiler &&
player_framework_enable) {
defines += [ "RS_PROFILER_ENABLED" ]
}
if (enable_profiler_cmd_test) {
defines += [ "ENABLE_PROFILER_CMD_TEST" ]
}
part_name = "graphic_2d"
subsystem_name = "graphic"
}