Skip to content

Commit 01e0154

Browse files
unicornxRbb666
authored andcommitted
utest: move driver related case under to drivers
src/utest/device_tc.c is testing API: rt_device_find(), which is a function defined in components/drivers/core/device.c. So it should be a testcase for drivers core, not for core. Move it to under components/drivers/core. Signed-off-by: Chen Wang <[email protected]>
1 parent 7b8e8c9 commit 01e0154

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

Kconfig.utestcases

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ rsource "examples/utest/testcases/perf/Kconfig"
2121

2222
rsource "src/klibc/utest/Kconfig"
2323

24+
rsource "components/drivers/core/utest/Kconfig"
2425
rsource "components/drivers/audio/utest/Kconfig"
2526
rsource "components/dfs/utest/Kconfig"
2627
rsource "components/net/utest/Kconfig"

components/drivers/core/SConscript

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ if GetDepend(['RT_USING_OFW']):
1818

1919
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE'], CPPPATH = CPPPATH)
2020

21+
list = os.listdir(cwd)
22+
for item in list:
23+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
24+
group = group + SConscript(os.path.join(item, 'SConscript'))
25+
2126
Return('group')
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
config RT_UTEST_DRIVERS_CORE
2+
bool "Enable testcase for drivers core"
3+
default n
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Import('rtconfig')
2+
from building import *
3+
4+
cwd = GetCurrentDir()
5+
src = []
6+
CPPPATH = [cwd]
7+
8+
if GetDepend('RT_UTEST_DRIVERS_CORE'):
9+
src += Glob('*.c')
10+
11+
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES'], CPPPATH = CPPPATH)
12+
13+
Return('group')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ static void testcase(void)
5656
{
5757
UTEST_UNIT_RUN(test_rt_device_find);
5858
}
59-
UTEST_TC_EXPORT(testcase, "core.device_find", utest_tc_init, utest_tc_cleanup, 5);
59+
UTEST_TC_EXPORT(testcase, "components.drivers.core.device_find", utest_tc_init, utest_tc_cleanup, 5);

src/utest/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ config UTEST_THREAD_TC
6262
select RT_USING_TIMER_SOFT
6363
select RT_USING_THREAD
6464

65-
config UTEST_DEVICE_TC
66-
bool "device test"
67-
default n
68-
6965
config UTEST_ATOMIC_TC
7066
bool "atomic test"
7167
default n

src/utest/SConscript

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ if GetDepend(['UTEST_THREAD_TC']):
4646
src += ['thread_overflow_tc.c']
4747
src += ['thread_suspend_tc.c']
4848

49-
if GetDepend(['UTEST_DEVICE_TC']):
50-
src += ['device_tc.c']
51-
5249
if GetDepend(['UTEST_ATOMIC_TC']):
5350
src += ['atomic_tc.c']
5451

0 commit comments

Comments
 (0)