1# Copyright (c) 2021 - 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/test.gni") 15import("//device/board/${product_company}/${device_name}/device.gni") 16import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 17import("//drivers/peripheral/camera/camera.gni") 18 19module_output_path = "$root_out_dir/test/unittest/hdf" 20 21config("v4l2_utest_config") { 22 visibility = [ ":*" ] 23 24 cflags = [ 25 "-Wall", 26 "-Wextra", 27 "-Werror", 28 "-Wno-error", 29 "-DGST_DISABLE_DEPRECATED", 30 "-DHAVE_CONFIG_H", 31 "-DCOLORSPACE=\"videoconvert\"", 32 "-fno-strict-aliasing", 33 "-Wno-sign-compare", 34 "-Wno-builtin-requires-header", 35 "-Wno-unused-variable", 36 "-Wno-unused-label", 37 "-Wno-implicit-function-declaration", 38 "-Wno-format", 39 "-Wno-int-conversion", 40 "-Wno-unused-function", 41 "-Wno-thread-safety-attributes", 42 "-Wno-inconsistent-missing-override", 43 "-fno-rtti", 44 "-fno-exceptions", 45 "-ffunction-sections", 46 "-fdata-sections", 47 ] 48} 49 50ohos_unittest("v4l2_adapter_unittest") { 51 test_type = "unittest" 52 testonly = true 53 module_out_path = module_output_path 54 sources = [ "src/utest_v4l2_dev.cpp" ] 55 56 include_dirs = [ 57 "$camera_path/include", 58 "$camera_path/adapter/platform/v4l2/src/driver_adapter/include", 59 "include", 60 "//third_party/googletest/googletest/include/gtest", 61 "//commonlibrary/c_utils/base/include", 62 ] 63 64 deps = [ 65 "$board_camera_path/driver_adapter:camera_v4l2_adapter", 66 "//third_party/googletest:gmock_main", 67 "//third_party/googletest:gtest", 68 "//third_party/googletest:gtest_main", 69 ] 70 71 defines += [ "V4L2_UTEST" ] 72 73 if (is_standard_system) { 74 external_deps = [ 75 "c_utils:utils", 76 "hdf_core:libhdf_utils", 77 "hilog:libhilog", 78 ] 79 } else { 80 external_deps = [ 81 "c_utils:utils", 82 "hilog:libhilog", 83 ] 84 } 85 86 public_configs = [ ":v4l2_utest_config" ] 87} 88