test: ut: run every suite in a comma separated list
PATCH 1/1 test: ut: run every suite in a comma separated list
"ut lib,mem" only runs lib. The loop sets name to NULL after strsep(), but strsep() has already moved it past the comma.
Loop on strsep() until it returns NULL.
--- test/cmd_ut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
test/cmd_ut.c +1 -1
@@ -297,7 +297,7 @@ static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])int any_fail =0 ;const char *p; -for (; p =strsep (&name,"," ), p; name =NULL ) { +while ((p =strsep (&name,"," ))) { ste =find_suite (p);if (!ste) {printf ("Suite '%s' not found\n" , p);
Signature · 1 line
2.53.0
Hi Anders,
Quoted 15 lines · Anders Roxell
test: ut: run every suite in a comma separated list
"ut lib,mem" only runs lib. The loop sets name to NULL after
strsep(), butstrsep()has already moved it past the comma.Loop on
strsep()until it returns NULL.Fixes fa0b68d22add ("test: Allow running a selection of suites")Signed-off-by Anders Roxell <[email protected]>
test/cmd_ut.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
test/cmd_ut.c static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) · line 301
Quoted 2 lines
test/cmd_ut.c +1
-1@@ -301,7 +301,7 @@ static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) -for (; p =strsep (&name,"," ), p; name =NULL ) { +while ((p =strsep (&name,"," ))) {
Thanks for fixing this.
BTW, test_suite.py already checks this with 'ut bloblist,setexpr,mem' and expects 'Suites run: 3', but the test is disabled because it is named xtest_suite(), which probably explains why nobody noticed. It would be nice to re-enable it, perhaps in a follow-up.
Regards,
Simon
Quoted 9 lines · Anders Roxell
"ut lib,mem" only runs lib. The loop sets name to NULL after
strsep(), butstrsep()has already moved it past the comma.Loop on
strsep()until it returns NULL.Fixes fa0b68d22add ("test: Allow running a selection of suites")Signed-off-by Anders Roxell <[email protected]>---
Quoted 19 lines
test/cmd_ut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)test/cmd_ut.c +1
-2@@ -297,7 +297,7 @@ static int do_ut(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])int any_fail =0 ;const char *p; -for (; p =strsep (&name,"," ), p; name =NULL ) { +while ((p =strsep (&name,"," ))) { ste =find_suite (p);if (!ste) {printf ("Suite '%s' not found\n" , p); --2.53.0
Quoted 6 lines · Anders Roxell
"ut lib,mem" only runs lib. The loop sets name to NULL after
strsep(), butstrsep()has already moved it past the comma.Loop on
strsep()until it returns NULL.
Applied to u-boot/main, thanks!
[1/1] test: ut: run every suite in a comma separated list
commit: 6bbb926339da1267496089d857b74cc7e897a7b1
Signature · 1 line
Tom