* [LTP] [PATCH] ltp: keep the .tid hidden in the test library
@ 2017-10-25 8:11 Li Wang
2017-10-25 9:01 ` Li Wang
0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2017-10-25 8:11 UTC (permalink / raw)
To: ltp
And also fix some typos at the same time.
Signed-off-by: Li Wang <liwang@redhat.com>
---
include/tst_safe_macros.h | 2 +-
include/tst_timer_test.h | 1 -
lib/tst_test.c | 8 +++++---
testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c | 3 +--
testcases/kernel/syscalls/epoll_wait/epoll_wait02.c | 1 -
testcases/kernel/syscalls/futex/futex_wait05.c | 1 -
testcases/kernel/syscalls/poll/poll02.c | 1 -
testcases/kernel/syscalls/pselect/pselect01.c | 1 -
testcases/kernel/syscalls/select/select04.c | 1 -
9 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index 9562005..ed9c73c 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -406,7 +406,7 @@ static inline sighandler_t safe_signal(const char *file, const int lineno,
#define SAFE_EXECL(file, arg, ...) do { \
execl((file), (arg), ##__VA_ARGS__); \
tst_brk_(__FILE__, __LINE__, TBROK | TERRNO, \
- "execlp(%s, %s, ...) failed", file, arg); \
+ "execl(%s, %s, ...) failed", file, arg); \
} while (0)
int safe_getpriority(const char *file, const int lineno, int which, id_t who);
diff --git a/include/tst_timer_test.h b/include/tst_timer_test.h
index 59931d3..c22159a 100644
--- a/include/tst_timer_test.h
+++ b/include/tst_timer_test.h
@@ -37,7 +37,6 @@
}
struct tst_test test = {
- .tid = "syscall_name()",
.sample = sample,
};
diff --git a/lib/tst_test.c b/lib/tst_test.c
index f8b3fb4..5b3f9c1 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -688,11 +688,13 @@ static void do_setup(int argc, char *argv[])
assert_test_fn();
- if (tst_test->sample)
- tst_test = tst_timer_test_setup(tst_test);
-
if (!tst_test->tid)
tst_test->tid = get_tid(argv);
+ else
+ tst_brk(TBROK, "The .tid field should not be set in the tests");
+
+ if (tst_test->sample)
+ tst_test = tst_timer_test_setup(tst_test);
parse_opts(argc, argv);
diff --git a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c
index f114013..0efaf23 100644
--- a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c
+++ b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c
@@ -36,7 +36,7 @@ int sample_fn(int clk_id, long long usec)
if (TEST_RETURN != 0) {
tst_res(TFAIL | TERRNO,
- "nanosleep() returned %li", TEST_RETURN);
+ "clock_nanosleep() returned %li", TEST_RETURN);
return 1;
}
@@ -44,6 +44,5 @@ int sample_fn(int clk_id, long long usec)
}
static struct tst_test test = {
- .tid = "nanosleep()",
.sample = sample_fn,
};
diff --git a/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c b/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c
index aa1bd0d..9ffe9bd 100644
--- a/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c
+++ b/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c
@@ -77,7 +77,6 @@ static void cleanup(void)
}
static struct tst_test test = {
- .tid = "epoll_wait()",
.sample = sample_fn,
.setup = setup,
.cleanup = cleanup,
diff --git a/testcases/kernel/syscalls/futex/futex_wait05.c b/testcases/kernel/syscalls/futex/futex_wait05.c
index f6b0aa1..8459c3d 100644
--- a/testcases/kernel/syscalls/futex/futex_wait05.c
+++ b/testcases/kernel/syscalls/futex/futex_wait05.c
@@ -52,6 +52,5 @@ int sample_fn(int clk_id, long long usec)
}
static struct tst_test test = {
- .tid = "futex_wait()",
.sample = sample_fn,
};
diff --git a/testcases/kernel/syscalls/poll/poll02.c b/testcases/kernel/syscalls/poll/poll02.c
index 0aa228c..71d7369 100644
--- a/testcases/kernel/syscalls/poll/poll02.c
+++ b/testcases/kernel/syscalls/poll/poll02.c
@@ -64,7 +64,6 @@ static void cleanup(void)
}
static struct tst_test test = {
- .tid = "poll()",
.sample = sample_fn,
.setup = setup,
.cleanup = cleanup,
diff --git a/testcases/kernel/syscalls/pselect/pselect01.c b/testcases/kernel/syscalls/pselect/pselect01.c
index a2b5339..fc55bf2 100644
--- a/testcases/kernel/syscalls/pselect/pselect01.c
+++ b/testcases/kernel/syscalls/pselect/pselect01.c
@@ -44,6 +44,5 @@ int sample_fn(int clk_id, long long usec)
}
static struct tst_test test = {
- .tid = "pselect()",
.sample = sample_fn,
};
diff --git a/testcases/kernel/syscalls/select/select04.c b/testcases/kernel/syscalls/select/select04.c
index 1431785..46ad934 100644
--- a/testcases/kernel/syscalls/select/select04.c
+++ b/testcases/kernel/syscalls/select/select04.c
@@ -66,7 +66,6 @@ static void cleanup(void)
}
static struct tst_test test = {
- .tid = "select()",
.sample = sample_fn,
.setup = setup,
.cleanup = cleanup,
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* [LTP] [PATCH] ltp: keep the .tid hidden in the test library
2017-10-25 8:11 [LTP] [PATCH] ltp: keep the .tid hidden in the test library Li Wang
@ 2017-10-25 9:01 ` Li Wang
2017-10-25 9:05 ` Cyril Hrubis
0 siblings, 1 reply; 4+ messages in thread
From: Li Wang @ 2017-10-25 9:01 UTC (permalink / raw)
To: ltp
Hi Cyril,
Attaching a new patch to achieve the same target in another way. It
just remove the .tid from test struct and take use of TCID to replace.
Which one do you think is better?
--
Li Wang
liwang@redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ltp-remove-.tid-from-test-struct.patch
Type: text/x-patch
Size: 9335 bytes
Desc: not available
URL: <http://lists.linux.it/pipermail/ltp/attachments/20171025/5b7a073b/attachment-0001.bin>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] ltp: keep the .tid hidden in the test library
2017-10-25 9:01 ` Li Wang
@ 2017-10-25 9:05 ` Cyril Hrubis
2017-10-25 9:15 ` Li Wang
0 siblings, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2017-10-25 9:05 UTC (permalink / raw)
To: ltp
Hi!
> Attaching a new patch to achieve the same target in another way. It
> just remove the .tid from test struct and take use of TCID to replace.
>
> Which one do you think is better?
I think that removing it from the test structure is better, but reusing
the oldlib TCID seems to be a bit messy solution to me. We may get rid
of that one in the future, if we happen to convert all the oldlib
testcases. I would be a bit happier if we decleared static char *tid in
the tst_test.c instead.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] ltp: keep the .tid hidden in the test library
2017-10-25 9:05 ` Cyril Hrubis
@ 2017-10-25 9:15 ` Li Wang
0 siblings, 0 replies; 4+ messages in thread
From: Li Wang @ 2017-10-25 9:15 UTC (permalink / raw)
To: ltp
On Wed, Oct 25, 2017 at 5:05 PM, Cyril Hrubis <chrubis@suse.cz> wrote:
> Hi!
>> Attaching a new patch to achieve the same target in another way. It
>> just remove the .tid from test struct and take use of TCID to replace.
>>
>> Which one do you think is better?
>
> I think that removing it from the test structure is better, but reusing
> the oldlib TCID seems to be a bit messy solution to me. We may get rid
> of that one in the future, if we happen to convert all the oldlib
> testcases. I would be a bit happier if we decleared static char *tid in
> the tst_test.c instead.
Ok, I understand. Thanks for reviewing quickly. Let me drafted a new patch.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-25 9:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-25 8:11 [LTP] [PATCH] ltp: keep the .tid hidden in the test library Li Wang
2017-10-25 9:01 ` Li Wang
2017-10-25 9:05 ` Cyril Hrubis
2017-10-25 9:15 ` Li Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox