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 <unicorn_wang@outlook.com>
This commit is contained in:
Chen Wang
2025-09-26 14:21:02 +08:00
committed by R b b666
parent 7b8e8c95ba
commit 01e015450f
7 changed files with 23 additions and 8 deletions

View File

@@ -21,6 +21,7 @@ rsource "examples/utest/testcases/perf/Kconfig"
rsource "src/klibc/utest/Kconfig"
rsource "components/drivers/core/utest/Kconfig"
rsource "components/drivers/audio/utest/Kconfig"
rsource "components/dfs/utest/Kconfig"
rsource "components/net/utest/Kconfig"

View File

@@ -18,4 +18,9 @@ if GetDepend(['RT_USING_OFW']):
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE'], CPPPATH = CPPPATH)
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')

View File

@@ -0,0 +1,3 @@
config RT_UTEST_DRIVERS_CORE
bool "Enable testcase for drivers core"
default n

View File

@@ -0,0 +1,13 @@
Import('rtconfig')
from building import *
cwd = GetCurrentDir()
src = []
CPPPATH = [cwd]
if GetDepend('RT_UTEST_DRIVERS_CORE'):
src += Glob('*.c')
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES'], CPPPATH = CPPPATH)
Return('group')

View File

@@ -56,4 +56,4 @@ static void testcase(void)
{
UTEST_UNIT_RUN(test_rt_device_find);
}
UTEST_TC_EXPORT(testcase, "core.device_find", utest_tc_init, utest_tc_cleanup, 5);
UTEST_TC_EXPORT(testcase, "components.drivers.core.device_find", utest_tc_init, utest_tc_cleanup, 5);

View File

@@ -62,10 +62,6 @@ config UTEST_THREAD_TC
select RT_USING_TIMER_SOFT
select RT_USING_THREAD
config UTEST_DEVICE_TC
bool "device test"
default n
config UTEST_ATOMIC_TC
bool "atomic test"
default n

View File

@@ -46,9 +46,6 @@ if GetDepend(['UTEST_THREAD_TC']):
src += ['thread_overflow_tc.c']
src += ['thread_suspend_tc.c']
if GetDepend(['UTEST_DEVICE_TC']):
src += ['device_tc.c']
if GetDepend(['UTEST_ATOMIC_TC']):
src += ['atomic_tc.c']