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