From 420e781f3373b999cbf0dda6f3b15ec352f57309 Mon Sep 17 00:00:00 2001 From: Caoruihong Date: Tue, 15 Jun 2021 10:03:14 +0800 Subject: [PATCH] chore: adjust path of posix header files path of posix header files are exposed via public_configs of //kernel/liteos_m/kal/posix Signed-off-by: Caoruihong Change-Id: Id838549e1a952d6ddb8664792570f265edfbd91c --- BUILD.gn | 4 ++ kal/cmsis/BUILD.gn | 10 ++++- kal/posix/BUILD.gn | 2 +- testsuits/BUILD.gn | 22 +++++------ testsuits/sample/kernel/event/BUILD.gn | 13 +------ testsuits/sample/kernel/hwi/BUILD.gn | 15 +------ testsuits/sample/kernel/mem/BUILD.gn | 19 +++------ testsuits/sample/kernel/mux/BUILD.gn | 34 +--------------- testsuits/sample/kernel/queue/BUILD.gn | 40 +------------------ testsuits/sample/kernel/sem/BUILD.gn | 14 +------ testsuits/sample/kernel/swtmr/BUILD.gn | 19 +-------- testsuits/sample/kernel/task/BUILD.gn | 54 +------------------------- testsuits/unittest/posix/BUILD.gn | 4 +- 13 files changed, 39 insertions(+), 211 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 18aee987..fb72bf31 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -34,6 +34,7 @@ declare_args() { enable_ohos_kernel_liteos_m_kal = true enable_ohos_kernel_liteos_m_fs = true enable_ohos_kernel_liteos_m_backtrace = true + enable_ohos_kernel_liteos_m_test = false } group("kernel") { @@ -60,4 +61,7 @@ group("kernel") { if (enable_ohos_kernel_liteos_m_kal == true) { deps += [ "kal:kal" ] } + if (enable_ohos_kernel_liteos_m_test == true) { + deps += [ "testsuits:test" ] + } } diff --git a/kal/cmsis/BUILD.gn b/kal/cmsis/BUILD.gn index 4b6516f9..07aefe5e 100644 --- a/kal/cmsis/BUILD.gn +++ b/kal/cmsis/BUILD.gn @@ -32,9 +32,17 @@ static_library("cmsis") { include_dirs = [ "//third_party/bounds_checking_function/include", - "//third_party/cmsis/CMSIS/RTOS2/Include", "../../kernel/include", "../../kernel/arch/include", "../../utils", ] + + public_configs = [ ":include" ] +} + +config("include") { + include_dirs = [ + ".", + "//third_party/cmsis/CMSIS/RTOS2/Include", + ] } diff --git a/kal/posix/BUILD.gn b/kal/posix/BUILD.gn index f2532552..a2220564 100644 --- a/kal/posix/BUILD.gn +++ b/kal/posix/BUILD.gn @@ -45,7 +45,6 @@ static_library("posix") { "../../kernel/arch/include", "../../kernel/include", "../../utils", - "//third_party/bounds_checking_function/include", ] public_configs = [ ":include" ] @@ -55,5 +54,6 @@ config("include") { include_dirs = [ "include", "//third_party/musl/porting/liteos_m/kernel/include", + "//third_party/bounds_checking_function/include", ] } diff --git a/testsuits/BUILD.gn b/testsuits/BUILD.gn index 0906cd92..de90d651 100644 --- a/testsuits/BUILD.gn +++ b/testsuits/BUILD.gn @@ -1,25 +1,23 @@ # Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved. import("//build/lite/config/component/lite_component.gni") +config("include") { + include_dirs = [ + "include", + "//kernel/liteos_m/kernel/include", + "//kernel/liteos_m/kernel/arch/include", + "//kernel/liteos_m/components/cpup", + ] +} + source_set("test_init") { sources = [ "src/osTest.c", - "src/osTestTask.c", "src/iCunit.c", ] - include_dirs = [ - "include", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - ] + configs += [ ":include" ] } lite_component("test") { diff --git a/testsuits/sample/kernel/event/BUILD.gn b/testsuits/sample/kernel/event/BUILD.gn index 37a61ebb..696f8242 100644 --- a/testsuits/sample/kernel/event/BUILD.gn +++ b/testsuits/sample/kernel/event/BUILD.gn @@ -48,16 +48,5 @@ static_library("test_event") { "It_los_event.c", ] - include_dirs = [ - "It_los_event.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//vendor/huawei/watchgt/devkit/hal/include", - "//kernel/liteos_m/components/cmsis", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/sample/kernel/hwi/BUILD.gn b/testsuits/sample/kernel/hwi/BUILD.gn index 55874fc8..769a000a 100644 --- a/testsuits/sample/kernel/hwi/BUILD.gn +++ b/testsuits/sample/kernel/hwi/BUILD.gn @@ -38,19 +38,8 @@ static_library("test_hwi") { "it_los_hwi_033.c", "it_los_hwi_034.c", "It_los_hwi.c", - "LLT_los_hwi_035.c", + "llt_los_hwi_035.c", ] - include_dirs = [ - "It_los_hwi.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/sample/kernel/mem/BUILD.gn b/testsuits/sample/kernel/mem/BUILD.gn index d089d82c..c6091b6b 100644 --- a/testsuits/sample/kernel/mem/BUILD.gn +++ b/testsuits/sample/kernel/mem/BUILD.gn @@ -3,7 +3,6 @@ static_library("test_mem") { sources = [ - "It_los_list_001.c", "It_los_mem_001.c", "It_los_mem_002.c", "It_los_mem_003.c", @@ -32,19 +31,13 @@ static_library("test_mem") { "It_los_mem_045.c", "it_los_mem.c", "It_los_tick_001.c", - "LLT_los_tick_001.c", ] - include_dirs = [ - "It_los_mem.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", + configs += [ "//kernel/liteos_m/testsuits:include" ] + + defines = [ + "LOS_RECORD_LR_CNT=3", + "LOS_DLNK_NODE_HEAD_SIZE=0", + "MIN_DLNK_POOL_SIZE=0" ] } diff --git a/testsuits/sample/kernel/mux/BUILD.gn b/testsuits/sample/kernel/mux/BUILD.gn index 5d334ba0..a4e2d537 100644 --- a/testsuits/sample/kernel/mux/BUILD.gn +++ b/testsuits/sample/kernel/mux/BUILD.gn @@ -28,40 +28,8 @@ static_library("test_mux") { "It_los_mutex_023.c", "It_los_mutex_024.c", "It_los_mutex_025.c", - "It_los_mux_026_1.c", - "It_los_mux_026.c", - "It_los_mux_027_1.c", - "It_los_mux_027.c", - "It_los_mux_028.c", - "It_los_mux_029_1.c", - "It_los_mux_029.c", - "It_los_mux_030_1.c", - "It_los_mux_030.c", - "It_los_mux_031_1.c", - "It_los_mux_031.c", - "It_los_mux_032.c", - "It_los_mux_033_1.c", - "It_los_mux_033.c", - "It_los_mux_034_1.c", - "It_los_mux_034.c", - "It_los_mux_035.c", - "It_los_mux_036.c", - "It_los_mux_037.c", - "It_los_mux_038.c", - "It_los_mux_039.c", "It_los_mux.c", ] - include_dirs = [ - "It_los_mux.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/sample/kernel/queue/BUILD.gn b/testsuits/sample/kernel/queue/BUILD.gn index a505fd59..4721664b 100644 --- a/testsuits/sample/kernel/queue/BUILD.gn +++ b/testsuits/sample/kernel/queue/BUILD.gn @@ -25,8 +25,6 @@ static_library("test_queue") { "It_los_queue_020.c", "It_los_queue_021.c", "It_los_queue_022.c", - "It_los_queue_023.c", - "It_los_queue_024.c", "It_los_queue_025.c", "It_los_queue_026.c", "It_los_queue_027.c", @@ -51,7 +49,6 @@ static_library("test_queue") { "It_los_queue_046.c", "It_los_queue_047.c", "It_los_queue_048.c", - "It_los_queue_049.c", "It_los_queue_050.c", "It_los_queue_051.c", "It_los_queue_052.c", @@ -77,9 +74,6 @@ static_library("test_queue") { "It_los_queue_072.c", "It_los_queue_073.c", "It_los_queue_074.c", - "It_los_queue_075.c", - "It_los_queue_076.c", - "It_los_queue_077.c", "It_los_queue_078.c", "It_los_queue_079.c", "It_los_queue_080.c", @@ -91,7 +85,6 @@ static_library("test_queue") { "It_los_queue_086.c", "It_los_queue_087.c", "It_los_queue_088.c", - "It_los_queue_089.c", "It_los_queue_090.c", "It_los_queue_091.c", "It_los_queue_092.c", @@ -100,29 +93,13 @@ static_library("test_queue") { "It_los_queue_095.c", "It_los_queue_096.c", "It_los_queue_097.c", - "It_los_queue_098.c", - "It_los_queue_099.c", - "It_los_queue_100.c", - "It_los_queue_101.c", - "It_los_queue_102.c", - "It_los_queue_103.c", "It_los_queue_104.c", - "It_los_queue_105.c", "It_los_queue_106.c", "It_los_queue_107.c", "It_los_queue_108.c", "It_los_queue_109.c", "It_los_queue_110.c", - "It_los_queue_111.c", - "It_los_queue_112.c", - "It_los_queue_113.c", "It_los_queue_114.c", - "It_los_queue_115.c", - "It_los_queue_116.c", - "It_los_queue_117.c", - "It_los_queue_118.c", - "It_los_queue_119.c", - "It_los_queue_120.c", "It_los_queue.c", "It_los_queue_head_001.c", "It_los_queue_head_002.c", @@ -140,8 +117,6 @@ static_library("test_queue") { "It_los_queue_head_014.c", "It_los_queue_head_015.c", "It_los_queue_head_016.c", - "It_los_queue_head_017.c", - "It_los_queue_head_018.c", "It_los_queue_head_019.c", "It_los_queue_head_020.c", "It_los_queue_head_021.c", @@ -162,22 +137,9 @@ static_library("test_queue") { "It_los_queue_head_041.c", "It_los_queue_head_042.c", "Llt_los_queue_001.c", - "Llt_los_queue_002.c", "LLt_los_queue_003.c", - "LLt_los_queue_004.c", ] - include_dirs = [ - "It_los_queue.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/sample/kernel/sem/BUILD.gn b/testsuits/sample/kernel/sem/BUILD.gn index c61def69..5ccc9863 100644 --- a/testsuits/sample/kernel/sem/BUILD.gn +++ b/testsuits/sample/kernel/sem/BUILD.gn @@ -47,19 +47,7 @@ static_library("test_sem") { "it_los_sem_042.c", "it_los_sem_043.c", "It_los_sem.c", - "Llt_los_sem_001.c", ] - include_dirs = [ - "It_los_sem.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/sample/kernel/swtmr/BUILD.gn b/testsuits/sample/kernel/swtmr/BUILD.gn index d5646a12..320f20e9 100644 --- a/testsuits/sample/kernel/swtmr/BUILD.gn +++ b/testsuits/sample/kernel/swtmr/BUILD.gn @@ -30,7 +30,6 @@ static_library("test_swtmr") { "It_los_swtmr_025.c", "It_los_swtmr_026.c", "It_los_swtmr_027.c", - "It_los_swtmr_028.c", "It_los_swtmr_029.c", "It_los_swtmr_030.c", "It_los_swtmr_031.c", @@ -115,26 +114,10 @@ static_library("test_swtmr") { "It_los_swtmr_Align_031.c", "It_los_swtmr.c", "It_los_swtmr_Delay_001.c", - "It_los_swtmr_Delay_002.c", "It_los_swtmr_Delay_003.c", "It_los_swtmr_Delay_004.c", "It_los_swtmr_Delay_005.c", - "Llt_los_swtmr_001.c", - "Llt_los_swtmr_002.c", - "Llt_los_swtmr_003.c", - "Llt_los_swtmr_004.c", ] - include_dirs = [ - "It_los_swtmr.h", - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/sample/kernel/task/BUILD.gn b/testsuits/sample/kernel/task/BUILD.gn index 35c9da32..51cc6c1b 100644 --- a/testsuits/sample/kernel/task/BUILD.gn +++ b/testsuits/sample/kernel/task/BUILD.gn @@ -12,7 +12,6 @@ static_library("test_task") { "It_los_task_006.c", "It_los_task_007.c", "It_los_task_008.c", - "It_los_task_009.c", "It_los_task_010.c", "It_los_task_011.c", "It_los_task_012.c", @@ -47,8 +46,6 @@ static_library("test_task") { "It_los_task_041.c", "It_los_task_042.c", "It_los_task_043.c", - "It_los_task_044.c", - "It_los_task_045.c", "It_los_task_046.c", "It_los_task_047.c", "It_los_task_048.c", @@ -121,56 +118,7 @@ static_library("test_task") { "It_los_task_115.c", "It_los_task_116.c", "It_los_task_117.c", - "It_los_task_118.c", - "It_los_task_119.c", - "It_los_task_120.c", - "It_los_task_121.c", - "It_los_task_122.c", - "It_los_task_123.c", - "It_los_task_124.c", - "It_los_task_125.c", - "It_los_task_126.c", - "It_los_task_127.c", - "It_los_task_128.c", - "It_los_task_129.c", - "It_los_task_130.c", - "It_los_task_131.c", - "It_los_task_132.c", - "It_los_task_133.c", - "It_los_task_135.c", - "It_los_task_136.c", - "It_los_task_137.c", - "It_los_task_138.c", - "LLT_los_priqueue.c", - "LLT_los_task_001.c", - "LLT_los_task_002.c", - "LLT_los_task_003.c", - "LLT_los_task_004.c", - "LLT_los_task_005.c", - "LLT_los_task_006.c", - "LLT_los_task_007.c", - "LLT_los_task_008.c", - "LLT_los_task_009.c", - "LLT_los_task_010.c", - "LLT_los_task_011.c", - "LLT_los_task_012.c", - "LLT_los_task_013.c", - "LLT_los_task_014.c", - "LLT_los_task_015.c", - "LLT_los_task_016.c", - "LLT_shell_cmd_task_001.c", ] - include_dirs = [ - "../../../include/", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/kernel/base/include", - "//build/compiler/arm-none-eabi/linux/arm-none-eabi/include", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include/", - "//build/compiler/arm-none-eabi/linux/lib/gcc/arm-none-eabi/5.4.1/include-fixed/", - "//kernel/liteos_m/arch/arm/cortex-m/include", - "//kernel/liteos_m/components/cmsis", - "//vendor/huawei/watchgt/devkit/hal/include", - "It_los_task.h", - ] + configs += [ "//kernel/liteos_m/testsuits:include" ] } diff --git a/testsuits/unittest/posix/BUILD.gn b/testsuits/unittest/posix/BUILD.gn index 11c5a42e..bf9875d2 100644 --- a/testsuits/unittest/posix/BUILD.gn +++ b/testsuits/unittest/posix/BUILD.gn @@ -65,9 +65,7 @@ hctest_suite("PosixTest") { "//test/xts/tools/hctest/include", "//third_party/unity/src", "src", - "//kernel/liteos_m/kal", - "//kernel/liteos_m/kal/posix/include", - "//kernel/liteos_m/kal/posix/musl_src/errno", ] cflags = [ "-Wno-error" ] + deps = [ "//kernel/liteos_m/kal/posix" ] }