浏览代码

utest: ipc: move from examples to components/drivers/ipc

Also:
- Add "RT_" prefix for utest config options.
- Rename the case names to following the naming rule.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Chen Wang 3 月之前
父节点
当前提交
d14daa6cb1

+ 1 - 1
Kconfig.utestcases

@@ -10,7 +10,6 @@ if RT_USING_UTESTCASES
 rsource "components/utilities/utest/utest/Kconfig"
 rsource "src/utest/Kconfig"
 rsource "examples/utest/testcases/cpp11/Kconfig"
-rsource "examples/utest/testcases/drivers/ipc/Kconfig"
 rsource "examples/utest/testcases/posix/Kconfig"
 rsource "examples/utest/testcases/mm/Kconfig"
 rsource "examples/utest/testcases/tmpfs/Kconfig"
@@ -19,6 +18,7 @@ rsource "src/klibc/utest/Kconfig"
 
 rsource "components/drivers/core/utest/Kconfig"
 rsource "components/drivers/audio/utest/Kconfig"
+rsource "components/drivers/ipc/utest/Kconfig"
 rsource "components/drivers/serial/utest/Kconfig"
 rsource "components/drivers/smp_call/utest/Kconfig"
 rsource "components/dfs/utest/Kconfig"

+ 5 - 0
components/drivers/ipc/SConscript

@@ -15,4 +15,9 @@ else:
 
 group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE_IPC'], CPPPATH = CPPPATH, LOCAL_CPPDEFINES=['__RT_IPC_SOURCE__'])
 
+list = os.listdir(cwd)
+for item in list:
+    if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
+        group = group + SConscript(os.path.join(item, 'SConscript'))
+
 Return('group')

+ 12 - 0
components/drivers/ipc/utest/Kconfig

@@ -0,0 +1,12 @@
+menu "IPC Unit Testcases"
+    depends on RT_USING_DEVICE_IPC
+
+config RT_UTEST_COMPLETION
+    bool "rt_completion testcase"
+    default n
+
+config RT_UTEST_WORKQUEUE
+    bool "rt_workqueue testcase"
+    default n
+
+endmenu

+ 2 - 2
examples/utest/testcases/drivers/ipc/SConscript → components/drivers/ipc/utest/SConscript

@@ -5,10 +5,10 @@ cwd     = GetCurrentDir()
 src     = []
 CPPPATH = [cwd]
 
-if GetDepend(['UTEST_COMPLETION_TC']):
+if GetDepend(['RT_UTEST_COMPLETION']):
     src += ['completion_tc.c', 'completion_timeout_tc.c']
 
-if GetDepend(['UTEST_WORKQUEUE_TC']):
+if GetDepend(['RT_UTEST_WORKQUEUE']):
     src += ['workqueue_tc.c']
 
 group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES'], CPPPATH = CPPPATH)

+ 1 - 1
examples/utest/testcases/drivers/ipc/completion_tc.c → components/drivers/ipc/utest/completion_tc.c

@@ -195,5 +195,5 @@ static rt_err_t utest_tc_cleanup(void)
     return RT_EOK;
 }
 
-UTEST_TC_EXPORT(testcase, "testcases.drivers.ipc.rt_completion.basic",
+UTEST_TC_EXPORT(testcase, "components.drivers.ipc.rt_completion_basic",
                 utest_tc_init, utest_tc_cleanup, 10);

+ 1 - 1
examples/utest/testcases/drivers/ipc/completion_timeout_tc.c → components/drivers/ipc/utest/completion_timeout_tc.c

@@ -209,5 +209,5 @@ static rt_err_t utest_tc_cleanup(void)
     return RT_EOK;
 }
 
-UTEST_TC_EXPORT(testcase, "testcases.drivers.ipc.rt_completion.timeout",
+UTEST_TC_EXPORT(testcase, "components.drivers.ipc.rt_completion_timeout",
                 utest_tc_init, utest_tc_cleanup, 1000);

+ 0 - 0
examples/utest/testcases/drivers/ipc/workqueue_tc.c → components/drivers/ipc/utest/workqueue_tc.c


+ 0 - 15
examples/utest/testcases/drivers/SConscript

@@ -1,15 +0,0 @@
-# RT-Thread building script for bridge
-
-import os
-from building import *
-
-cwd = GetCurrentDir()
-objs = []
-list = os.listdir(cwd)
-
-for d in list:
-    path = os.path.join(cwd, d)
-    if os.path.isfile(os.path.join(path, 'SConscript')):
-        objs = objs + SConscript(os.path.join(d, 'SConscript'))
-
-Return('objs')

+ 0 - 11
examples/utest/testcases/drivers/ipc/Kconfig

@@ -1,11 +0,0 @@
-menu "Utest IPC Testcase"
-
-config UTEST_COMPLETION_TC
-    bool "rt_completion testcase"
-    default n
-
-config UTEST_WORKQUEUE_TC
-    bool "rt_workqueue testcase"
-    default n
-
-endmenu