[LTP] [PATCH v2 2/3] lib: Rename variable LTP_ENABLE_DEBUG => LTP_DEBUG

Petr Vorel
2026-03-26T17:05:15Z

1) LTP_DEBUG is shorter to write.
2) Enable is usually meant as boolean (on/off), that hides possible 2
value even more.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
doc/developers/debugging.rst | 2 +-
doc/old/C-Test-API.asciidoc | 2 +-
doc/users/setup_tests.rst | 2 +-
lib/newlib_tests/tst_res_flags.c | 2 +-
lib/tst_test.c | 6 +++---
5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/developers/debugging.rst b/doc/developers/debugging.rst
index 52f881c5c8..36dda0d90f 100644
--- a/doc/developers/debugging.rst
+++ b/doc/developers/debugging.rst
@@ -9,7 +9,7 @@ Debug messages
--------------

The LTP framework supports ``TDEBUG`` flag test debug messages. These
-messages can be enabled using the ``-D[1,2]`` parameter or setting ``LTP_ENABLE_DEBUG=1,2``
+messages can be enabled using the ``-D[1,2]`` parameter or setting ``LTP_DEBUG=1,2``
environment variable (see :doc:`../users/setup_tests`).

The ``-D`` parameter also supports the following verbosity levels:
diff --git a/doc/old/C-Test-API.asciidoc b/doc/old/C-Test-API.asciidoc
index 72fd2731d3..4207b28e92 100644
--- a/doc/old/C-Test-API.asciidoc
+++ b/doc/old/C-Test-API.asciidoc
@@ -232,7 +232,7 @@ Printf-like function to report test result, it's mostly used with ttype:
| 'TPASS' | Test has passed.
| 'TFAIL' | Test has failed.
| 'TINFO' | General message.
-| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'LTP_ENABLE_DEBUG=1' or 'y'
+| 'TDEBUG' | Debug message (new C API only, printed with '-D' or via 'LTP_DEBUG=1' or 'y'
environment variable), only for messages which would be too verbose for normal run.
| 'TWARN' | Something went wrong but we decided to continue. Mostly used in cleanup functions.
|==============================
diff --git a/doc/users/setup_tests.rst b/doc/users/setup_tests.rst
index 95d4d9e380..a42c397feb 100644
--- a/doc/users/setup_tests.rst
+++ b/doc/users/setup_tests.rst
@@ -90,7 +90,7 @@ users.
- Disable running test cleanup (defined in ``TST_CLEANUP``).
Shell API only.

- * - LTP_ENABLE_DEBUG
+ * - LTP_DEBUG
- Enable debug info (value ``1`` (``y``) or ``2`` for more verbose level).
Equivalent of ``-D`` parameter.

diff --git a/lib/newlib_tests/tst_res_flags.c b/lib/newlib_tests/tst_res_flags.c
index 21637a472b..9993d0f87d 100644
--- a/lib/newlib_tests/tst_res_flags.c
+++ b/lib/newlib_tests/tst_res_flags.c
@@ -21,7 +21,7 @@ static struct tcase {
{FLAG(TCONF)},
{FLAG(TWARN)},
{FLAG(TINFO)},
- {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_ENABLE_DEBUG=1,2)"},
+ {FLAG(TDEBUG), " (printed only with -D[1,2] or LTP_DEBUG=1,2)"},
};

static void do_cleanup(void)
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 4a22f2e477..6b41c6e28f 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -675,7 +675,7 @@ static void print_help(void)
fprintf(stderr, "LTP_COLORIZE_OUTPUT Force colorized output behaviour (y/1 always, n/0: never)\n");
fprintf(stderr, "LTP_DEV Path to the block device to be used (for .needs_device)\n");
fprintf(stderr, "LTP_DEV_FS_TYPE Filesystem used for testing (default: %s)\n", DEFAULT_FS_TYPE);
- fprintf(stderr, "LTP_ENABLE_DEBUG Print debug messages (set 1(y) or 2)\n");
+ fprintf(stderr, "LTP_DEBUG Print debug messages (set 1(y) or 2)\n");
fprintf(stderr, "LTP_REPRODUCIBLE_OUTPUT Values 1 or y discard the actual content of the messages printed by the test\n");
fprintf(stderr, "LTP_QUIET Values 1 or y will suppress printing TCONF, TWARN, TINFO, and TDEBUG messages\n");
fprintf(stderr, "LTP_SINGLE_FS_TYPE Specifies filesystem instead all supported (for .all_filesystems)\n");
@@ -1400,7 +1400,7 @@ bool tst_cmd_present(const char *cmd)

static void do_setup(int argc, char *argv[])
{
- char *tdebug_env = getenv("LTP_ENABLE_DEBUG");
+ char *tdebug_env = getenv("LTP_DEBUG");
char *reproducible_env = getenv("LTP_REPRODUCIBLE_OUTPUT");
char *quiet_env = getenv("LTP_QUIET");

@@ -1451,7 +1451,7 @@ static void do_setup(int argc, char *argv[])
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_DEBUG value: '%s'", tdebug_env);

if (context->tdebug)
tst_res(TINFO, "Enabling debug info (level %d)", context->tdebug);
--
2.53.0