Check for -i0
cover Check for -i0
NOTE: this should be merged after Cyril's runtime patch (will need to get rebased).
Kind regards,
Petr
Petr Vorel (3):
tst_test.sh: Allow -i0
tst_test: Check for -i >= 0
doc/maintainer: Check also -i0
doc/maintainer-patch-review-checklist.txt | 1 + lib/tst_test.c | 2 ++ testcases/lib/tst_test.sh | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-)
Signature · 5 lines
2.36.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 1/3 tst_test.sh: Allow -i0
-i0 is supported in C API, allowing to test only that setup and cleanup are coded properly (no test is being run), which is useful for debugging.
Signed-off-by Petr Vorel <[email protected]>
--- testcases/lib/tst_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
testcases/lib/tst_test.sh +2 -2
@@ -646,8 +646,8 @@ tst_run() tst_brk TBROK "Expected number (-i) not '$TST_ITERATIONS'" fi - if [ "$TST_ITERATIONS" -le 0 ]; then - tst_brk TBROK "Number of iterations (-i) must be > 0" + if [ "$TST_ITERATIONS" -lt 0 ]; then + tst_brk TBROK "Number of iterations (-i) must be >= 0" fi [ "$TST_NEEDS_ROOT" = 1 ] && tst_require_root
Signature · 5 lines
2.36.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 2/3 tst_test: Check for -i >= 0
In reply to Petr VorelSigned-off-by Petr Vorel <[email protected]>
--- lib/tst_test.c | 2 ++ 1 file changed, 2 insertions(+)
lib/tst_test.c +2 -0
@@ -618,6 +618,8 @@ static void parse_opts(int argc, char *argv[])exit (0 );case 'i' : iterations =atoi (optarg); +if (iterations <0 ) +tst_brk (TBROK ,"Number of iterations (-i) must be >= 0" );break ;case 'I' : duration =atof (optarg);
Signature · 5 lines
2.36.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH 3/3 doc/maintainer: Check also -i0
In reply to Petr VorelSigned-off-by Petr Vorel <[email protected]>
--- doc/maintainer-patch-review-checklist.txt | 1 + 1 file changed, 1 insertion(+)
doc/maintainer-patch-review-checklist.txt +1 -0
@@ -30,6 +30,7 @@ New test should * Have a record in runtest file * Test should work fine with more than one iteration (e.g. run with `-i 100`) +* Run with `-i 0` to check that setup and cleanup are coded properly (no test is being run) * Have a brief description * License: the default license for new tests is GPL v2 or later, use GPL-2.0-or-later; the licence for test (e.g. GPL-2.0) should not change
Signature · 5 lines
2.36.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi!
Looks good to me:
Reviewed-by Cyril Hrubis <[email protected]>
Signature · 5 lines
Cyril Hrubis [email protected] -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Cyril,
Quoted 2 lines
Hi!
Looks good to me:
Thanks, merged!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp