2024-04-15 04:39:24

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the kselftest tree with Linus' tree

Hi all,

Today's linux-next merge of the kselftest tree got a conflict in:

tools/testing/selftests/kselftest.h

between commit:

f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn")

from Linus' tree and commit:

5d3a9274f0d1 ("kselftest: Add mechanism for reporting a KSFT_ result code")
f07041728422 ("selftests: add ksft_exit_fail_perror()")

from the kselftest tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc tools/testing/selftests/kselftest.h
index 7b89362da4bf,2cd93d220f43..000000000000
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@@ -303,7 -302,28 +306,28 @@@ void ksft_test_result_code(int exit_cod
va_end(args);
}

+ /**
+ * ksft_test_result() - Report test success based on truth of condition
+ *
+ * @condition: if true, report test success, otherwise failure.
+ */
+ #define ksft_test_result_report(result, fmt, ...) do { \
+ switch (result) { \
+ case KSFT_PASS: \
+ ksft_test_result_pass(fmt, ##__VA_ARGS__); \
+ break; \
+ case KSFT_FAIL: \
+ ksft_test_result_fail(fmt, ##__VA_ARGS__); \
+ break; \
+ case KSFT_XFAIL: \
+ ksft_test_result_xfail(fmt, ##__VA_ARGS__); \
+ break; \
+ case KSFT_SKIP: \
+ ksft_test_result_skip(fmt, ##__VA_ARGS__); \
+ break; \
+ } } while (0)
+
-static inline int ksft_exit_pass(void)
+static inline __noreturn int ksft_exit_pass(void)
{
ksft_print_cnts();
exit(KSFT_PASS);
@@@ -351,7 -371,20 +375,20 @@@ static inline __noreturn __printf(1, 2
exit(KSFT_FAIL);
}

+ static inline void ksft_exit_fail_perror(const char *msg)
+ {
+ #ifndef NOLIBC
+ ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno);
+ #else
+ /*
+ * nolibc doesn't provide strerror() and it seems
+ * inappropriate to add one, just print the errno.
+ */
+ ksft_exit_fail_msg("%s: %d)\n", msg, errno);
+ #endif
+ }
+
-static inline int ksft_exit_xfail(void)
+static inline __noreturn int ksft_exit_xfail(void)
{
ksft_print_cnts();
exit(KSFT_XFAIL);


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-04-16 23:56:20

by Shuah Khan

[permalink] [raw]
Subject: Re: linux-next: manual merge of the kselftest tree with Linus' tree

On 4/14/24 22:39, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the kselftest tree got a conflict in:
>
> tools/testing/selftests/kselftest.h
>
> between commit:
>
> f7d5bcd35d42 ("selftests: kselftest: Mark functions that unconditionally call exit() as __noreturn")
>
> from Linus' tree and commit:
>
> 5d3a9274f0d1 ("kselftest: Add mechanism for reporting a KSFT_ result code")
> f07041728422 ("selftests: add ksft_exit_fail_perror()")
>
> from the kselftest tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>

Rebased to Linux 6.9-rc4 and resolved these two merge conflicts
in linux-kselftest next.

thanks,
-- Shuah