From d4ee9fbf4beb13539d059151f1f80c0a4f766583 Mon Sep 17 00:00:00 2001 From: liufeihu Date: Thu, 11 Mar 2021 17:21:14 +0800 Subject: [PATCH] Description: Modify component build for drivers subsystem Team:OTHERS Feature or Bugfix: Feature Binary Source: No PrivateCode(Yes/No): No Change-Id: I1cd0ecaa6ac46b00700b6800603fcacbc9c68937 ChangeID:13298793 --- test/BUILD.gn | 18 ++--- test/performance/BUILD.gn | 122 ++++++++++--------------------- test/unittest/BUILD.gn | 146 ++++++++++++-------------------------- 3 files changed, 95 insertions(+), 191 deletions(-) mode change 100755 => 100644 test/performance/BUILD.gn diff --git a/test/BUILD.gn b/test/BUILD.gn index e7dff42..bd8a17b 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -11,16 +11,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -group("hdf_unittest_wifi") { - if (board_name == "hi3516dv300" || board_name == "hispark_taurus") { - deps = [ - "performance:hdf_hi3516dv300_${ohos_kernel_type}_test_wifi_performance", - "unittest:hdf_hi3516dv300_${ohos_kernel_type}_test_wifi", - ] - } else if (board_name == "hi3518ev300" || board_name == "hispark_aries") { +import("//build/lite/config/component/lite_component.gni") +import("//build/lite/config/test.gni") + +lite_component("hdf_test_wlan") { + # add hdf subsystem unittest + if (ohos_build_type == "debug") { deps = [ - "performance:hdf_hi3518ev300_${ohos_kernel_type}_test_wifi_performance", - "unittest:hdf_hi3518ev300_${ohos_kernel_type}_test_wifi", + "performance:hdf_peripheral_wlan_test_performance", + "unittest:hdf_peripheral_wlan_test", ] } + features = [] } diff --git a/test/performance/BUILD.gn b/test/performance/BUILD.gn old mode 100755 new mode 100644 index baef810..7334bf1 --- a/test/performance/BUILD.gn +++ b/test/performance/BUILD.gn @@ -13,88 +13,44 @@ import("//build/lite/config/test.gni") -if (board_name == "hi3516dv300" || board_name == "hispark_taurus") { - unittest("hdf_hi3516dv300_${ohos_kernel_type}_test_wifi_performance") { - output_extension = "bin" - output_dir = "$root_out_dir/test/unittest/hdf" - include_dirs = [ - "//third_party/googletest/googletest/include", - "//third_party/bounds_checking_function/include", - "//drivers/framework/ability/sbuf/include", - "//drivers/framework/include/platform", - "//drivers/framework/include/core", - "//drivers/framework/include/osal", - "//drivers/adapter/uhdf/posix/include", - "//drivers/framework/include/utils", - "//drivers/framework/include/config", - "//drivers/framework/include", - "//drivers/peripheral/wlan/client/include", - "//drivers/peripheral/wlan/hal/include", - "//drivers/peripheral/wlan/interfaces/include", - "//drivers/framework/test/unittest/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", - ] +unittest("hdf_peripheral_wlan_test_performance") { + output_extension = "bin" + output_dir = "$root_out_dir/test/unittest/hdf" + include_dirs = [ + "//third_party/googletest/googletest/include", + "//third_party/bounds_checking_function/include", + "//drivers/framework/ability/sbuf/include", + "//drivers/framework/include/platform", + "//drivers/framework/include/core", + "//drivers/framework/include/osal", + "//drivers/adapter/uhdf/posix/include", + "//drivers/framework/include/utils", + "//drivers/framework/include/config", + "//drivers/framework/include", + "//drivers/peripheral/wlan/client/include", + "//drivers/peripheral/wlan/hal/include", + "//drivers/peripheral/wlan/interfaces/include", + "//drivers/framework/test/unittest/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", + ] - sources = [ "//drivers/peripheral/wlan/test/performance/common/hdf_wlan_performance_test.cpp" ] - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//drivers/adapter/uhdf/manager:hdf_core", - "//drivers/adapter/uhdf/platform:hdf_platform", - "//drivers/adapter/uhdf/posix:hdf_posix_osal", - "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", - "//drivers/peripheral/wlan/client:hdi_wifi", - "//drivers/peripheral/wlan/hal:wifi_hal_interface", - ] - public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - cflags = [ - "-Wall", - "-Wextra", - "-Werror", - "-fsigned-char", - "-fno-common", - "-fno-strict-aliasing", - ] - } -} else if (board_name == "hi3518ev300" || board_name == "hispark_aries") { - unittest("hdf_hi3518ev300_${ohos_kernel_type}_test_wifi_performance") { - output_extension = "bin" - output_dir = "$root_out_dir/test/unittest/hdf" - include_dirs = [ - "//third_party/googletest/googletest/include", - "//third_party/bounds_checking_function/include", - "//drivers/framework/ability/sbuf/include", - "//drivers/framework/include/platform", - "//drivers/framework/include/core", - "//drivers/framework/include/osal", - "//drivers/adapter/uhdf/posix/include", - "//drivers/framework/include/utils", - "//drivers/framework/include/config", - "//drivers/framework/include", - "//drivers/peripheral/wlan/client/include", - "//drivers/peripheral/wlan/hal/include", - "//drivers/peripheral/wlan/interfaces/include", - "//drivers/framework/test/unittest/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", - ] - - sources = [ "//drivers/peripheral/wlan/test/performance/common/hdf_wlan_performance_test.cpp" ] - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//drivers/adapter/uhdf/manager:hdf_core", - "//drivers/adapter/uhdf/platform:hdf_platform", - "//drivers/adapter/uhdf/posix:hdf_posix_osal", - "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", - "//drivers/peripheral/wlan/client:hdi_wifi", - "//drivers/peripheral/wlan/hal:wifi_hal_interface", - ] - public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - cflags = [ - "-Wall", - "-Wextra", - "-Werror", - "-fsigned-char", - "-fno-common", - "-fno-strict-aliasing", - ] - } + sources = [ "//drivers/peripheral/wlan/test/performance/common/hdf_wlan_performance_test.cpp" ] + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//drivers/adapter/uhdf/manager:hdf_core", + "//drivers/adapter/uhdf/platform:hdf_platform", + "//drivers/adapter/uhdf/posix:hdf_posix_osal", + "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", + "//drivers/peripheral/wlan/client:hdi_wifi", + "//drivers/peripheral/wlan/hal:wifi_hal_interface", + ] + public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] + cflags = [ + "-Wall", + "-Wextra", + "-Werror", + "-fsigned-char", + "-fno-common", + "-fno-strict-aliasing", + ] } diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 2bf73cb..737c71a 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -13,104 +13,52 @@ import("//build/lite/config/test.gni") -if (board_name == "hi3516dv300" || board_name == "hispark_taurus") { - unittest("hdf_hi3516dv300_${ohos_kernel_type}_test_wifi") { - output_extension = "bin" - output_dir = "$root_out_dir/test/unittest/hdf" - include_dirs = [ - "//third_party/googletest/googletest/include", - "//third_party/bounds_checking_function/include", - "//drivers/framework/ability/sbuf/include", - "//drivers/framework/include/platform", - "//drivers/framework/include/core", - "//drivers/framework/include/osal", - "//drivers/adapter/uhdf/posix/include", - "//drivers/framework/include/utils", - "//drivers/framework/include/config", - "//drivers/framework/include", - "//drivers/peripheral/wlan/client/include", - "//drivers/peripheral/wlan/hal/include", - "//drivers/peripheral/wlan/interfaces/include", - "//drivers/framework/test/unittest/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", - ] +unittest("hdf_peripheral_wlan_test") { + output_extension = "bin" + output_dir = "$root_out_dir/test/unittest/hdf" + include_dirs = [ + "//third_party/googletest/googletest/include", + "//third_party/bounds_checking_function/include", + "//drivers/framework/ability/sbuf/include", + "//drivers/framework/include/platform", + "//drivers/framework/include/core", + "//drivers/framework/include/osal", + "//drivers/adapter/uhdf/posix/include", + "//drivers/framework/include/utils", + "//drivers/framework/include/config", + "//drivers/framework/include", + "//drivers/peripheral/wlan/client/include", + "//drivers/peripheral/wlan/hal/include", + "//drivers/peripheral/wlan/interfaces/include", + "//drivers/framework/test/unittest/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", + ] - sources = [ - "//drivers/peripheral/wlan/test/unittest/common/hdf_client_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_flow_control_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_message_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_module_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_net_buff_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_net_device_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/wifi_hal_test.cpp", - ] - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//drivers/adapter/uhdf/manager:hdf_core", - "//drivers/adapter/uhdf/platform:hdf_platform", - "//drivers/adapter/uhdf/posix:hdf_posix_osal", - "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", - "//drivers/peripheral/wlan/client:hdi_wifi", - "//drivers/peripheral/wlan/hal:wifi_hal_interface", - ] - public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - cflags = [ - "-Wall", - "-Wextra", - "-Werror", - "-fsigned-char", - "-fno-common", - "-fno-strict-aliasing", - ] - } -} else if (board_name == "hi3518ev300" || board_name == "hispark_aries") { - unittest("hdf_hi3518ev300_${ohos_kernel_type}_test_wifi") { - output_extension = "bin" - output_dir = "$root_out_dir/test/unittest/hdf" - include_dirs = [ - "//third_party/googletest/googletest/include", - "//third_party/bounds_checking_function/include", - "//drivers/framework/ability/sbuf/include", - "//drivers/framework/include/platform", - "//drivers/framework/include/core", - "//drivers/framework/include/osal", - "//drivers/adapter/uhdf/posix/include", - "//drivers/framework/include/utils", - "//drivers/framework/include/config", - "//drivers/framework/include", - "//drivers/peripheral/wlan/client/include", - "//drivers/peripheral/wlan/hal/include", - "//drivers/peripheral/wlan/interfaces/include", - "//drivers/framework/test/unittest/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", - ] - - sources = [ - "//drivers/peripheral/wlan/test/unittest/common/hdf_client_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_flow_control_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_message_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_module_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_net_buff_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/hdf_net_device_test.cpp", - "//drivers/peripheral/wlan/test/unittest/common/wifi_hal_test.cpp", - ] - deps = [ - "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", - "//drivers/adapter/uhdf/manager:hdf_core", - "//drivers/adapter/uhdf/platform:hdf_platform", - "//drivers/adapter/uhdf/posix:hdf_posix_osal", - "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", - "//drivers/peripheral/wlan/client:hdi_wifi", - "//drivers/peripheral/wlan/hal:wifi_hal_interface", - ] - public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] - cflags = [ - "-Wall", - "-Wextra", - "-Werror", - "-fsigned-char", - "-fno-common", - "-fno-strict-aliasing", - ] - } + sources = [ + "//drivers/peripheral/wlan/test/unittest/common/hdf_client_test.cpp", + "//drivers/peripheral/wlan/test/unittest/common/hdf_flow_control_test.cpp", + "//drivers/peripheral/wlan/test/unittest/common/hdf_message_test.cpp", + "//drivers/peripheral/wlan/test/unittest/common/hdf_module_test.cpp", + "//drivers/peripheral/wlan/test/unittest/common/hdf_net_buff_test.cpp", + "//drivers/peripheral/wlan/test/unittest/common/hdf_net_device_test.cpp", + "//drivers/peripheral/wlan/test/unittest/common/wifi_hal_test.cpp", + ] + deps = [ + "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", + "//drivers/adapter/uhdf/manager:hdf_core", + "//drivers/adapter/uhdf/platform:hdf_platform", + "//drivers/adapter/uhdf/posix:hdf_posix_osal", + "//drivers/adapter/uhdf/test/unittest/common:hdf_test_common", + "//drivers/peripheral/wlan/client:hdi_wifi", + "//drivers/peripheral/wlan/hal:wifi_hal_interface", + ] + public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] + cflags = [ + "-Wall", + "-Wextra", + "-Werror", + "-fsigned-char", + "-fno-common", + "-fno-strict-aliasing", + ] } -- Gitee