Skip to content

Commit 495c8cf

Browse files
unicornxRbb666
authored andcommitted
utest: remove RT_UTEST_USING_ALL_CASES
Many modules' utests currently don't support enabling all tests at once. Furthermore, some modules' tests are complex, for example due to their numerous dependencies on other modules. This makes it nearly impossible to enable all tests with a single global switch. Consequently, the previously defined `RT_UTEST_USING_ALL_CASES` has lost its original meaning. We recommend deprecating this configuration switch. If a module needs to enable a group of functional tests through its own configuration, this local enable all switch should be implemented by the module itself, and a global RTT enable switch will no longer be provided. If such a requirement arises in the future, we recommend careful design, especially considering how to ensure that turning on a single switch enables all dependencies for all involved modules for ease of use. Signed-off-by: Chen Wang <[email protected]>
1 parent 320aa25 commit 495c8cf

File tree

9 files changed

+7
-15
lines changed

9 files changed

+7
-15
lines changed

bsp/k230/drivers/utest/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from building import *
22

33
src = []
44

5-
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('BSP_UTEST_DRIVERS'):
5+
if GetDepend('BSP_UTEST_DRIVERS'):
66
src += ['test_gpio.c']
77
src += ['test_gpio_irq.c']
88

components/drivers/audio/utest/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cwd = GetCurrentDir()
55
src = []
66
CPPPATH = [cwd]
77

8-
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('RT_UTEST_USING_AUDIO_DRIVER'):
8+
if GetDepend('RT_UTEST_USING_AUDIO_DRIVER'):
99
src += Glob('tc_*.c')
1010

1111
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_AUDIO'], CPPPATH = CPPPATH)

components/net/utest/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cwd = GetCurrentDir()
55
src = []
66
CPPPATH = [cwd]
77

8-
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('RT_UTEST_TC_USING_LWIP') or GetDepend('RT_UTEST_TC_USING_NETDEV'):
8+
if GetDepend('RT_UTEST_TC_USING_LWIP') or GetDepend('RT_UTEST_TC_USING_NETDEV'):
99

1010
if GetDepend('RT_UTEST_TC_USING_LWIP'):
1111
# Add lwIP test source if enabled

components/utilities/Kconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,6 @@ config RT_USING_UTEST
216216
default n
217217
help
218218
If enable this option, the test cases will be run automatically when board boot up.
219-
220-
config RT_UTEST_USING_ALL_CASES
221-
bool "Enable all selected modules' test cases"
222-
default n
223-
help
224-
If enable this option, all selected modules' test cases will be run.
225-
Otherwise, only the test cases that are explicitly enabled will be run.
226219
endif
227220

228221
config RT_USING_VAR_EXPORT

components/utilities/utest/utest/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from building import *
22

33
src = []
44

5-
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('UTEST_SELF_PASS_TC'):
5+
if GetDepend('UTEST_SELF_PASS_TC'):
66
src += Glob('TC_*.c')
77

88
group = DefineGroup('utc_UTest', src, depend = [''])

documentation/6.components/utest/utest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ For each module, you can maintain unit testcases in a unified manner in the foll
314314

315315
- `Kconfig` file, which defining configuration options for the unit test cases of this module, the recommended option is named `RT_UTEST_TC_USING_XXXX`, XXXX is the global unique module name of this module.
316316

317-
- `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-testcases will be enabled to avoid selecting one by one.
317+
- `SConscript` file, when adding src files, you need to rely on `RT_UTEST_TC_USING_XXXX`.
318318

319319
After completing the above steps, rsource the path of the Kconfig file of utest of this module to the file `Kconfig.utestcases`.
320320

examples/utest/testcases/cpp11/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cwd = GetCurrentDir()
55
src = []
66
CPPPATH = [cwd]
77

8-
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('UTEST_CPP11_THREAD_TC'):
8+
if GetDepend('UTEST_CPP11_THREAD_TC'):
99
src += Glob('tc_*.cpp')
1010

1111
group = DefineGroup('utestcases', src, depend = ['RT_USING_UTESTCASES', 'RT_USING_CPLUSPLUS'], CPPPATH = CPPPATH)

src/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ config RT_USING_CI_ACTION
242242
bool "Enable CI Action build mode"
243243
select RT_USING_UTEST
244244
select RT_UTEST_USING_AUTO_RUN
245-
select RT_UTEST_USING_ALL_CASES
246245
default n
247246
help
248247
Identify that the environment is CI Action.

src/klibc/utest/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from building import *
22

33
src = []
44

5-
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('RT_UTEST_TC_USING_KLIBC'):
5+
if GetDepend('RT_UTEST_TC_USING_KLIBC'):
66
src += Glob('TC_*.c')
77

88
group = DefineGroup('utestcases', src, depend = [''])

0 commit comments

Comments
 (0)