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