Linux Test Project
 help / color / mirror / Atom feed
From: Li Wang via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH RFC 1/2] lib: rename tid to tcid
Date: Tue, 13 May 2025 14:55:14 +0800	[thread overview]
Message-ID: <20250513065515.49865-2-liwang@redhat.com> (raw)
In-Reply-To: <20250513065515.49865-1-liwang@redhat.com>

tcid is better to reflect testcase id, but not mislead developer
to think of thread id (tid).

Signed-off-by: Li Wang <liwang@redhat.com>
---
 lib/tst_test.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/tst_test.c b/lib/tst_test.c
index 9f11c1c47..fbbfda426 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -55,7 +55,7 @@ const char *TCID __attribute__((weak));
 
 struct tst_test *tst_test;
 
-static const char *tid;
+static const char *tcid;
 static int iterations = 1;
 static float duration = -1;
 static float timeout_mul = -1;
@@ -106,7 +106,7 @@ static void setup_ipc(void)
 
 	if (access("/dev/shm", F_OK) == 0) {
 		snprintf(shm_path, sizeof(shm_path), "/dev/shm/ltp_%s_%d",
-			 tid, getpid());
+			 tcid, getpid());
 	} else {
 		char *tmpdir;
 
@@ -115,7 +115,7 @@ static void setup_ipc(void)
 
 		tmpdir = tst_get_tmpdir();
 		snprintf(shm_path, sizeof(shm_path), "%s/ltp_%s_%d",
-			 tmpdir, tid, getpid());
+			 tmpdir, tcid, getpid());
 		free(tmpdir);
 	}
 
@@ -1048,7 +1048,7 @@ static void copy_resources(void)
 		TST_RESOURCE_COPY(NULL, tst_test->resource_files[i], NULL);
 }
 
-static const char *get_tid(char *argv[])
+static const char *get_tcid(char *argv[])
 {
 	char *p;
 
@@ -1146,7 +1146,7 @@ int tst_creat_unlinked(const char *path, int flags, mode_t mode)
 	int start[3] = {'0', 'a', 'A'};
 
 	snprintf(template, PATH_MAX, "%s/ltp_%.3sXXXXXX",
-			path, tid);
+			path, tcid);
 
 	len = strlen(template) - 1;
 	while (template[len] == 'X') {
@@ -1318,7 +1318,7 @@ static void do_setup(int argc, char *argv[])
 
 	assert_test_fn();
 
-	TCID = tid = get_tid(argv);
+	TCID = tcid = get_tcid(argv);
 
 	if (tst_test->sample)
 		tst_test = tst_timer_test_setup(tst_test);
-- 
2.49.0


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

  reply	other threads:[~2025-05-13  6:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  6:55 [LTP] [PATCH RFC 0/2] Refactor test state handling and clarify naming in LTP Li Wang via ltp
2025-05-13  6:55 ` Li Wang via ltp [this message]
2025-05-13 12:26   ` [LTP] [PATCH RFC 1/2] lib: rename tid to tcid Petr Vorel
2025-05-13  6:55 ` [LTP] [PATCH RFC 2/2] lib: moves test infrastructure states into a shared context structure Li Wang via ltp
2025-05-13 13:19   ` Li Wang via ltp

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=20250513065515.49865-2-liwang@redhat.com \
    --to=ltp@lists.linux.it \
    --cc=liwang@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