• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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/ohos.gni")
15import("//build/test.gni")
16import("../../../vibrator.gni")
17
18if (drivers_peripheral_vibrator_feature_model) {
19  module_output_path = "drivers_peripheral_vibrator/drivers_peripheral_vibrator"
20  ohos_unittest("hdf_unittest_hdi_vibrator") {
21    module_out_path = module_output_path
22    include_dirs = [
23      "../../../interfaces/include",
24      "../../../utils/include",
25    ]
26
27    sources = [ "hdf_vibrator_hdi_test.cpp" ]
28    cflags = [
29      "-Wall",
30      "-Wextra",
31      "-Werror",
32      "-fsigned-char",
33      "-fno-common",
34      "-fno-strict-aliasing",
35    ]
36    if (is_standard_system) {
37      external_deps = [
38        "drivers_interface_vibrator:libvibrator_proxy_1.1",
39        "drivers_interface_vibrator:libvibrator_proxy_1.2",
40        "drivers_interface_vibrator:libvibrator_proxy_1.3",
41        "hdf_core:libhdf_utils",
42        "hilog:libhilog",
43        "ipc:ipc_single",
44      ]
45      if (c_utils_enable) {
46        external_deps += [ "c_utils:utils" ]
47      }
48    } else {
49      external_deps = [ "hilog:libhilog" ]
50    }
51    external_deps += [ "ipc:ipc_single" ]
52  }
53} else {
54  ohos_unittest("hdi_unittest_vibrator") {
55    module_out_path = "drivers_peripheral_vibrator/drivers_peripheral_vibrator"
56    include_dirs = [
57      "../../../interfaces/include",
58      "../../../utils/include",
59    ]
60
61    sources = [ "hdi_unittest_vibrator.cpp" ]
62    cflags = [
63      "-Wall",
64      "-Wextra",
65      "-Werror",
66      "-fsigned-char",
67      "-fno-common",
68      "-fno-strict-aliasing",
69    ]
70    if (is_standard_system) {
71      external_deps = [
72        "drivers_interface_vibrator:libvibrator_proxy_2.0",
73        "hdf_core:libhdf_utils",
74        "hilog:libhilog",
75        "init:libbegetutil",
76        "ipc:ipc_single",
77      ]
78      if (c_utils_enable) {
79        external_deps += [ "c_utils:utils" ]
80      }
81    } else {
82      external_deps = [ "hilog:libhilog" ]
83    }
84    external_deps += [ "ipc:ipc_single" ]
85  }
86}
87