# Copyright (c) 2021 - 2023 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("../../../camera.gni") ut_root_path = ".." if (defined(ohos_lite)) { import("//build/lite/config/test.gni") import("../../../../../hdf_core/adapter/uhdf/uhdf.gni") config("camera_ut_test_config") { visibility = [ ":*" ] cflags_cc = [] cflags_cc += [ "-std=c++17" ] } unittest("camera_test_v4l2_ut") { output_extension = "bin" output_dir = "$root_out_dir/test/unittest/hdf" sources = [ # buffer manager test "$ut_root_path/buffer_manager/buffer_manager_utest.cpp", ] include_dirs = [ # camera common includes "$camera_path/include", "$camera_path/../../interfaces/include", "$camera_path/../../interfaces/hdi_passthrough", "$camera_path/../../test/common/callback/include", "$camera_path/utils/event", # device manager includes "$camera_path/device_manager/include", # buffer manager includes "$camera_path/buffer_manager/include", "$camera_path/buffer_manager/src/buffer_adapter/lite", "//third_party/googletest/googletest/include", "$camera_path/../../base", "$camera_path/../../display/interfaces/include", # pipeline core includes "$camera_path/pipeline_core", "$camera_path/pipeline_core/host_stream/include", "$camera_path/pipeline_core/utils", "$camera_path/pipeline_core/nodes/include", "$camera_path/pipeline_core/nodes/src/node_base", "$camera_path/pipeline_core/nodes/src/sink_node", "$camera_path/pipeline_core/nodes/src/sensor_node", "$camera_path/pipeline_core/nodes/src/merge_node", "$camera_path/pipeline_core/nodes/src/dummy_node", "$camera_path/pipeline_core/pipeline_impl/include", "$camera_path/pipeline_core/pipeline_impl/src", "$camera_path/pipeline_core/include", "$camera_path/pipeline_core/pipeline_impl/src/builder", "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", "$camera_path/pipeline_core/pipeline_impl/src/parser", "$camera_path/pipeline_core/pipeline_impl/src/strategy", "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", "$camera_path/pipeline_core/ipp/include", ] public_deps = [ "$camera_path/buffer_manager:camera_buffer_manager" ] external_deps = [ "../../../../hdf_core/adapter/uhdf/manager:hdf_core", "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", "drivers_interface_camera:metadata", "graphic_chipsetsdk:surface", "hdf_core:hdf_posix_osal", ] } } else { import("//build/test.gni") import("../../../../../hdf_core/adapter/uhdf2/uhdf.gni") module_output_path = "drivers_peripheral_camera/camera" config("camera_ut_test_config") { visibility = [ ":*" ] cflags_cc = [ "-Wno-error", "-std=c++17", ] ldflags = [ "--coverage" ] } ohos_unittest("camera_test_v4l2_ut") { testonly = true module_out_path = module_output_path sources = [ # v4l2 adapter test "$ut_root_path/v4l2/camera_ability_test.cpp", "$ut_root_path/v4l2/camera_capture_test.cpp", "$ut_root_path/v4l2/camera_fps_test.cpp", "$ut_root_path/v4l2/camera_preview_test.cpp", "$ut_root_path/v4l2/camera_stabili_test.cpp", "$ut_root_path/v4l2/camera_video_test.cpp", "$ut_root_path/v4l2/double_preview_test.cpp", "$ut_root_path/v4l2/hdfcamera_facedetect.cpp", "$ut_root_path/v4l2/meta_data_test.cpp", "$ut_root_path/v4l2/stream_customer.cpp", "$ut_root_path/v4l2/test_camera_base.cpp", "$ut_root_path/v4l2/usb_camera_test.cpp", "$ut_root_path/v4l2/usb_camera_test_mult.cpp", ] include_dirs = [ # common includes "//third_party/googletest/googletest/include", "$camera_path/../../display/interfaces/include", "$camera_path/../../display/hdi_service/gralloc/include", # camera common includes "$camera_path/include", "$camera_path/../../interfaces/include", "$camera_path/../../interfaces/hdi_ipc", "$camera_path/utils/event", "$camera_path/../../interfaces/hdi_ipc/utils/include", "$camera_path/../../interfaces/hdi_ipc/callback/host/include", "$camera_path/../../interfaces/hdi_ipc/callback/device/include", "$camera_path/../../interfaces/hdi_ipc/callback/operator/include", "$camera_path/../../test/common/callback/include", # device manager includes "$camera_path/device_manager/include", # buffer manager includes "$camera_path/buffer_manager/include", "$camera_path/buffer_manager/src/buffer_adapter/standard", # pipeline core includes "$camera_path/pipeline_core", "$camera_path/pipeline_core/host_stream/include", "$camera_path/pipeline_core/utils", "$camera_path/pipeline_core/nodes/include", "$camera_path/pipeline_core/nodes/src/node_base", "$camera_path/pipeline_core/nodes/src/sink_node", "$camera_path/pipeline_core/nodes/src/sensor_node", "$camera_path/pipeline_core/nodes/src/merge_node", "$camera_path/pipeline_core/nodes/src/dummy_node", "$camera_path/pipeline_core/pipeline_impl/include", "$camera_path/pipeline_core/pipeline_impl/src", "$camera_path/pipeline_core/include", "$camera_path/pipeline_core/pipeline_impl/src/builder", "$camera_path/pipeline_core/pipeline_impl/src/dispatcher", "$camera_path/pipeline_core/pipeline_impl/src/parser", "$camera_path/pipeline_core/pipeline_impl/src/strategy", "$camera_path/pipeline_core/pipeline_impl/src/strategy/config", "$camera_path/pipeline_core/ipp/include", # hdi service includes "$camera_path/../../hdi_service/v1_0/include", # vdi impl includes "$camera_path/../v4l2/src/stream_operator/stream_tunnel/standard", # metadata manager includes "$camera_path/metadata_manager/include", ] deps = [ "$camera_path/../../hdi_service/v1_0:camera_host_service_1.0_static", "$camera_path/buffer_manager:camera_buffer_manager", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "drivers_interface_camera:libcamera_proxy_1.0", "drivers_interface_camera:libcamera_stub_1.0", "hdf_core:libhdf_utils", "hilog:libhilog", "samgr:samgr_proxy", ] } else { external_deps = [ "hilog:libhilog" ] } external_deps += [ "drivers_interface_camera:libbuffer_producer_sequenceable_1.0", "drivers_interface_camera:metadata", "graphic_chipsetsdk:surface", "ipc:ipc_single", "samgr:samgr_proxy", ] public_configs = [ ":camera_ut_test_config" ] } }