From: Lucas De Marchi Date: Mon, 6 Jan 2025 16:07:07 +0000 (-0600) Subject: testsuite: Assert a test binary is non-empty X-Git-Tag: v34~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3099e492a200abf2fcfa1343f4629edbef3ed1b8;p=thirdparty%2Fkmod.git testsuite: Assert a test binary is non-empty Avoid issues like https://github.com/kmod-project/kmod/issues/269 by asserting the test binary is non-empty: Suggested-by: Emil Velikov Signed-off-by: Lucas De Marchi --- diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c index 0490d5e7..3a55e2f2 100644 --- a/testsuite/testsuite.c +++ b/testsuite/testsuite.c @@ -82,6 +82,9 @@ int test_init(const struct test *start, const struct test *stop, int argc, { progname = argv[0]; + /* An empty testsuite is not likely intended */ + assert_return(start != stop, -EINVAL); + for (;;) { int c, idx = 0; c = getopt_long(argc, argv, options_short, options, &idx);