Skip to content

Commit 41ea61a

Browse files
committed
utest: move testcases of Utest from example to Utest folder
Create unit-test-cases for the Utest framework subsystem according to "How to add utest cases into RT-Thread for your module." [1] Link: https://rt-thread.github.io/rt-thread/page_component_utest.html#autotoc_md804 [1] The original `components/utilities/utest` directory already has unit testcases, which are more comprehensive than the testcases in `examples/utest/testcases/utest/`. Therefore, simply deleted the test cases in `examples` and used the existing testcases in the utest framework. Signed-off-by: Chen Wang <[email protected]>
1 parent 8bf15b1 commit 41ea61a

File tree

8 files changed

+24
-67
lines changed

8 files changed

+24
-67
lines changed

Kconfig.utestcases

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config RT_USING_UTESTCASES
77

88
if RT_USING_UTESTCASES
99

10-
rsource "examples/utest/testcases/utest/Kconfig"
10+
rsource "components/utilities/utest/utest/Kconfig"
1111
rsource "examples/utest/testcases/kernel/Kconfig"
1212
rsource "examples/utest/testcases/cpp11/Kconfig"
1313
rsource "examples/utest/testcases/drivers/serial_v2/Kconfig"

components/utilities/utest/SConscript

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ src = Glob('*.c')
55
CPPPATH = [cwd]
66
group = DefineGroup('UTest', src, depend = ['RT_USING_UTEST'], CPPPATH = CPPPATH)
77

8+
list = os.listdir(cwd)
9+
for item in list:
10+
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
11+
group = group + SConscript(os.path.join(item, 'SConscript'))
12+
813
Return('group')
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
menu "Utest Self Testcase"
2+
3+
config UTEST_SELF_PASS_TC
4+
bool "UTEST Self-test"
5+
select RT_USING_UTEST
6+
default n
7+
8+
endmenu
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from building import *
2+
3+
src = []
4+
5+
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('UTEST_SELF_PASS_TC'):
6+
src += Glob('TC_*.c')
7+
8+
group = DefineGroup('utc_UTest', src, depend = [''])
9+
10+
Return('group')
File renamed without changes.

examples/utest/testcases/utest/Kconfig

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

examples/utest/testcases/utest/SConscript

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

examples/utest/testcases/utest/pass_tc.c

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

0 commit comments

Comments
 (0)