• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//drivers/adapter/uhdf2/uhdf.gni")
16import("//drivers/peripheral/camera/hal/camera.gni")
17
18module_output_path = "hdf/v4l2_adapter_test"
19
20config("v4l2_utest_config") {
21  visibility = [ ":*" ]
22
23  cflags = [
24    "-Wall",
25    "-Wextra",
26    "-Werror",
27    "-Wno-error",
28    "-DGST_DISABLE_DEPRECATED",
29    "-DHAVE_CONFIG_H",
30    "-DCOLORSPACE=\"videoconvert\"",
31    "-fno-strict-aliasing",
32    "-Wno-sign-compare",
33    "-Wno-builtin-requires-header",
34    "-Wno-unused-variable",
35    "-Wno-unused-label",
36    "-Wno-implicit-function-declaration",
37    "-Wno-format",
38    "-Wno-int-conversion",
39    "-Wno-unused-function",
40    "-Wno-thread-safety-attributes",
41    "-Wno-inconsistent-missing-override",
42    "-fno-rtti",
43    "-fno-exceptions",
44    "-ffunction-sections",
45    "-fdata-sections",
46  ]
47}
48
49ohos_unittest("v4l2_adapter_unittest") {
50  test_type = "unittest"
51  testonly = true
52  module_out_path = module_output_path
53  sources = [ "unittest/utest_v4l2.cpp" ]
54
55  include_dirs = [
56    "$camera_path/include",
57    "$camera_path/adapter/platform/v4l2/src/driver_adapter/include",
58    "$camera_device_name_path/camera/src/driver_adapter/test/unittest/include",
59    "//third_party/googletest/googletest/include/gtest",
60    "//utils/native/base/include",
61  ]
62
63  deps = [
64    "$camera_path/adapter/platform/v4l2/src/driver_adapter:camera_v4l2_adapter",
65    "//third_party/googletest:gmock_main",
66    "//third_party/googletest:gtest",
67    "//third_party/googletest:gtest_main",
68    "//utils/native/base:utils",
69  ]
70
71  defines += [ "V4L2_UTEST" ]
72
73  if (is_standard_system) {
74    external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
75  } else {
76    external_deps = [ "hilog:libhilog" ]
77  }
78
79  public_configs = [ ":v4l2_utest_config" ]
80}
81