Skip to content

Commit 56f58bc

Browse files
committed
utest: move entry from examples to utest
Change the entry of utest's Kconfig from examples/utest/testcases/Kconfig to components/utilities/utest/Kconfig. In the future, the testcase source code of utest will be placed in each module for maintenance, but the entry of Kconfig will all be placed in components/utilities/utest/Kconfig for unified maintenance. In this way, when executing menuconfig, people can enter and configure from one place, avoiding searching for utest configuration switches here and ther in the menuconfig interface. For each module, you can maintain unit-test in a unified manner in the following way: - Create a subdirectory named 'utest' in the directory where your module is located. - Store the following files in the utest subdirectory: - Unit test case program source code files for this module. - Kconfig file, add configuration options for the unit test files of this module, the recommended option is named RT_UTEST_TC_USING_XXXX, XXXX is the global unique module name of this module. - SConscript file, note that when adding src files, in addition to relying on RT_UTEST_TC_USING_XXXX, you must also rely on RT_UTEST_USING_ALL_CASES, the two dependencies are in an "or" relationship. The role of RT_UTEST_USING_ALL_CASES is that once this option is turned on, all unit tests will be enabled to avoid selecting one by one. Signed-off-by: Chen Wang <[email protected]>
1 parent d23006e commit 56f58bc

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
rsource "src/Kconfig"
22
rsource "libcpu/Kconfig"
33
rsource "components/Kconfig"
4-
rsource "examples/utest/testcases/Kconfig"
4+
rsource "components/utilities/utest/Kconfig"

components/utilities/utest/Kconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
menu "RT-Thread Utestcases"
2+
3+
config RT_USING_UTESTCASES
4+
bool "RT-Thread Utestcases"
5+
default n
6+
select RT_USING_UTEST
7+
8+
if RT_USING_UTESTCASES
9+
10+
rsource "../../../examples/utest/testcases/utest/Kconfig"
11+
rsource "../../../examples/utest/testcases/kernel/Kconfig"
12+
rsource "../../../examples/utest/testcases/cpp11/Kconfig"
13+
rsource "../../../examples/utest/testcases/drivers/serial_v2/Kconfig"
14+
rsource "../../../examples/utest/testcases/drivers/serial_bypass/Kconfig"
15+
rsource "../../../examples/utest/testcases/drivers/ipc/Kconfig"
16+
rsource "../../../examples/utest/testcases/posix/Kconfig"
17+
rsource "../../../examples/utest/testcases/mm/Kconfig"
18+
rsource "../../../examples/utest/testcases/tmpfs/Kconfig"
19+
rsource "../../../examples/utest/testcases/smp_call/Kconfig"
20+
rsource "../../../examples/utest/testcases/perf/Kconfig"
21+
22+
endif
23+
24+
endmenu

examples/utest/testcases/Kconfig

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

0 commit comments

Comments
 (0)