[LTP] [RFC][PATCH 4/6] run_shell_tcnt: Add test count also for test_all

Petr Vorel pvorel@suse.cz
Fri Mar 13 15:25:58 CET 2026


tst_test.sh shell API has TST_CNT=1 also for tests which are using only
$TST_TESTFUNC without $TST_CNT, i.e. when running only a single
function. Follow this approach. This will be reused in the following
commit.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Instead of this, we can just check for 1 or empty:
[ "$1" = 1 -o -z "1" ]

 testcases/lib/tst_run_shell.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/testcases/lib/tst_run_shell.c b/testcases/lib/tst_run_shell.c
index ab6f4fda58..6defa9f7e7 100644
--- a/testcases/lib/tst_run_shell.c
+++ b/testcases/lib/tst_run_shell.c
@@ -11,11 +11,6 @@
 
 static char *shell_filename;
 
-static void run_shell(void)
-{
-	tst_run_script(shell_filename, NULL);
-}
-
 static void run_shell_tcnt(unsigned int n)
 {
 	char buf[128];
@@ -26,6 +21,11 @@ static void run_shell_tcnt(unsigned int n)
 	tst_run_script(shell_filename, params);
 }
 
+static void run_shell(void)
+{
+	run_shell_tcnt(0);
+}
+
 static struct tst_test test = {
 	.runs_script = 1,
 };
-- 
2.51.0



More information about the ltp mailing list