public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Cc: Martin Cermak <mcermak@redhat.com>
Subject: [LTP] [PATCH v5 1/6] lib: Ignore empty LTP_ENABLE_DEBUG
Date: Thu, 23 Apr 2026 10:41:17 +0200	[thread overview]
Message-ID: <20260423084123.657690-2-pvorel@suse.cz> (raw)
In-Reply-To: <20260423084123.657690-1-pvorel@suse.cz>

Empty LTP_ENABLE_DEBUG environment variable should be just ignored.

This fixes warning:
LTP_ENABLE_DEBUG= ./test05
tst_test.c:1454: TWARN: Invalid LTP_ENABLE_DEBUG value:

Fixes: e434de62b4 ("lib: Extend LTP_ENABLE_DEBUG to support verbosity levels")
Reviewed-by: Li Wang <liwang@redhat.com>
Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 26f6510a0a..229da669fa 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1445,13 +1445,13 @@ static void do_setup(int argc, char *argv[])
 
 	parse_opts(argc, argv);
 
-	if (tdebug_env && !context->tdebug) {
+	if (tdebug_env && *tdebug_env && !context->tdebug) {
 		if (!strcmp(tdebug_env, "2"))
 			context->tdebug = 2;
 		else if (!strcmp(tdebug_env, "1") || !strcmp(tdebug_env, "y"))
 			context->tdebug = 1;
 		else
-			tst_res(TWARN, "Invalid LTP_ENABLE_DEBUG value: %s", tdebug_env);
+			tst_res(TWARN, "Invalid LTP_ENABLE_DEBUG value: '%s'", tdebug_env);
 
 		if (context->tdebug)
 			tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-04-23  8:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23  8:41 [LTP] [PATCH v5 0/6] lib: LTP_DEBUG cleanup Petr Vorel
2026-04-23  8:41 ` Petr Vorel [this message]
2026-04-23  9:36   ` [LTP] lib: Ignore empty LTP_ENABLE_DEBUG linuxtestproject.agent
2026-04-23  8:41 ` [LTP] [PATCH v5 2/6] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG Petr Vorel
2026-04-23  8:41 ` [LTP] [PATCH v5 3/6] lib: Prefer LTP_DEBUG over -D Petr Vorel
2026-04-23  8:41 ` [LTP] [PATCH v5 4/6] doc: newlib_tests: Update debugging parameters Petr Vorel
2026-04-23  8:41 ` [LTP] [PATCH v5 5/6] lib: Merge functionality of LTP_QUIET into LTP_REPRODUCIBLE_OUTPUT Petr Vorel
2026-04-23  9:38   ` Petr Vorel
2026-04-23  8:41 ` [LTP] [PATCH v5 6/6] lib: Print TCONF on LTP_REPRODUCIBLE_OUTPUT=1 Petr Vorel
2026-04-23  9:39   ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260423084123.657690-2-pvorel@suse.cz \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mcermak@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox