• 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/test.gni")
16} else {
17  import("//build/test.gni")
18  import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni")
19}
20
21configFlag = [
22  "-Wall",
23  "-Wextra",
24  "-Werror",
25  "-fsigned-char",
26  "-fno-common",
27  "-fno-strict-aliasing",
28]
29
30if (defined(ohos_lite)) {
31  unittest("hdf_common_wifi") {
32    output_extension = "bin"
33    output_dir = "$root_out_dir/test/unittest/hdf"
34    include_dirs = [
35      "//third_party/bounds_checking_function/include",
36      "//drivers/hdf_core/framework/include/platform",
37      "//drivers/hdf_core/framework/include/core",
38      "//drivers/hdf_core/framework/include",
39      "//drivers/hdf_core/framework/test/unittest/include",
40      "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits",
41    ]
42
43    sources = [
44      "//drivers/peripheral/wlan/test/unittest/common/hdf_flow_control_test.cpp",
45      "//drivers/peripheral/wlan/test/unittest/common/hdf_message_test.cpp",
46      "//drivers/peripheral/wlan/test/unittest/common/hdf_module_test.cpp",
47      "//drivers/peripheral/wlan/test/unittest/common/hdf_net_buff_test.cpp",
48      "//drivers/peripheral/wlan/test/unittest/common/hdf_net_device_test.cpp",
49    ]
50    deps = [
51      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
52      "//drivers/hdf_core/adapter/build/test_common:libhdf_test_common",
53      "//drivers/hdf_core/adapter/uhdf/manager:hdf_core",
54      "//drivers/hdf_core/adapter/uhdf/platform:hdf_platform",
55    ]
56    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
57
58    cflags = configFlag
59  }
60
61  unittest("hdf_hal_wifi") {
62    output_extension = "bin"
63    output_dir = "$root_out_dir/test/unittest/hdf"
64    include_dirs = [
65      "//third_party/bounds_checking_function/include",
66      "//drivers/hdf_core/framework/include/osal",
67      "//drivers/hdf_core/adapter/uhdf/posix/include",
68      "//drivers/hdf_core/framework/include/utils",
69      "//drivers/hdf_core/framework/include",
70      "//drivers/peripheral/wlan/client/include",
71      "//drivers/peripheral/wlan/hal/include",
72      "//drivers/peripheral/wlan/interfaces/include",
73    ]
74
75    sources =
76        [ "//drivers/peripheral/wlan/test/unittest/hal/wifi_hal_test.cpp" ]
77    deps = [
78      "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
79      "//drivers/peripheral/wlan/client:wifi_driver_client",
80      "//drivers/peripheral/wlan/hal:wifi_hal",
81    ]
82    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
83
84    cflags = configFlag
85  }
86
87  unittest("hdf_client_wifi") {
88    output_extension = "bin"
89    output_dir = "$root_out_dir/test/unittest/hdf"
90    include_dirs = [
91      "//third_party/bounds_checking_function/include",
92      "//drivers/hdf_core/framework/include/osal",
93      "//drivers/hdf_core/adapter/uhdf/posix/include",
94      "//drivers/hdf_core/framework/include/utils",
95      "//drivers/hdf_core/framework/include",
96      "//drivers/peripheral/wlan/client/include",
97      "//drivers/peripheral/wlan/hal/include",
98      "//drivers/peripheral/wlan/interfaces/include",
99    ]
100
101    sources =
102        [ "//drivers/peripheral/wlan/test/unittest/client/hdf_client_test.cpp" ]
103    deps = [
104      "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal",
105      "//drivers/peripheral/wlan/client:wifi_driver_client",
106    ]
107    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
108
109    cflags = configFlag
110  }
111} else {
112  module_output_path = "hdf/wlan"
113  ohos_unittest("hdf_common_wifi") {
114    module_out_path = module_output_path
115    include_dirs = [
116      "//drivers/peripheral/wlan/client/include",
117      "//drivers/peripheral/wlan/hal/include",
118      "//drivers/peripheral/wlan/interfaces/include",
119    ]
120    sources = [
121      "./common/hdf_flow_control_test.cpp",
122      "./common/hdf_message_test.cpp",
123      "./common/hdf_module_test.cpp",
124      "./common/hdf_net_buff_test.cpp",
125      "./common/hdf_net_device_test.cpp",
126    ]
127    resource_config_file =
128        "//drivers/hdf_core/adapter/uhdf2/test/resource/wlan/ohos_test.xml"
129
130    cflags = configFlag
131    deps = [ "//drivers/hdf_core/adapter/build/test_common:libhdf_test_common" ]
132    if (is_standard_system) {
133      external_deps = [
134        "c_utils:utils",
135        "hiviewdfx_hilog_native:libhilog",
136      ]
137    } else {
138      external_deps = [ "hilog:libhilog" ]
139    }
140  }
141
142  ohos_unittest("hdf_hal_wifi") {
143    module_out_path = module_output_path
144    include_dirs = [
145      "//drivers/peripheral/wlan/client/include",
146      "//drivers/peripheral/wlan/hal/include",
147      "//drivers/peripheral/wlan/interfaces/include",
148    ]
149    sources = [ "./hal/wifi_hal_test.cpp" ]
150    resource_config_file =
151        "//drivers/hdf_core/adapter/uhdf2/test/resource/wlan/ohos_test.xml"
152
153    cflags = configFlag
154    deps = [
155      "//drivers/peripheral/wlan/client:wifi_driver_client",
156      "//drivers/peripheral/wlan/hal:wifi_hal",
157    ]
158    if (is_standard_system) {
159      external_deps = [
160        "c_utils:utils",
161        "hdf_core:libhdf_utils",
162        "hiviewdfx_hilog_native:libhilog",
163      ]
164    } else {
165      external_deps = [ "hilog:libhilog" ]
166    }
167  }
168
169  ohos_unittest("hdf_client_wifi") {
170    module_out_path = module_output_path
171    include_dirs = [
172      "//drivers/peripheral/wlan/client/include",
173      "//drivers/peripheral/wlan/hal/include",
174      "//drivers/peripheral/wlan/interfaces/include",
175    ]
176    sources = [ "./client/hdf_client_test.cpp" ]
177    resource_config_file =
178        "//drivers/hdf_core/adapter/uhdf2/test/resource/wlan/ohos_test.xml"
179
180    cflags = configFlag
181    deps = [ "//drivers/peripheral/wlan/client:wifi_driver_client" ]
182    if (is_standard_system) {
183      external_deps = [
184        "c_utils:utils",
185        "hdf_core:libhdf_utils",
186        "hiviewdfx_hilog_native:libhilog",
187      ]
188    } else {
189      external_deps = [ "hilog:libhilog" ]
190    }
191  }
192}
193