Add [BZ #19398] marker to ChangeLog entry.
[glibc.git] / test-skeleton.c
blob55ded17cab3f01a6684e2755a1923d4778d33d33
1 /* Legacy test skeleton.
2 Copyright (C) 1998-2016 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
20 /* This test skeleton is to support running existing tests. New tests
21 should use <support/test-driver.c> instead; see the documentation
22 in that file for instructions, and <support/README-testing.c> for a
23 minimal example. */
25 /* This list of headers is needed so that tests which include
26 "../test-skeleton.c" at the beginning still compile. */
27 #include <assert.h>
28 #include <errno.h>
29 #include <fcntl.h>
30 #include <getopt.h>
31 #include <malloc.h>
32 #include <paths.h>
33 #include <search.h>
34 #include <signal.h>
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include <string.h>
38 #include <unistd.h>
39 #include <sys/resource.h>
40 #include <sys/wait.h>
41 #include <sys/param.h>
42 #include <time.h>
43 #include <stdint.h>
45 #include <support/support.h>
46 #include <support/check.h>
47 #include <support/xsignal.h>
48 #include <support/temp_file.h>
50 /* TEST_FUNCTION is no longer used. */
51 static int
52 legacy_test_function (int argc __attribute__ ((unused)),
53 char **argv __attribute__ ((unused)))
55 #ifdef TEST_FUNCTION
56 return TEST_FUNCTION;
57 # undef TEST_FUNCTION
58 #else
59 return do_test (argc, argv);
60 #endif
62 #define TEST_FUNCTION_ARGV legacy_test_function
64 /* PREPARE is a function name in the new skeleton. */
65 #ifdef PREPARE
66 static void
67 legacy_prepare_function (int argc __attribute__ ((unused)),
68 char **argv __attribute__ ((unused)))
70 PREPARE (argc, argv);
72 # undef PREPARE
73 # define PREPARE legacy_prepare_function
74 #endif
76 /* CLEANUP_HANDLER is a function name in the new skeleton. */
77 #ifdef CLEANUP_HANDLER
78 static void
79 legacy_cleanup_handler_function (void)
81 CLEANUP_HANDLER;
83 # undef CLEANUP_HANDLER
84 # define CLEANUP_HANDLER legacy_cleanup_handler_function
85 #endif
87 /* CMDLINE_PROCESS is a function name in the new skeleton. */
88 #ifdef CMDLINE_PROCESS
89 static void
90 legacy_cmdline_process_function (int c)
92 switch (c)
94 CMDLINE_PROCESS
97 # undef CMDLINE_PROCESS
98 # define CMDLINE_PROCESS legacy_cmdline_process_function
99 #endif
101 /* Include the new test-skeleton. */
102 #include <support/test-driver.c>
104 /* The following functionality is only available if <pthread.h> was
105 included before this file. */
106 #ifdef _PTHREAD_H
107 # include <support/xthread.h>
108 #endif /* _PTHREAD_H */