# 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("//build/test.gni") import("//device/board/${product_company}/${device_name}/device.gni") import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") import("//drivers/peripheral/camera/camera.gni") module_output_path = "$root_out_dir/test/unittest/hdf" config("v4l2_utest_config") { visibility = [ ":*" ] cflags = [ "-Wall", "-Wextra", "-Werror", "-Wno-error", "-DGST_DISABLE_DEPRECATED", "-DHAVE_CONFIG_H", "-DCOLORSPACE=\"videoconvert\"", "-fno-strict-aliasing", "-Wno-sign-compare", "-Wno-builtin-requires-header", "-Wno-unused-variable", "-Wno-unused-label", "-Wno-implicit-function-declaration", "-Wno-format", "-Wno-int-conversion", "-Wno-unused-function", "-Wno-thread-safety-attributes", "-Wno-inconsistent-missing-override", "-fno-rtti", "-fno-exceptions", "-ffunction-sections", "-fdata-sections", ] } ohos_unittest("v4l2_adapter_unittest") { test_type = "unittest" testonly = true module_out_path = module_output_path sources = [ "src/utest_v4l2.cpp" ] include_dirs = [ "$camera_path/include", "$camera_path/adapter/platform/v4l2/src/driver_adapter/include", "include", "//third_party/googletest/googletest/include/gtest", "//commonlibrary/c_utils/base/include", ] deps = [ "$board_camera_path/driver_adapter:camera_v4l2_adapter", "//third_party/googletest:gmock_main", "//third_party/googletest:gtest", "//third_party/googletest:gtest_main", ] defines += [ "V4L2_UTEST" ] if (is_standard_system) { external_deps = [ "c_utils:utils", "hdf_core:libhdf_utils", "hilog:libhilog", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", ] } public_configs = [ ":v4l2_utest_config" ] }