refactor: 内核测试套整改,简化分类
close: #I4OX3O Signed-off-by: arvinzzz <zhaotianyu9@huawei.com> Change-Id: I3ba65509135cee2ae3af82fec923a01e00ffdbe8
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
@@ -28,42 +27,25 @@
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//build/lite/config/test.gni")
|
||||
import("../../config.gni")
|
||||
import("//kernel/liteos_a/testsuites/unittest/config.gni")
|
||||
import("./config.gni")
|
||||
|
||||
config("net_local_config") {
|
||||
if (LOSCFG_USER_TEST_NET_RESOLV == true) {
|
||||
cflags = [ "-DLOSCFG_USER_TEST_NET_RESOLV" ]
|
||||
cflags_cc = cflags
|
||||
config("net_config") {
|
||||
cflags = []
|
||||
if (LOSCFG_USER_TEST_NET_NETDB == true) {
|
||||
cflags += [ "-DLOSCFG_USER_TEST_NET_NETDB" ]
|
||||
}
|
||||
if (LOSCFG_USER_TEST_NET_RESOLV == true) {
|
||||
cflags += [ "-DLOSCFG_USER_TEST_NET_RESOLV" ]
|
||||
}
|
||||
if (LOSCFG_USER_TEST_NET_SOCKET == true) {
|
||||
cflags += [ "-DLOSCFG_USER_TEST_NET_SOCKET" ]
|
||||
}
|
||||
cflags_cc = cflags
|
||||
}
|
||||
|
||||
common_include_dirs = [
|
||||
"//third_party/googletest/googletest/include",
|
||||
"../../common/include",
|
||||
"./",
|
||||
]
|
||||
|
||||
sources_entry = [
|
||||
"../../common/osTest.cpp",
|
||||
"net_resolv_test.cpp",
|
||||
]
|
||||
|
||||
sources_smoke = [
|
||||
"smoke/net_resolv_test_001.cpp",
|
||||
"smoke/net_resolv_test_002.cpp",
|
||||
"smoke/net_resolv_test_003.cpp",
|
||||
"smoke/net_resolv_test_006.cpp",
|
||||
"smoke/net_resolv_test_007.cpp",
|
||||
]
|
||||
|
||||
sources_full = [
|
||||
"full/net_resolv_test_004.cpp",
|
||||
"full/net_resolv_test_005.cpp",
|
||||
"full/net_resolv_test_008.cpp",
|
||||
]
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
|
||||
unittest("liteos_a_net_resolv_unittest_door") {
|
||||
unittest("liteos_a_net_unittest_door") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
@@ -71,22 +53,22 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
|
||||
sources += sources_smoke
|
||||
sources_full = []
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_door" ]
|
||||
configs += [ ":net_local_config" ]
|
||||
configs = [ "..:public_config_for_door" ]
|
||||
configs += [ ":net_config" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
|
||||
unittest("liteos_a_net_resolv_unittest") {
|
||||
unittest("liteos_a_net_unittest") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
sources += sources_smoke
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_all" ]
|
||||
configs += [ ":net_local_config" ]
|
||||
configs = [ "..:public_config_for_all" ]
|
||||
configs += [ ":net_config" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
68
testsuites/unittest/net/config.gni
Normal file
68
testsuites/unittest/net/config.gni
Normal file
@@ -0,0 +1,68 @@
|
||||
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//build/lite/config/test.gni")
|
||||
import("//kernel/liteos_a/testsuites/unittest/config.gni")
|
||||
|
||||
common_include_dirs = [
|
||||
"//third_party/googletest/googletest/include",
|
||||
"../common/include",
|
||||
]
|
||||
|
||||
sources_entry = [ "../common/osTest.cpp" ]
|
||||
|
||||
sources_smoke = []
|
||||
|
||||
sources_full = []
|
||||
|
||||
# netdb module
|
||||
if (LOSCFG_USER_TEST_NET_NETDB == true) {
|
||||
import("./netdb/config.gni")
|
||||
common_include_dirs += netdb_include_dirs
|
||||
sources_entry += netdb_sources_entry
|
||||
sources_smoke += netdb_sources_smoke
|
||||
sources_full += netdb_sources_full
|
||||
}
|
||||
|
||||
# resolv module
|
||||
if (LOSCFG_USER_TEST_NET_RESOLV == true) {
|
||||
import("./resolv/config.gni")
|
||||
common_include_dirs += resolv_include_dirs
|
||||
sources_entry += resolv_sources_entry
|
||||
sources_smoke += resolv_sources_smoke
|
||||
sources_full += resolv_sources_full
|
||||
}
|
||||
|
||||
# socket module
|
||||
if (LOSCFG_USER_TEST_NET_SOCKET == true) {
|
||||
import("./socket/config.gni")
|
||||
common_include_dirs += socket_include_dirs
|
||||
sources_entry += socket_sources_entry
|
||||
sources_smoke += socket_sources_smoke
|
||||
sources_full += socket_sources_full
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//build/lite/config/test.gni")
|
||||
import("../../config.gni")
|
||||
|
||||
config("net_local_config") {
|
||||
if (LOSCFG_USER_TEST_NET_NETDB == true) {
|
||||
cflags = [ "-DLOSCFG_USER_TEST_NET_NETDB" ]
|
||||
cflags_cc = cflags
|
||||
}
|
||||
}
|
||||
|
||||
common_include_dirs = [
|
||||
"//third_party/googletest/googletest/include",
|
||||
"../../common/include",
|
||||
"./",
|
||||
]
|
||||
|
||||
sources_entry = [
|
||||
"../../common/osTest.cpp",
|
||||
"net_netdb_test.cpp",
|
||||
]
|
||||
|
||||
sources_smoke = [
|
||||
"smoke/net_netdb_test_001.cpp",
|
||||
"smoke/net_netdb_test_013.cpp",
|
||||
]
|
||||
|
||||
sources_full = [
|
||||
"full/net_netdb_test_002.cpp",
|
||||
"full/net_netdb_test_003.cpp",
|
||||
"full/net_netdb_test_004.cpp",
|
||||
"full/net_netdb_test_005.cpp",
|
||||
"full/net_netdb_test_006.cpp",
|
||||
"full/net_netdb_test_007.cpp",
|
||||
"full/net_netdb_test_008.cpp",
|
||||
"full/net_netdb_test_009.cpp",
|
||||
"full/net_netdb_test_010.cpp",
|
||||
"full/net_netdb_test_011.cpp",
|
||||
"full/net_netdb_test_012.cpp",
|
||||
"full/net_netdb_test_014.cpp",
|
||||
"full/net_netdb_test_015.cpp",
|
||||
"full/net_netdb_test_016.cpp",
|
||||
"full/net_netdb_test_017.cpp",
|
||||
"full/net_netdb_test_018.cpp",
|
||||
"full/net_netdb_test_019.cpp",
|
||||
"full/net_netdb_test_020.cpp",
|
||||
"full/net_netdb_test_021.cpp",
|
||||
"full/net_netdb_test_022.cpp",
|
||||
]
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
|
||||
unittest("liteos_a_net_netdb_unittest_door") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
sources += sources_smoke
|
||||
sources_full = []
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_door" ]
|
||||
configs += [ ":net_local_config" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
|
||||
unittest("liteos_a_net_netdb_unittest") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
sources += sources_full
|
||||
sources += sources_smoke
|
||||
configs = [ "../..:public_config_for_all" ]
|
||||
configs += [ ":net_local_config" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
61
testsuites/unittest/net/netdb/config.gni
Normal file
61
testsuites/unittest/net/netdb/config.gni
Normal file
@@ -0,0 +1,61 @@
|
||||
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//kernel/liteos_a/testsuites/unittest/config.gni")
|
||||
|
||||
netdb_include_dirs = [ "$TEST_UNITTEST_DIR/net/netdb" ]
|
||||
|
||||
netdb_sources_entry = [ "$TEST_UNITTEST_DIR/net/netdb/net_netdb_test.cpp" ]
|
||||
|
||||
netdb_sources_smoke = [
|
||||
"$TEST_UNITTEST_DIR/net/netdb/smoke/net_netdb_test_001.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/smoke/net_netdb_test_013.cpp",
|
||||
]
|
||||
|
||||
netdb_sources_full = [
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_002.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_003.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_004.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_005.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_006.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_007.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_008.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_009.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_010.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_011.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_012.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_014.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_015.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_016.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_017.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_018.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_019.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_020.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_021.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/netdb/full/net_netdb_test_022.cpp",
|
||||
]
|
||||
47
testsuites/unittest/net/resolv/config.gni
Normal file
47
testsuites/unittest/net/resolv/config.gni
Normal file
@@ -0,0 +1,47 @@
|
||||
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//kernel/liteos_a/testsuites/unittest/config.gni")
|
||||
|
||||
resolv_include_dirs = [ "$TEST_UNITTEST_DIR/net/resolv" ]
|
||||
|
||||
resolv_sources_entry = [ "$TEST_UNITTEST_DIR/net/resolv/net_resolv_test.cpp" ]
|
||||
|
||||
resolv_sources_smoke = [
|
||||
"$TEST_UNITTEST_DIR/net/resolv/smoke/net_resolv_test_001.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/resolv/smoke/net_resolv_test_002.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/resolv/smoke/net_resolv_test_003.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/resolv/smoke/net_resolv_test_006.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/resolv/smoke/net_resolv_test_007.cpp",
|
||||
]
|
||||
|
||||
resolv_sources_full = [
|
||||
"$TEST_UNITTEST_DIR/net/resolv/full/net_resolv_test_004.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/resolv/full/net_resolv_test_005.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/resolv/full/net_resolv_test_008.cpp",
|
||||
]
|
||||
@@ -1,96 +0,0 @@
|
||||
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||
# Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//build/lite/config/test.gni")
|
||||
import("../../config.gni")
|
||||
|
||||
config("net_local_config") {
|
||||
if (LOSCFG_USER_TEST_NET_SOCKET == true) {
|
||||
cflags = [ "-DLOSCFG_USER_TEST_NET_SOCKET" ]
|
||||
cflags_cc = cflags
|
||||
}
|
||||
}
|
||||
|
||||
common_include_dirs = [
|
||||
"//third_party/googletest/googletest/include",
|
||||
"../../common/include",
|
||||
"./",
|
||||
]
|
||||
|
||||
sources_entry = [
|
||||
"../../common/osTest.cpp",
|
||||
"net_socket_test.cpp",
|
||||
]
|
||||
|
||||
sources_smoke = [
|
||||
"smoke/net_socket_test_001.cpp",
|
||||
"smoke/net_socket_test_002.cpp",
|
||||
"smoke/net_socket_test_003.cpp",
|
||||
"smoke/net_socket_test_004.cpp",
|
||||
"smoke/net_socket_test_005.cpp",
|
||||
"smoke/net_socket_test_006.cpp",
|
||||
"smoke/net_socket_test_007.cpp",
|
||||
"smoke/net_socket_test_008.cpp",
|
||||
"smoke/net_socket_test_009.cpp",
|
||||
"smoke/net_socket_test_010.cpp",
|
||||
"smoke/net_socket_test_011.cpp",
|
||||
"smoke/net_socket_test_012.cpp",
|
||||
"smoke/net_socket_test_013.cpp",
|
||||
]
|
||||
|
||||
sources_full = []
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
|
||||
unittest("liteos_a_net_socket_unittest_door") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
sources += sources_smoke
|
||||
sources_full = []
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_door" ]
|
||||
configs += [ ":net_local_config" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
|
||||
unittest("liteos_a_net_socket_unittest") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
sources += sources_smoke
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_all" ]
|
||||
configs += [ ":net_local_config" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
51
testsuites/unittest/net/socket/config.gni
Normal file
51
testsuites/unittest/net/socket/config.gni
Normal file
@@ -0,0 +1,51 @@
|
||||
# Copyright (c) 2022-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other materials
|
||||
# provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import("//kernel/liteos_a/testsuites/unittest/config.gni")
|
||||
|
||||
socket_include_dirs = [ "$TEST_UNITTEST_DIR/net/socket" ]
|
||||
|
||||
socket_sources_entry = [ "$TEST_UNITTEST_DIR/net/socket/net_socket_test.cpp" ]
|
||||
|
||||
socket_sources_smoke = [
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_001.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_002.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_003.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_004.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_005.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_006.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_007.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_008.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_009.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_010.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_011.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_012.cpp",
|
||||
"$TEST_UNITTEST_DIR/net/socket/smoke/net_socket_test_013.cpp",
|
||||
]
|
||||
|
||||
socket_sources_full = []
|
||||
Reference in New Issue
Block a user