feat(build): 使用xts -notest选项时,内核用例不参与编译构建和用例编译配置方式调整

【背景】
1.编译新增-notest选项为了排除用例参与构建,使用该选项时内核用例仍会参与构建,不符合预期
2.用例编译配置选项太多,需调整优化
【修改方案】
1.原内核用例的源文件是通过框架自带的source_set(一种虚拟静态库)的方式组织的,
不受unittests(自定义的一种方式)控制,修改为文件列表直接加入到unittest中。
2.编译配置通过level控制
【影响】
对现有的产品编译不会有影响。

Change-Id: I2c6a96e7276346de96f222b725d417418ff0e537
This commit is contained in:
lnlan
2021-05-28 14:25:54 +08:00
parent 3f16f1684a
commit 9bdf716407
34 changed files with 2506 additions and 2732 deletions

View File

@@ -48,65 +48,59 @@ sources_entry = [
"net_netdb_test.cpp",
]
source_set("sources_smoke") {
sources = [
"smoke/net_netdb_test_001.cpp",
"smoke/net_netdb_test_013.cpp",
]
configs += [ "../..:local_public_config" ]
include_dirs = common_include_dirs
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
sources_smoke = [
"smoke/net_netdb_test_001.cpp",
"smoke/net_netdb_test_013.cpp",
]
source_set("sources_other") {
sources = [
"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",
]
configs += [ "../..:local_public_config" ]
include_dirs = common_include_dirs
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
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",
]
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
configs = [ "../..:public_config_full" ]
configs += [ ":net_local_config" ]
deps = []
deps += [ ":sources_smoke" ]
deps += [ ":sources_other" ]
}
if (LOSCFG_USER_TEST_FOR_DOOR == true) {
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
configs = [ "../..:public_config_smk" ]
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":net_local_config" ]
deps = []
deps += [ ":sources_smoke" ]
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" ]
}
}

View File

@@ -48,53 +48,45 @@ sources_entry = [
"net_resolv_test.cpp",
]
source_set("sources_smoke") {
sources = [
"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",
]
configs += [ "../..:local_public_config" ]
include_dirs = common_include_dirs
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
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",
]
source_set("sources_other") {
sources = [
"full/net_resolv_test_004.cpp",
"full/net_resolv_test_005.cpp",
"full/net_resolv_test_008.cpp",
]
configs += [ "../..:local_public_config" ]
include_dirs = common_include_dirs
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
sources_full = [
"full/net_resolv_test_004.cpp",
"full/net_resolv_test_005.cpp",
"full/net_resolv_test_008.cpp",
]
if (LOSCFG_USER_TEST_FOR_ALL == true) {
unittest("liteos_a_net_resolv_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
configs = [ "../..:public_config_full" ]
configs += [ ":net_local_config" ]
deps = []
deps += [ ":sources_smoke" ]
deps += [ ":sources_other" ]
}
}
if (LOSCFG_USER_TEST_FOR_DOOR == true) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_net_resolv_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
configs = [ "../..:public_config_smk" ]
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":net_local_config" ]
deps = []
deps += [ ":sources_smoke" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_net_resolv_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" ]
}
}

View File

@@ -48,58 +48,50 @@ sources_entry = [
"net_socket_test.cpp",
]
source_set("sources_smoke") {
sources = [
"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",
]
configs += [ "../..:local_public_config" ]
include_dirs = common_include_dirs
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
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",
]
source_set("sources_other") {
sources = [
]
configs += [ "../..:local_public_config" ]
include_dirs = common_include_dirs
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
sources_full = [
]
if (LOSCFG_USER_TEST_FOR_ALL == true) {
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
configs = [ "../..:public_config_full" ]
configs += [ ":net_local_config" ]
deps = []
deps += [ ":sources_smoke" ]
deps += [ ":sources_other" ]
}
}
if (LOSCFG_USER_TEST_FOR_DOOR == true) {
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
configs = [ "../..:public_config_smk" ]
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":net_local_config" ]
deps = []
deps += [ ":sources_smoke" ]
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" ]
}
}