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("../../light.gni")
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  HDF_CORE_PATH = "../../../../hdf_core"
26  unittest("hdf_peripheral_test_light") {
27    output_extension = "bin"
28    output_dir = "$root_out_dir/test/unittest/hdf"
29    include_dirs = [
30      "//third_party/bounds_checking_function/include",
31      "../../interfaces/include",
32    ]
33
34    sources = [ "common/hdf_light_test.cpp" ]
35    cflags = [
36      "-Wall",
37      "-Wextra",
38      "-Werror",
39      "-fsigned-char",
40      "-fno-common",
41      "-fno-strict-aliasing",
42    ]
43    public_deps = [
44      "$HDF_CORE_PATH/adapter/build/test_common:libhdf_test_common",
45      "$HDF_CORE_PATH/adapter/uhdf/manager:hdf_core",
46      "$HDF_CORE_PATH/adapter/uhdf/posix:hdf_posix_osal",
47      "../../hal:hdi_light",
48      "//third_party/bounds_checking_function:libsec_shared",
49    ]
50
51    external_deps = [ "hilog_lite:hilog_shared" ]
52  }
53} else {
54  module_output_path = "drivers_peripheral_light/light"
55  ohos_unittest("hdf_unittest_light") {
56    module_out_path = module_output_path
57    include_dirs = []
58
59    sources = [ "common/hdf_light_test.cpp" ]
60    cflags = [
61      "-Wall",
62      "-Wextra",
63      "-Werror",
64      "-fsigned-char",
65      "-fno-common",
66      "-fno-strict-aliasing",
67    ]
68    deps = [ "../../hal:hdi_light" ]
69    if (is_standard_system) {
70      external_deps = [
71        "hdf_core:libhdf_utils",
72        "hilog:libhilog",
73      ]
74      if (c_utils_enable) {
75        external_deps += [ "c_utils:utils" ]
76      }
77    } else {
78      external_deps = [ "hilog:libhilog" ]
79    }
80  }
81}
82