]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-test: Warn if test_run or test_run_named result is not used
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 9 Aug 2018 09:38:43 +0000 (12:38 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 9 Aug 2018 09:44:44 +0000 (12:44 +0300)
Ensures hopefully that unit tests do not succeed when they fail
due to wrong exit code.

src/lib-test/test-common.h

index cba5a79865b6aa1b2b5bc2234213ccbcc94c0ce4..0c84fab40d3c8b8bb1d310007012d9a640ebfbe3 100644 (file)
@@ -52,12 +52,12 @@ void test_out_quiet(const char *name, bool success); /* only prints failures */
 void test_out_reason(const char *name, bool success, const char *reason)
        ATTR_NULL(3);
 
-int test_run(void (*const test_functions[])(void));
+int test_run(void (*const test_functions[])(void)) ATTR_WARN_UNUSED_RESULT;
 struct named_test {
        const char *name;
        void (*func)(void);
 };
-int test_run_named(const struct named_test tests[], const char *match);
+int test_run_named(const struct named_test tests[], const char *match) ATTR_WARN_UNUSED_RESULT;
 
 #define TEST_DECL(x) void x(void);
 #define TEST_NAMELESS(x) x, /* Were you to want to use the X trick but not name the tests */