* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
[not found] <20260416144213.27221-1-mdoucha@suse.cz>
@ 2026-04-16 18:36 ` linuxtestproject.agent
2026-04-17 13:09 ` Petr Vorel
2026-04-16 18:53 ` [LTP] [PATCH] " Petr Vorel
1 sibling, 1 reply; 9+ messages in thread
From: linuxtestproject.agent @ 2026-04-16 18:36 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
Hi Martin,
On Thu, 16 Apr 2026, Martin Doucha wrote:
> OpenPOSIX: Add common entry point function for all tests
>
> Add a new shared source file implementing the main() function and rename
> the existing main() functions in test case sources to test_main(). This
> allows adding custom debug code to all test cases at once.
[...]
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml b/...
> - NOTE: that the thread in which main() was originally invoked is different
> + NOTE: that the thread in which test_main() was originally invoked is different
This changes verbatim POSIX specification text. The assertions.xml files
quote the POSIX standard, which defines behaviour relative to main() — the C
entry point, not an LTP-internal function name. Revert these hunks in both
pthread_create/assertions.xml and pthread_exit/assertions.xml.
> diff --git a/.../aio_write/9-2.c b/.../aio_write/9-2.c
> +int test_main(int argc, char** argv)
s/char** argv/char **argv/ to match the style used everywhere else.
---
Note:
Our agent completed the review of the patch. The full review can be
found at: https://patchwork.ozlabs.org/project/ltp/list/?series=500173
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH] OpenPOSIX: Add common entry point function for all tests
[not found] <20260416144213.27221-1-mdoucha@suse.cz>
2026-04-16 18:36 ` [LTP] OpenPOSIX: Add common entry point function for all tests linuxtestproject.agent
@ 2026-04-16 18:53 ` Petr Vorel
2026-04-17 0:30 ` Li Wang via ltp
1 sibling, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2026-04-16 18:53 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
Hi all,
> Add a new shared source file implementing the main() function and rename
> the existing main() functions in test case sources to test_main(). This
> allows adding custom debug code to all test cases at once.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Martin, thanks!
Li, Jan, hopefully you don't mind. We'd prefer not having to keep rebasing.
> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
> testcases/open_posix_testsuite/Makefile | 13 +++---
> .../conformance/behavior/WIFEXITED/1-1.c | 2 +-
> .../conformance/interfaces/nanosleep/3-2.c | 2 +-
...
> testcases/open_posix_testsuite/lib/Makefile | 18 ++++++++
> testcases/open_posix_testsuite/lib/common.c | 13 ++++++
> .../scripts/generate-makefiles.sh | 10 ++++-
...
> 1695 files changed, 1974 insertions(+), 1920 deletions(-)
> create mode 100644 testcases/open_posix_testsuite/lib/Makefile
> create mode 100644 testcases/open_posix_testsuite/lib/common.c
...
> diff --git a/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c b/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c
> index ae021917c..6f7044b4a 100644
> --- a/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c
> +++ b/testcases/open_posix_testsuite/conformance/behavior/WIFEXITED/1-1.c
> @@ -11,7 +11,7 @@
> #include <unistd.h>
> #include "posixtest.h"
> -int main()
> +int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
> {
> int s;
...
> new file mode 100644
> index 000000000..ad6a9d7e6
> --- /dev/null
> +++ b/testcases/open_posix_testsuite/lib/Makefile
> @@ -0,0 +1,18 @@
> +top_srcdir?= ..
> +subdir= lib
> +
> +AR?= ar
> +RANLIB?= ranlib
> +CFLAGS+= -I$(top_srcdir)/include
> +
> +
> +vpath %.c $(top_srcdir)/$(subdir)
> +
> +all: libcommon.a
> +
> +clean:
> + rm -f libcommon.a *.o
> +
> +libcommon.a: common.o
> + $(AR) -rc "$@" $^
> + $(RANLIB) "$@"
> diff --git a/testcases/open_posix_testsuite/lib/common.c b/testcases/open_posix_testsuite/lib/common.c
> new file mode 100644
> index 000000000..71e9afb2b
> --- /dev/null
> +++ b/testcases/open_posix_testsuite/lib/common.c
> @@ -0,0 +1,13 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2026 SUSE LLC <mdoucha@suse.cz>
> + *
> + * OpenPOSIX test bootstrap
> + */
> +
> +int test_main(int argc, char **argv);
> +
> +int main(int argc, char **argv)
> +{
> + return test_main(argc, argv);
> +}
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] [PATCH] OpenPOSIX: Add common entry point function for all tests
2026-04-16 18:53 ` [LTP] [PATCH] " Petr Vorel
@ 2026-04-17 0:30 ` Li Wang via ltp
0 siblings, 0 replies; 9+ messages in thread
From: Li Wang via ltp @ 2026-04-17 0:30 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
Hi Petr, Martin,
Petr Vorel <pvorel@suse.cz> wrote:
> > Add a new shared source file implementing the main() function and rename
> > the existing main() functions in test case sources to test_main(). This
> > allows adding custom debug code to all test cases at once.
>
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Martin, thanks!
>
> Li, Jan, hopefully you don't mind. We'd prefer not having to keep rebasing.
Never mind :). Feel free to add:
Reviewed-by: Li Wang <wangli.ahau@gmail.com>
--
Regards,
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
2026-04-16 18:36 ` [LTP] OpenPOSIX: Add common entry point function for all tests linuxtestproject.agent
@ 2026-04-17 13:09 ` Petr Vorel
2026-04-17 13:35 ` Martin Doucha
2026-04-17 14:33 ` Petr Vorel
0 siblings, 2 replies; 9+ messages in thread
From: Petr Vorel @ 2026-04-17 13:09 UTC (permalink / raw)
To: linuxtestproject.agent; +Cc: ltp
Hi Martin,
> Hi Martin,
> On Thu, 16 Apr 2026, Martin Doucha wrote:
> > OpenPOSIX: Add common entry point function for all tests
> > Add a new shared source file implementing the main() function and rename
> > the existing main() functions in test case sources to test_main(). This
> > allows adding custom debug code to all test cases at once.
> [...]
> > diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml b/...
> > - NOTE: that the thread in which main() was originally invoked is different
> > + NOTE: that the thread in which test_main() was originally invoked is different
> This changes verbatim POSIX specification text. The assertions.xml files
> quote the POSIX standard, which defines behaviour relative to main() — the C
> entry point, not an LTP-internal function name. Revert these hunks in both
> pthread_create/assertions.xml and pthread_exit/assertions.xml.
+1
> > diff --git a/.../aio_write/9-2.c b/.../aio_write/9-2.c
> > +int test_main(int argc, char** argv)
> s/char** argv/char **argv/ to match the style used everywhere else.
+1
@Martin, will you please send v2?
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
2026-04-17 13:09 ` Petr Vorel
@ 2026-04-17 13:35 ` Martin Doucha
2026-04-17 14:44 ` Petr Vorel
2026-04-17 14:33 ` Petr Vorel
1 sibling, 1 reply; 9+ messages in thread
From: Martin Doucha @ 2026-04-17 13:35 UTC (permalink / raw)
To: Petr Vorel, linuxtestproject.agent; +Cc: ltp
Hi!
On 4/17/26 15:09, Petr Vorel wrote:
> Hi Martin,
>
>> Hi Martin,
>
>> On Thu, 16 Apr 2026, Martin Doucha wrote:
>>> OpenPOSIX: Add common entry point function for all tests
>
>>> Add a new shared source file implementing the main() function and rename
>>> the existing main() functions in test case sources to test_main(). This
>>> allows adding custom debug code to all test cases at once.
>
>> [...]
>
>>> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml b/...
>>> - NOTE: that the thread in which main() was originally invoked is different
>>> + NOTE: that the thread in which test_main() was originally invoked is different
>
>> This changes verbatim POSIX specification text. The assertions.xml files
>> quote the POSIX standard, which defines behaviour relative to main() — the C
>> entry point, not an LTP-internal function name. Revert these hunks in both
>> pthread_create/assertions.xml and pthread_exit/assertions.xml.
>
> +1
This "issue" is nonsense. I've checked the XML files and the assertions
are still correct as is regardless of renaming a few functions. The
pthread_create() and pthread_exit() specification applies special
treatment to the main thread and adding one more function call between
the main() function and the test code does not change that.
>>> diff --git a/.../aio_write/9-2.c b/.../aio_write/9-2.c
>>> +int test_main(int argc, char** argv)
>
>> s/char** argv/char **argv/ to match the style used everywhere else.
This typo is actually in conformance/interfaces/strcpy/1-1.c (line 23793
of the patch). Please change the test_main() signature to this during merge:
int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv
PTS_ATTRIBUTE_UNUSED)
I don't think it makes sense to send another 1MB patch to fix one line.
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
2026-04-17 13:09 ` Petr Vorel
2026-04-17 13:35 ` Martin Doucha
@ 2026-04-17 14:33 ` Petr Vorel
1 sibling, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2026-04-17 14:33 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp, linuxtestproject.agent
Hi Martin,
> Hi Martin,
> > Hi Martin,
> > On Thu, 16 Apr 2026, Martin Doucha wrote:
> > > OpenPOSIX: Add common entry point function for all tests
> > > Add a new shared source file implementing the main() function and rename
> > > the existing main() functions in test case sources to test_main(). This
> > > allows adding custom debug code to all test cases at once.
> > [...]
> > > diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml b/...
> > > - NOTE: that the thread in which main() was originally invoked is different
> > > + NOTE: that the thread in which test_main() was originally invoked is different
> > This changes verbatim POSIX specification text. The assertions.xml files
> > quote the POSIX standard, which defines behaviour relative to main() — the C
> > entry point, not an LTP-internal function name. Revert these hunks in both
> > pthread_create/assertions.xml and pthread_exit/assertions.xml.
> +1
> > > diff --git a/.../aio_write/9-2.c b/.../aio_write/9-2.c
> > > +int test_main(int argc, char** argv)
> > s/char** argv/char **argv/ to match the style used everywhere else.
> +1
> @Martin, will you please send v2?
@Martin, or I can apply the following diff if you agree.
Kind regards,
Petr
> Kind regards,
> Petr
diff --git testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml
index 9d3cda4d87..7a5e60557d 100644
--- testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml
+++ testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml
@@ -33,12 +33,12 @@
If the 'start_routine' returns, the effect shall be as if there was an
implicit call to pthread_exit() using the return value of 'start_routine'
as the exit status.
- NOTE: that the thread in which test_main() was originally invoked is different
+ NOTE: that the thread in which main() was originally invoked is different
from this
</assertion>
<assertion id="7" tag="ref:XSH6:32848:32849">
- When it returns from test_main(), the effect shall be as if there was an implicit
- call to exit() using the return value of test_main() as the exit status.
+ When it returns from main(), the effect shall be as if there was an implicit
+ call to exit() using the return value of main() as the exit status.
</assertion>
<assertion id="8" tag="ref:XSH6:32850:32852">
The signal state of the new thread will be initialized as so:
diff --git testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml
index 15d2a09a11..f34f6a197e 100644
--- testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml
+++ testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/assertions.xml
@@ -24,7 +24,7 @@
</assertion>
<assertion id="5" tag="ref:XSH6:33031:33033">
An implicit call to pthread_exit() is made when a thread other than the
- thread in which test_main() was first invoked returns from the start routine that
+ thread in which main() was first invoked returns from the start routine that
was used to create it. The function's return value shall serve as the
thread's exit status.
</assertion>
diff --git testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
index 441654ed6c..e783fc92ea 100644
--- testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
+++ testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
@@ -44,7 +44,7 @@ static char *random_string(int len)
return output_string;
}
-int test_main(int argc, char** argv)
+int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv PTS_ATTRIBUTE_UNUSED)
{
char *ret_str;
int i;
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
2026-04-17 13:35 ` Martin Doucha
@ 2026-04-17 14:44 ` Petr Vorel
2026-04-21 8:58 ` Martin Doucha
0 siblings, 1 reply; 9+ messages in thread
From: Petr Vorel @ 2026-04-17 14:44 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp, linuxtestproject.agent
Hi Martin,
> Hi!
I overlooked your reply (please my following one with diff).
> On 4/17/26 15:09, Petr Vorel wrote:
> > Hi Martin,
> > > Hi Martin,
> > > On Thu, 16 Apr 2026, Martin Doucha wrote:
> > > > OpenPOSIX: Add common entry point function for all tests
> > > > Add a new shared source file implementing the main() function and rename
> > > > the existing main() functions in test case sources to test_main(). This
> > > > allows adding custom debug code to all test cases at once.
> > > [...]
> > > > diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/assertions.xml b/...
> > > > - NOTE: that the thread in which main() was originally invoked is different
> > > > + NOTE: that the thread in which test_main() was originally invoked is different
> > > This changes verbatim POSIX specification text. The assertions.xml files
> > > quote the POSIX standard, which defines behaviour relative to main() — the C
> > > entry point, not an LTP-internal function name. Revert these hunks in both
> > > pthread_create/assertions.xml and pthread_exit/assertions.xml.
> > +1
> This "issue" is nonsense. I've checked the XML files and the assertions are
> still correct as is regardless of renaming a few functions. The
> pthread_create() and pthread_exit() specification applies special treatment
> to the main thread and adding one more function call between the main()
> function and the test code does not change that.
I understood that spec talks about main() as a specific C startup function.
But ok, I was probably wrong.
> > > > diff --git a/.../aio_write/9-2.c b/.../aio_write/9-2.c
> > > > +int test_main(int argc, char** argv)
> > > s/char** argv/char **argv/ to match the style used everywhere else.
> This typo is actually in conformance/interfaces/strcpy/1-1.c (line 23793 of
> the patch). Please change the test_main() signature to this during merge:
> int test_main(int argc PTS_ATTRIBUTE_UNUSED, char **argv
> PTS_ATTRIBUTE_UNUSED)
OK, fixed and merged. Thanks!
> I don't think it makes sense to send another 1MB patch to fix one line.
That's why I sent another reply with diff.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
2026-04-17 14:44 ` Petr Vorel
@ 2026-04-21 8:58 ` Martin Doucha
2026-04-21 10:26 ` Petr Vorel
0 siblings, 1 reply; 9+ messages in thread
From: Martin Doucha @ 2026-04-21 8:58 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
On 4/17/26 16:44, Petr Vorel wrote:
>>>> This changes verbatim POSIX specification text. The assertions.xml files
>>>> quote the POSIX standard, which defines behaviour relative to main() — the C
>>>> entry point, not an LTP-internal function name. Revert these hunks in both
>>>> pthread_create/assertions.xml and pthread_exit/assertions.xml.
>
>>> +1
>
>> This "issue" is nonsense. I've checked the XML files and the assertions are
>> still correct as is regardless of renaming a few functions. The
>> pthread_create() and pthread_exit() specification applies special treatment
>> to the main thread and adding one more function call between the main()
>> function and the test code does not change that.
>
> I understood that spec talks about main() as a specific C startup function.
> But ok, I was probably wrong.
The spec DOES talk about main() as the C process startup function. But
the AI for some reason believes that my patch can somehow rewrite the
POSIX standard itself.
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [LTP] OpenPOSIX: Add common entry point function for all tests
2026-04-21 8:58 ` Martin Doucha
@ 2026-04-21 10:26 ` Petr Vorel
0 siblings, 0 replies; 9+ messages in thread
From: Petr Vorel @ 2026-04-21 10:26 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
> On 4/17/26 16:44, Petr Vorel wrote:
> > > > > This changes verbatim POSIX specification text. The assertions.xml files
> > > > > quote the POSIX standard, which defines behaviour relative to main() — the C
> > > > > entry point, not an LTP-internal function name. Revert these hunks in both
> > > > > pthread_create/assertions.xml and pthread_exit/assertions.xml.
> > > > +1
> > > This "issue" is nonsense. I've checked the XML files and the assertions are
> > > still correct as is regardless of renaming a few functions. The
> > > pthread_create() and pthread_exit() specification applies special treatment
> > > to the main thread and adding one more function call between the main()
> > > function and the test code does not change that.
> > I understood that spec talks about main() as a specific C startup function.
> > But ok, I was probably wrong.
> The spec DOES talk about main() as the C process startup function. But the
> AI for some reason believes that my patch can somehow rewrite the POSIX
> standard itself.
I understand it differently: keep main() because that's the C entry function
and any reader of assertions.xml does not really care about our implementation
that we wrap main() with other function for our internal purposes of other test
scenario.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-04-21 10:26 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260416144213.27221-1-mdoucha@suse.cz>
2026-04-16 18:36 ` [LTP] OpenPOSIX: Add common entry point function for all tests linuxtestproject.agent
2026-04-17 13:09 ` Petr Vorel
2026-04-17 13:35 ` Martin Doucha
2026-04-17 14:44 ` Petr Vorel
2026-04-21 8:58 ` Martin Doucha
2026-04-21 10:26 ` Petr Vorel
2026-04-17 14:33 ` Petr Vorel
2026-04-16 18:53 ` [LTP] [PATCH] " Petr Vorel
2026-04-17 0:30 ` Li Wang via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox