• 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/lite/config/test.gni")
15
16if (board_name == "hi3516dv300" || board_name == "hispark_taurus") {
17  unittest("hdf_adapter_uhdf_test_platform") {
18    output_extension = "bin"
19    output_dir = "$root_out_dir/test/unittest/hdf"
20    include_dirs = [
21      "//third_party/googletest/googletest/include",
22      "//third_party/bounds_checking_function/include",
23      "//drivers/framework/include/platform",
24      "//drivers/framework/include/core",
25      "//drivers/framework/include/osal",
26      "//drivers/adapter/uhdf/posix/include",
27      "//drivers/framework/include/utils",
28      "//drivers/framework/include",
29      "//drivers/framework/test/unittest/include",
30      "//drivers/framework/test/unittest/platform/common",
31      "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
32    ]
33
34    defines = [ "__USER__" ]
35    if (ohos_kernel_type == "liteos_a") {
36      defines += [ "HDF_LITEOS_TEST" ]
37    }
38    sources = [
39      "//drivers/framework/support/platform/test/unittest/common/hdf_gpio_test.cpp",
40      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_device_test.cpp",
41      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_event_test.cpp",
42      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_manager_test.cpp",
43      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_queue_test.cpp",
44      "//drivers/framework/support/platform/test/unittest/common/hdf_pwm_test.cpp",
45      "//drivers/framework/support/platform/test/unittest/common/hdf_regulator_test.cpp",
46      "//drivers/framework/support/platform/test/unittest/common/hdf_rtc_test.cpp",
47      "//drivers/framework/support/platform/test/unittest/common/hdf_spi_test.cpp",
48      "//drivers/framework/support/platform/test/unittest/common/hdf_uart_test.cpp",
49      "//drivers/framework/support/platform/test/unittest/common/hdf_watchdog_test.cpp",
50      "//drivers/framework/test/unittest/platform/common/gpio_test.c",
51      "//drivers/framework/test/unittest/platform/common/pwm_test.c",
52      "//drivers/framework/test/unittest/platform/common/rtc_test.c",
53      "//drivers/framework/test/unittest/platform/common/spi_test.c",
54      "//drivers/framework/test/unittest/platform/common/uart_test.c",
55      "//drivers/framework/test/unittest/platform/common/watchdog_test.c",
56    ]
57    if (ohos_kernel_type == "liteos_a") {
58      sources += [
59        "//drivers/framework/support/platform/test/unittest/common/hdf_adc_test.cpp",
60        "//drivers/framework/support/platform/test/unittest/common/hdf_dac_test.cpp",
61        "//drivers/framework/support/platform/test/unittest/common/hdf_i2s_test.cpp",
62        "//drivers/framework/support/platform/test/unittest/common/hdf_i3c_test.cpp",
63        "//drivers/framework/support/platform/test/unittest/common/hdf_mipi_csi_test.cpp",
64        "//drivers/framework/support/platform/test/unittest/common/hdf_pcie_test.cpp",
65        "//drivers/framework/support/platform/test/unittest/common/hdf_pin_test.cpp",
66        "//drivers/framework/support/platform/test/unittest/common/hdf_timer_test.cpp",
67        "//drivers/framework/test/unittest/platform/common/adc_test.c",
68        "//drivers/framework/test/unittest/platform/common/dac_test.c",
69        "//drivers/framework/test/unittest/platform/common/timer_test.c",
70      ]
71    }
72    if (storage_type == "emmc") {
73      sources += [
74        "//drivers/framework/support/platform/test/unittest/common/hdf_emmc_test.cpp",
75        "//drivers/framework/support/platform/test/unittest/common/hdf_i2c_test.cpp",
76        "//drivers/framework/test/unittest/platform/common/i2c_test.c",
77      ]
78    }
79    deps = [
80      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
81      "//drivers/adapter/build/test_common:libhdf_test_common",
82      "//drivers/adapter/uhdf/manager:hdf_core",
83      "//drivers/adapter/uhdf/platform:hdf_platform",
84      "//drivers/adapter/uhdf/posix:hdf_posix_osal",
85    ]
86    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
87    cflags = [
88      "-Wall",
89      "-Wextra",
90      "-Werror",
91      "-fsigned-char",
92      "-fno-common",
93      "-fno-strict-aliasing",
94    ]
95  }
96} else if (board_name == "hi3518ev300" || board_name == "hispark_aries") {
97  unittest("hdf_adapter_uhdf_test_platform") {
98    output_extension = "bin"
99    output_dir = "$root_out_dir/test/unittest/hdf"
100    include_dirs = [
101      "//third_party/googletest/googletest/include",
102      "//third_party/bounds_checking_function/include",
103      "//drivers/framework/include/platform",
104      "//drivers/framework/include/core",
105      "//drivers/framework/include/osal",
106      "//drivers/adapter/uhdf/posix/include",
107      "//drivers/framework/include/utils",
108      "//drivers/framework/include",
109      "//drivers/framework/test/unittest/include",
110      "//drivers/framework/test/unittest/platform/common",
111      "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
112    ]
113
114    defines = [ "__USER__" ]
115    sources = [
116      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_device_test.cpp",
117      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_event_test.cpp",
118      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_manager_test.cpp",
119      "//drivers/framework/support/platform/test/unittest/common/hdf_platform_queue_test.cpp",
120      "//drivers/framework/support/platform/test/unittest/common/hdf_spi_test.cpp",
121      "//drivers/framework/support/platform/test/unittest/common/hdf_uart_test.cpp",
122      "//drivers/framework/support/platform/test/unittest/common/hdf_watchdog_test.cpp",
123      "//drivers/framework/test/unittest/platform/common/spi_test.c",
124    ]
125    if (storage_type == "emmc") {
126      sources += [
127        "//drivers/framework/support/platform/test/unittest/common/hdf_gpio_test.cpp",
128        "//drivers/framework/support/platform/test/unittest/common/hdf_sdio_test.cpp",
129      ]
130    }
131    deps = [
132      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
133      "//drivers/adapter/build/test_common:libhdf_test_common",
134      "//drivers/adapter/uhdf/manager:hdf_core",
135      "//drivers/adapter/uhdf/platform:hdf_platform",
136      "//drivers/adapter/uhdf/posix:hdf_posix_osal",
137    ]
138    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
139    cflags = [
140      "-Wall",
141      "-Wextra",
142      "-Werror",
143      "-fsigned-char",
144      "-fno-common",
145      "-fno-strict-aliasing",
146    ]
147  }
148}
149