feat(build): 使用xts -notest选项时,内核用例不参与编译构建和用例编译配置方式调整
【背景】 1.编译新增-notest选项为了排除用例参与构建,使用该选项时内核用例仍会参与构建,不符合预期 2.用例编译配置选项太多,需调整优化 【修改方案】 1.原内核用例的源文件是通过框架自带的source_set(一种虚拟静态库)的方式组织的, 不受unittests(自定义的一种方式)控制,修改为文件列表直接加入到unittest中。 2.编译配置通过level控制 【影响】 对现有的产品编译不会有影响。 Change-Id: I2c6a96e7276346de96f222b725d417418ff0e537
This commit is contained in:
@@ -41,44 +41,36 @@ sources_entry = [
|
||||
"drivers_hid_test.cpp",
|
||||
]
|
||||
|
||||
source_set("sources_smoke") {
|
||||
sources = [
|
||||
"smoke/hid_test_001.cpp",
|
||||
]
|
||||
configs += [ "../..:local_public_config" ]
|
||||
include_dirs = common_include_dirs
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
sources_smoke = [
|
||||
"smoke/hid_test_001.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_drivers_hid_unittest") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
configs = [ "../..:public_config_full" ]
|
||||
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_drivers_hid_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" ]
|
||||
deps = []
|
||||
deps += [ ":sources_smoke" ]
|
||||
sources += sources_smoke
|
||||
sources_full = []
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_door" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
|
||||
unittest("liteos_a_drivers_hid_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" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
@@ -41,44 +41,36 @@ sources_entry = [
|
||||
"drivers_storage_test.cpp",
|
||||
]
|
||||
|
||||
source_set("sources_smoke") {
|
||||
sources = [
|
||||
"smoke/storage_test_001.cpp",
|
||||
]
|
||||
configs += [ "../..:local_public_config" ]
|
||||
include_dirs = common_include_dirs
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
sources_smoke = [
|
||||
"smoke/storage_test_001.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_drivers_storage_unittest") {
|
||||
output_extension = "bin"
|
||||
output_dir = "$root_out_dir/test/unittest/kernel"
|
||||
include_dirs = common_include_dirs
|
||||
sources = sources_entry
|
||||
configs = [ "../..:public_config_full" ]
|
||||
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_drivers_storage_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" ]
|
||||
deps = []
|
||||
deps += [ ":sources_smoke" ]
|
||||
sources += sources_smoke
|
||||
sources_full = []
|
||||
sources += sources_full
|
||||
configs = [ "../..:public_config_for_door" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
|
||||
unittest("liteos_a_drivers_storage_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" ]
|
||||
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user