Skip to contentSkip to conversation

kunit: Fix merge issue in suite filtering test

PATCH In review David Gow 3 participants 4 messages Jun 25, 2021

Subsystems (2)
lore
Share & tools
lore

David Gow

author
#0 lore raw

PATCH 1/1 kunit: Fix merge issue in suite filtering test

There were a couple of errors introuced when
"kunit: add unit test for filtering suites by names"[1] was merged in c9d80ffc5a.

An erroneous '+' was introduced in executor.c, and the executor_test.c file went missing. This causes the kernel to fail to compile if CONFIG_KUNIT is enabled, as reported in [2,3].

As with the original, I've tested by running just the new tests using itself:

$ ./tools/testing/kunit/kunit.py run '*exec*'

[1]: https://lore.kernel.org/linux-kselftest/[email protected]/
[2]: https://lists.01.org/hyperkitty/list/[email protected]/thread/6IKQX5JXZF7I3NFH4IAWUMHXEQSCPNDP/
[3]: https://lists.01.org/hyperkitty/list/[email protected]/thread/EKY7ZH5YDCCTSJF2G7XFPMGIXQSUVD3Y/

Fixes c9d80ffc5a ("kunit: add unit test for filtering suites by names")

---

This is another fix for the kunit-fixes branch, where there seems to have been an issue merging the "kunit: add unit test for filtering suites by names" patch here:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit-fixes&id=c9d80ffc5a0a30955de0b8c5c46a05906d417800

Again, feel free to squash this into the original patch if that works better.

Cheers,
-- David

 lib/kunit/executor.c      |   2 +-
 lib/kunit/executor_test.c | 133 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 134 insertions(+), 1 deletion(-)
 create mode 100644 lib/kunit/executor_test.c
lib/kunit/executor.c +1 -1
index 672f91486d23..acd1de436f59 100644
@@ -23,7 +23,7 @@ static char *kunit_shutdown;
 core_param(kunit_shutdown, kunit_shutdown, charp, 0644);
 
 static struct kunit_suite * const *
