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/adapter/uhdf2/uhdf.gni") 19} 20 21if (defined(ohos_lite)) { 22 unittest("hdf_peripheral_wlan_test") { 23 output_extension = "bin" 24 output_dir = "$root_out_dir/test/unittest/hdf" 25 include_dirs = [ 26 "//third_party/googletest/googletest/include", 27 "//third_party/bounds_checking_function/include", 28 "//drivers/framework/ability/sbuf/include", 29 "//drivers/framework/include/platform", 30 "//drivers/framework/include/core", 31 "//drivers/framework/include/osal", 32 "//drivers/adapter/uhdf/posix/include", 33 "//drivers/framework/include/utils", 34 "//drivers/framework/include/config", 35 "//drivers/framework/include", 36 "//drivers/peripheral/wlan/client/include", 37 "//drivers/peripheral/wlan/hal/include", 38 "//drivers/peripheral/wlan/interfaces/include", 39 "//drivers/framework/test/unittest/include", 40 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 41 ] 42 43 sources = [ 44 "//drivers/peripheral/wlan/test/unittest/common/hdf_client_test.cpp", 45 "//drivers/peripheral/wlan/test/unittest/common/hdf_flow_control_test.cpp", 46 "//drivers/peripheral/wlan/test/unittest/common/hdf_message_test.cpp", 47 "//drivers/peripheral/wlan/test/unittest/common/hdf_module_test.cpp", 48 "//drivers/peripheral/wlan/test/unittest/common/hdf_net_buff_test.cpp", 49 "//drivers/peripheral/wlan/test/unittest/common/hdf_net_device_test.cpp", 50 "//drivers/peripheral/wlan/test/unittest/common/wifi_hal_test.cpp", 51 ] 52 deps = [ 53 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 54 "//drivers/adapter/uhdf/manager:hdf_core", 55 "//drivers/adapter/uhdf/platform:hdf_platform", 56 "//drivers/adapter/uhdf/posix:hdf_posix_osal", 57 "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", 58 "//drivers/peripheral/wlan/client:hdi_wifi", 59 "//drivers/peripheral/wlan/hal:wifi_hal_interface", 60 ] 61 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 62 cflags = [ 63 "-Wall", 64 "-Wextra", 65 "-Werror", 66 "-fsigned-char", 67 "-fno-common", 68 "-fno-strict-aliasing", 69 ] 70 } 71} else { 72 module_output_path = "hdf/wlan" 73 ohos_unittest("hdf_unittest_wifi") { 74 module_out_path = module_output_path 75 include_dirs = [ 76 "//drivers/framework/test/unittest/include", 77 "//drivers/peripheral/wlan/client/include", 78 "//drivers/peripheral/wlan/hal/include", 79 "//drivers/peripheral/wlan/interfaces/include", 80 ] 81 sources = [ 82 "./common/hdf_client_test.cpp", 83 "./common/hdf_flow_control_test.cpp", 84 "./common/hdf_message_test.cpp", 85 "./common/hdf_module_test.cpp", 86 "./common/hdf_net_buff_test.cpp", 87 "./common/hdf_net_device_test.cpp", 88 "./common/wifi_hal_test.cpp", 89 ] 90 cflags = [ 91 "-Wall", 92 "-Wextra", 93 "-Werror", 94 "-fsigned-char", 95 "-fno-common", 96 "-fno-strict-aliasing", 97 ] 98 deps = [ 99 "$hdf_uhdf_path/osal:libhdf_utils", 100 "$hdf_uhdf_path/test/unittest/common:libhdf_test_common", 101 "//drivers/peripheral/wlan/client:wifi_driver_client", 102 "//drivers/peripheral/wlan/hal:wifi_hal", 103 "//utils/native/base:utils", 104 ] 105 if (is_standard_system) { 106 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 107 } else { 108 external_deps = [ "hilog:libhilog" ] 109 } 110 } 111} 112