diff mbox series

lib/tst_test.c: adjust the tst_kconfig_check position

Message ID 1641374609-2143-1-git-send-email-xuyang2018.jy@fujitsu.com
State Accepted
Headers show
Series lib/tst_test.c: adjust the tst_kconfig_check position | expand

Commit Message

Yang Xu Jan. 5, 2022, 9:23 a.m. UTC
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(-)

Comments

Cyril Hrubis Jan. 5, 2022, 11:06 a.m. UTC | #1
Hi!
Good catch.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Yang Xu Jan. 6, 2022, 2:20 a.m. UTC | #2
Hi Cyril
> Hi!
> Good catch.
>
> Reviewed-by: Cyril Hrubis<chrubis@suse.cz>
Thanks for your review, merged.

Best Regards
Yang Xu
>
diff mbox series

Patch

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");