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. --- posix/tst-posix_fadvise-common.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'posix') diff --git a/posix/tst-posix_fadvise-common.c b/posix/tst-posix_fadvise-common.c index bb04c6116f..38dc0ce81c 100644 --- a/posix/tst-posix_fadvise-common.c +++ b/posix/tst-posix_fadvise-common.c @@ -16,17 +16,17 @@ License along with the GNU C Library; if not, see . */ +#include #include +#include +#include #include #include #include -static void do_prepare (void); -#define PREPARE(argc, argv) do_prepare () -static int do_test (void); -#define TEST_FUNCTION do_test () - -#include +#include +#include +#include static char *temp_filename; static int temp_fd; @@ -34,7 +34,7 @@ static char fifoname[] = "/tmp/tst-posix_fadvise-fifo-XXXXXX"; static int fifofd; static void -do_prepare (void) +do_prepare (int argc, char **argv) { temp_fd = create_temp_file ("tst-posix_fadvise.", &temp_filename); if (temp_fd == -1) @@ -101,3 +101,10 @@ do_test_common (void) return 0; } + +#define PREPARE do_prepare + +/* This function is defined by the individual tests. */ +static int do_test (void); + +#include -- cgit 1.4.1