[LTP] [PATCH] lib/tst_test.c: adjust the tst_kconfig_check position

Yang Xu xuyang2018.jy@fujitsu.com
Wed Jan 5 10:23:29 CET 2022


Since tst_kconfig_check is front of parse_opts, then running
test_kconfig01 -h can not get the print_help info.

Fix this by moving tst_kconfig_check behind parse_opts.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 lib/tst_test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 23fc0ebf4..9fea7263a 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1016,9 +1016,6 @@ static void do_setup(int argc, char *argv[])
 	if (tst_test->tconf_msg)
 		tst_brk(TCONF, "%s", tst_test->tconf_msg);
 
-	if (tst_test->needs_kconfigs)
-		tst_kconfig_check(tst_test->needs_kconfigs);
-
 	assert_test_fn();
 
 	TCID = tid = get_tid(argv);
@@ -1028,6 +1025,9 @@ static void do_setup(int argc, char *argv[])
 
 	parse_opts(argc, argv);
 
+	if (tst_test->needs_kconfigs)
+		tst_kconfig_check(tst_test->needs_kconfigs);
+
 	if (tst_test->needs_root && geteuid() != 0)
 		tst_brk(TCONF, "Test needs to be run as root");
 
-- 
2.23.0



More information about the ltp mailing list