]> git.ipfire.org Git - thirdparty/kmod.git/commit
testsuite: remove need_spawn = false support
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 15 Nov 2024 15:54:43 +0000 (15:54 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 21 Nov 2024 04:27:37 +0000 (22:27 -0600)
commitc5c36b61da7e85e16e771ff09e62011225152a5d
tree125d9c9c61e15b97d14ef3bc5cf91737ea04ec02
parentd75b9949aa4589d927622f8627718d09fbba3abf
testsuite: remove need_spawn = false support

Our test suite is a little unique in my experience in that the test can
be either a normal (fork) child or a (re)spawned one. All the other test
frameworks I have used opt for only one of the two.

I'm not entirely sure why we have both since the latter is sufficient for
all use-cases that we have. Perhaps the former was kept as
micro-optimisation?

Currently I am exploring a way to provide the results summary and the
need_spawn = false ones, are printed multiple times. At a glance I
couldn't quite find a way to fix it.

In addition I am also looking at removing/reducing the use of exit()
across the test suite. Where the two code-flows makes that process more
convoluted.

So let's remove one of the code-paths, simplify things and fix the
logging output. If needed we can re-introduce it later on.

NOTE: there's a lot going on here, because clang-format insist on
reformatting bunch of the DEFINE_TEST() instances :-\

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/246
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
13 files changed:
testsuite/README
testsuite/test-blacklist.c
testsuite/test-dependencies.c
testsuite/test-init.c
testsuite/test-initstate.c
testsuite/test-loaded.c
testsuite/test-modprobe.c
testsuite/test-new-module.c
testsuite/test-testsuite.c
testsuite/test-util.c
testsuite/test-weakdep.c
testsuite/testsuite.c
testsuite/testsuite.h