mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-14 03:10:07 +08:00

Change the entry of utest's Kconfig from 'examples/utest/testcases/Kconfig' to 'Kconfig.utestcases'. Modified the build scripts where the path name is "examples/utest/testcases/Kconfig" and changed it to 'Kconfig.utestcases', otherwise build operations such 'scons --dist' may fail. 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 Kconfig.utestcases 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 there 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. After completing the above steps, add the path of the Kconfig file of utest of this module to the Kconfig.utestcases file. Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
25 lines
742 B
Plaintext
25 lines
742 B
Plaintext
menu "RT-Thread Utestcases"
|
|
|
|
config RT_USING_UTESTCASES
|
|
bool "RT-Thread Utestcases"
|
|
default n
|
|
select RT_USING_UTEST
|
|
|
|
if RT_USING_UTESTCASES
|
|
|
|
rsource "examples/utest/testcases/utest/Kconfig"
|
|
rsource "examples/utest/testcases/kernel/Kconfig"
|
|
rsource "examples/utest/testcases/cpp11/Kconfig"
|
|
rsource "examples/utest/testcases/drivers/serial_v2/Kconfig"
|
|
rsource "examples/utest/testcases/drivers/serial_bypass/Kconfig"
|
|
rsource "examples/utest/testcases/drivers/ipc/Kconfig"
|
|
rsource "examples/utest/testcases/posix/Kconfig"
|
|
rsource "examples/utest/testcases/mm/Kconfig"
|
|
rsource "examples/utest/testcases/tmpfs/Kconfig"
|
|
rsource "examples/utest/testcases/smp_call/Kconfig"
|
|
rsource "examples/utest/testcases/perf/Kconfig"
|
|
|
|
endif
|
|
|
|
endmenu
|