From c23de0aacbeaa7a091609b35764bed931475a16d Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 9 Dec 2016 08:18:27 +0100 Subject: support: Introduce new subdirectory for test infrastructure The new test driver in has feature parity with the old one. The main difference is that its hooking mechanism is based on functions and function pointers instead of macros. This commit also implements a new environment variable, TEST_COREDUMPS, which disables the code which disables coredumps (that is, it enables them if the invocation environment has not disabled them). defines wrapper functions so that it is possible to use existing macros with the new-style hook functionality. This commit changes only a few test cases to the new test driver, to make sure that it works as expected. --- support/README-testing.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 support/README-testing.c (limited to 'support/README-testing.c') diff --git a/support/README-testing.c b/support/README-testing.c new file mode 100644 index 0000000000..9d289c3020 --- /dev/null +++ b/support/README-testing.c @@ -0,0 +1,19 @@ +/* This file contains an example test case which shows minimal use of + the test framework. Additional testing hooks are described in + . */ + +/* This function will be called from the test driver. */ +static int +do_test (void) +{ + if (3 == 5) + /* Indicate failure. */ + return 1; + else + /* Indicate success. */ + return 0; +} + +/* This file references do_test above and contains the definition of + the main function. */ +#include -- cgit v1.2.3