Skip to content

Commit bdd9447

Browse files
committed
[utest] make RT_USING_CI_ACTION to be clear
RT_USING_CI_ACTION will select RT_UTEST_USING_AUTO_RUN and RT_UTEST_USING_ALL_CASES
1 parent 53bd56c commit bdd9447

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

components/utilities/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,19 @@ config RT_USING_UTEST
210210
config UTEST_THR_PRIORITY
211211
int "The utest thread priority"
212212
default 20
213+
214+
config RT_UTEST_USING_AUTO_RUN
215+
bool "Enable auto run test cases"
216+
default n
217+
help
218+
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.
213226
endif
214227

215228
config RT_USING_VAR_EXPORT

components/utilities/utest/utest.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,15 @@ static void utest_thread_create(const char *utest_name)
316316
}
317317
}
318318

319-
#ifdef RT_USING_CI_ACTION
320-
static int utest_ci_action(void)
319+
#ifdef RT_UTEST_USING_AUTO_RUN
320+
static int utest_auto_run(void)
321321
{
322322
tc_loop = 1;
323323
utest_thread_create(RT_NULL);
324324
return RT_EOK;
325325
}
326-
INIT_APP_EXPORT(utest_ci_action);
327-
#endif /* RT_USING_CI_ACTION */
326+
INIT_APP_EXPORT(utest_auto_run);
327+
#endif /* RT_UTEST_USING_AUTO_RUN */
328328

329329
int utest_testcase_run(int argc, char** argv)
330330
{

src/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ menuconfig RT_USING_DEBUG
244244
config RT_USING_CI_ACTION
245245
bool "Enable CI Action build mode"
246246
select RT_USING_UTEST
247+
select RT_UTEST_USING_AUTO_RUN
248+
select RT_UTEST_USING_ALL_CASES
247249
default n
248250
help
249251
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_USING_CI_ACTION') or GetDepend('RT_UTEST_TC_USING_KLIBC'):
5+
if GetDepend('RT_UTEST_USING_ALL_CASES') or GetDepend('RT_UTEST_TC_USING_KLIBC'):
66
src += Glob('TC_*.c')
77

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

0 commit comments

Comments
 (0)