Skip to content

Commit d14daa6

Browse files
unicornxRbb666
authored andcommitted
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 <[email protected]>
1 parent 7499790 commit d14daa6

File tree

9 files changed

+22
-31
lines changed

9 files changed

+22
-31
lines changed

Kconfig.utestcases

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ if RT_USING_UTESTCASES
1010
rsource "components/utilities/utest/utest/Kconfig"
1111
rsource "src/utest/Kconfig"
1212
rsource "examples/utest/testcases/cpp11/Kconfig"
13-
rsource "examples/utest/testcases/drivers/ipc/Kconfig"
1413
rsource "examples/utest/testcases/posix/Kconfig"
1514
rsource "examples/utest/testcases/mm/Kconfig"
1615
rsource "examples/utest/testcases/tmpfs/Kconfig"
@@ -19,6 +18,7 @@ rsource "src/klibc/utest/Kconfig"
1918

2019
rsource "components/drivers/core/utest/Kconfig"
2120
rsource "components/drivers/audio/utest/Kconfig"
21+
rsource "components/drivers/ipc/utest/Kconfig"
2222
rsource "components/drivers/serial/utest/Kconfig"
2323
rsource "components/drivers/smp_call/utest/Kconfig"
2424
rsource "components/dfs/utest/Kconfig"

components/drivers/ipc/SConscript

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ else:
1515

1616
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE_IPC'], CPPPATH = CPPPATH, LOCAL_CPPDEFINES=['__RT_IPC_SOURCE__'])
1717

18+
list = os.listdir(cwd)
19+
for item in list:
20+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
21+
group = group + SConscript(os.path.join(item, 'SConscript'))
22+
1823
Return('group')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
menu "IPC Unit Testcases"
2+
depends on RT_USING_DEVICE_IPC
3+
4+
config RT_UTEST_COMPLETION
5+
bool "rt_completion testcase"
6+
default n
7+
8+
config RT_UTEST_WORKQUEUE
9+
bool "rt_workqueue testcase"
10+
default n
11+
12+
endmenu

examples/utest/testcases/drivers/ipc/SConscript renamed to components/drivers/ipc/utest/SConscript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ cwd = GetCurrentDir()
55
src = []
66
CPPPATH = [cwd]
77

8-
if GetDepend(['UTEST_COMPLETION_TC']):
8+
if GetDepend(['RT_UTEST_COMPLETION']):
99
src += ['completion_tc.c', 'completion_timeout_tc.c']
1010

11-
if GetDepend(['UTEST_WORKQUEUE_TC']):
11+
if GetDepend(['RT_UTEST_WORKQUEUE']):
1212
src += ['workqueue_tc.c']
1313

1414
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES'], CPPPATH = CPPPATH)

examples/utest/testcases/drivers/ipc/completion_tc.c renamed to components/drivers/ipc/utest/completion_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,5 @@ static rt_err_t utest_tc_cleanup(void)
195195
return RT_EOK;
196196
}
197197

198-
UTEST_TC_EXPORT(testcase, "testcases.drivers.ipc.rt_completion.basic",
198+
UTEST_TC_EXPORT(testcase, "components.drivers.ipc.rt_completion_basic",
199199
utest_tc_init, utest_tc_cleanup, 10);

examples/utest/testcases/drivers/ipc/completion_timeout_tc.c renamed to components/drivers/ipc/utest/completion_timeout_tc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ static rt_err_t utest_tc_cleanup(void)
209209
return RT_EOK;
210210
}
211211

212-
UTEST_TC_EXPORT(testcase, "testcases.drivers.ipc.rt_completion.timeout",
212+
UTEST_TC_EXPORT(testcase, "components.drivers.ipc.rt_completion_timeout",
213213
utest_tc_init, utest_tc_cleanup, 1000);

examples/utest/testcases/drivers/SConscript

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/utest/testcases/drivers/ipc/Kconfig

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)