• 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
14if (defined(ohos_lite)) {
15  import("//build/lite/config/component/lite_component.gni")
16  import("//build/lite/config/test.gni")
17} else {
18  import("//build/ohos.gni")
19  import("//build/test.gni")
20  import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
21}
22
23if (defined(ohos_lite)) {
24  unittest("hdf_peripheral_input_test") {
25    output_extension = "bin"
26    output_dir = "$root_out_dir/test/unittest/hdf"
27    include_dirs = [
28      "//third_party/googletest/googletest/include",
29      "//third_party/bounds_checking_function/include",
30      "//drivers/hdf_core/framework/include/platform",
31      "//drivers/hdf_core/framework/include/core",
32      "//drivers/hdf_core/framework/include/osal",
33      "//drivers/hdf_core/adapter/uhdf/posix/include",
34      "//drivers/hdf_core/framework/include/utils",
35      "//drivers/hdf_core/framework/include",
36      "//drivers/hdf_core/framework/test/unittest/include",
37      "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
38      "//drivers/peripheral/input/hal/include",
39      "//drivers/peripheral/input/interfaces/include",
40      "//third_party/FreeBSD/sys/dev/evdev",
41    ]
42
43    sources = [ "./common/hdi_input_test.cpp" ]
44    cflags = [
45      "-Wall",
46      "-Wextra",
47      "-Werror",
48      "-fsigned-char",
49      "-fno-common",
50      "-fno-strict-aliasing",
51    ]
52    if (ohos_build_compiler != "clang") {
53      cflags += [
54        "-Wno-format",
55        "-Wno-format-extra-args",
56      ]
57    }
58    deps = [
59      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
60      "//drivers/hdf_core/adapter/build/test_common:libhdf_test_common",
61      "//drivers/hdf_core/adapter/uhdf/manager:hdf_core",
62      "//drivers/hdf_core/adapter/uhdf/platform:hdf_platform",
63      "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
64      "//drivers/peripheral/input/hal:hdi_input",
65    ]
66    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
67  }
68} else {
69  module_output_path = "drivers_peripheral_input/input"
70  ohos_unittest("hdf_unittest_input") {
71    module_out_path = module_output_path
72    include_dirs = [
73      "//drivers/peripheral/input/hal/include",
74      "//drivers/peripheral/input/interfaces/include",
75    ]
76    sources = [ "./common/hdi_input_test.cpp" ]
77    cflags = [
78      "-Wall",
79      "-Wextra",
80      "-Werror",
81      "-fsigned-char",
82      "-fno-common",
83      "-fno-strict-aliasing",
84    ]
85    deps = [
86      "//drivers/hdf_core/adapter/build/test_common:libhdf_test_common",
87      "//drivers/peripheral/input/hal:hdi_input",
88    ]
89    if (is_standard_system) {
90      external_deps = [
91        "c_utils:utils",
92        "hdf_core:libhdf_utils",
93        "hiviewdfx_hilog_native:libhilog",
94      ]
95    } else {
96      external_deps = [ "hilog:libhilog" ]
97    }
98  }
99}
100