-+kunit_filter_subsuite(struct kunit_suite * const * const subsuite,
+kunit_filter_subsuite(struct kunit_suite * const * const subsuite,
 			const char *filter_glob)
 {
 	int i, n = 0;
lib/kunit/executor_test.c new file +133 -0

133 lines not on this page · raw message

Signature · 1 line
2.32.0.93.g670b81a890-goog
maintainer
#1 lore raw
Quoted 21 lines · David Gow

There were a couple of errors introuced when
"kunit: add unit test for filtering suites by names"[1] was merged in c9d80ffc5a.

An erroneous '+' was introduced in executor.c, and the executor_test.c file went missing. This causes the kernel to fail to compile if CONFIG_KUNIT is enabled, as reported in [2,3].

As with the original, I've tested by running just the new tests using itself:

$ ./tools/testing/kunit/kunit.py run '*exec*'

[1]: https://lore.kernel.org/linux-kselftest/[email protected]/
[2]: https://lists.01.org/hyperkitty/list/[email protected]/thread/6IKQX5JXZF7I3NFH4IAWUMHXEQSCPNDP/
[3]: https://lists.01.org/hyperkitty/list/[email protected]/thread/EKY7ZH5YDCCTSJF2G7XFPMGIXQSUVD3Y/

Fixes c9d80ffc5a ("kunit: add unit test for filtering suites by names")

---

Quoted 8 lines

This is another fix for the kunit-fixes branch, where there seems to have been an issue merging the "kunit: add unit test for filtering suites by names" patch here:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit-fixes&id=c9d80ffc5a0a30955de0b8c5c46a05906d417800

Again, feel free to squash this into the original patch if that works better.

Thank you. My bad. Applied to kunit-fixes now.

thanks,

-- Shuah

#2 lore raw
Quoted 28 lines · Shuah Khan
Quoted 26 lines · David Gow

There were a couple of errors introuced when
"kunit: add unit test for filtering suites by names"[1] was merged in c9d80ffc5a.

An erroneous '+' was introduced in executor.c, and the executor_test.c file went missing. This causes the kernel to fail to compile if CONFIG_KUNIT is enabled, as reported in [2,3].

As with the original, I've tested by running just the new tests using itself:

$ ./tools/testing/kunit/kunit.py run '*exec*'

[1]: https://lore.kernel.org/linux-kselftest/[email protected]/
[2]: https://lists.01.org/hyperkitty/list/[email protected]/thread/6IKQX5JXZF7I3NFH4IAWUMHXEQSCPNDP/
[3]: https://lists.01.org/hyperkitty/list/[email protected]/thread/EKY7ZH5YDCCTSJF2G7XFPMGIXQSUVD3Y/

Fixes c9d80ffc5a ("kunit: add unit test for filtering suites by names")

---

This is another fix for the kunit-fixes branch, where there seems to have been an issue merging the "kunit: add unit test for filtering suites by names" patch here:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit-fixes&id=c9d80ffc5a0a30955de0b8c5c46a05906d417800

Quoted 5 lines
Quoted 3 lines

Again, feel free to squash this into the original patch if that works better.

Thank you. My bad. Applied to kunit-fixes now.

Hmm, it looks like executor_test.c might not have made it into kunit-fixes. I believe this is the applied version of this patch:

$ git show d833ce7480864d4d7eb2dbb04320858be3578b2a --stat
commit d833ce7480864d4d7eb2dbb04320858be3578b2a
Author: David Gow <[email protected]>
Date:   Fri Jun 25 04:16:03 2021 -0700

kunit: Fix merge issue in suite filtering test
...

 lib/kunit/executor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

The result looks like this:

$ ./tools/testing/kunit/kunit.py run
...
$ make ARCH=um --jobs=8 O=.kunit
ERROR:root:../lib/kunit/executor.c:140:10: fatal error:
executor_test.c: No such file or directory
  140 | #include "executor_test.c"
      |          ^~~~~~~~~~~~~~~~~

I just git am or something just really doesn't like executor_test.c :)

Quoted 11 lines

thanks,

-- Shuah

--
You received this message because you are subscribed to the Google Groups "KUnit Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/99c2564c-4175-7e3e-84c3-3bcb6d4f9d58%40linuxfoundation.org.

maintainer
#3 lore raw
Quoted 58 lines · Daniel Latypov
Quoted 28 lines · Shuah Khan
Quoted 26 lines · David Gow

There were a couple of errors introuced when
"kunit: add unit test for filtering suites by names"[1] was merged in c9d80ffc5a.

An erroneous '+' was introduced in executor.c, and the executor_test.c file went missing. This causes the kernel to fail to compile if CONFIG_KUNIT is enabled, as reported in [2,3].

As with the original, I've tested by running just the new tests using itself:

$ ./tools/testing/kunit/kunit.py run '*exec*'

[1]: https://lore.kernel.org/linux-kselftest/[email protected]/
[2]: https://lists.01.org/hyperkitty/list/[email protected]/thread/6IKQX5JXZF7I3NFH4IAWUMHXEQSCPNDP/
[3]: https://lists.01.org/hyperkitty/list/[email protected]/thread/EKY7ZH5YDCCTSJF2G7XFPMGIXQSUVD3Y/

Fixes c9d80ffc5a ("kunit: add unit test for filtering suites by names")

---

This is another fix for the kunit-fixes branch, where there seems to have been an issue merging the "kunit: add unit test for filtering suites by names" patch here:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit-fixes&id=c9d80ffc5a0a30955de0b8c5c46a05906d417800

Quoted 5 lines
Quoted 3 lines

Again, feel free to squash this into the original patch if that works better.

Thank you. My bad. Applied to kunit-fixes now.

Hmm, it looks like executor_test.c might not have made it into kunit-fixes. I believe this is the applied version of this patch:

$ git show d833ce7480864d4d7eb2dbb04320858be3578b2a --stat
commit d833ce7480864d4d7eb2dbb04320858be3578b2a
Author: David Gow <[email protected]>
Date:   Fri Jun 25 04:16:03 2021 -0700

kunit: Fix merge issue in suite filtering test
...

  lib/kunit/executor.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

The result looks like this:

$ ./tools/testing/kunit/kunit.py run
...
$ make ARCH=um --jobs=8 O=.kunit
ERROR:root:../lib/kunit/executor.c:140:10: fatal error:
executor_test.c: No such file or directory
   140 | #include "executor_test.c"
       |          ^~~~~~~~~~~~~~~~~
Quoted 3 lines

I just git am or something just really doesn't like executor_test.c :)

My mistake it looks like in merging the patch. I had to fix merge conflicts and made a mistake. I will fix it now.

Odd that my local compile didn't catch the problem. I used the tools/testing/kunit/kunit.py build

thanks,
-- Shuah