]>
Commit | Line | Data |
---|---|---|
c23de0aa | 1 | /* Legacy test skeleton. |
dff8da6b | 2 | Copyright (C) 1998-2024 Free Software Foundation, Inc. |
41bdb6e2 | 3 | This file is part of the GNU C Library. |
80a18298 UD |
4 | |
5 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
6 | modify it under the terms of the GNU Lesser General Public |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
80a18298 UD |
9 | |
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 13 | Lesser General Public License for more details. |
80a18298 | 14 | |
41bdb6e2 | 15 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 16 | License along with the GNU C Library; if not, see |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
80a18298 | 18 | |
c23de0aa FW |
19 | /* This test skeleton is to support running existing tests. New tests |
20 | should use <support/test-driver.c> instead; see the documentation | |
21 | in that file for instructions, and <support/README-testing.c> for a | |
22 | minimal example. */ | |
23 | ||
24 | /* This list of headers is needed so that tests which include | |
25 | "../test-skeleton.c" at the beginning still compile. */ | |
d7a05d07 | 26 | #include <assert.h> |
e1d8e1b7 | 27 | #include <errno.h> |
c5bb8e23 | 28 | #include <fcntl.h> |
80a18298 | 29 | #include <getopt.h> |
854278df | 30 | #include <malloc.h> |
c5bb8e23 | 31 | #include <paths.h> |
b9337b6a | 32 | #include <search.h> |
80a18298 UD |
33 | #include <signal.h> |
34 | #include <stdio.h> | |
35 | #include <stdlib.h> | |
4380ef5e | 36 | #include <string.h> |
80a18298 UD |
37 | #include <unistd.h> |
38 | #include <sys/resource.h> | |
39 | #include <sys/wait.h> | |
63b11dd1 | 40 | #include <sys/param.h> |
fa4a36fd | 41 | #include <time.h> |
b964e066 | 42 | #include <stdint.h> |
80a18298 | 43 | |
c23de0aa FW |
44 | #include <support/support.h> |
45 | #include <support/check.h> | |
46 | #include <support/xsignal.h> | |
47 | #include <support/temp_file.h> | |
b9337b6a | 48 | |
c23de0aa | 49 | /* TEST_FUNCTION is no longer used. */ |
10e62564 | 50 | static int |
c23de0aa FW |
51 | legacy_test_function (int argc __attribute__ ((unused)), |
52 | char **argv __attribute__ ((unused))) | |
80a18298 | 53 | { |
c23de0aa FW |
54 | #ifdef TEST_FUNCTION |
55 | return TEST_FUNCTION; | |
56 | # undef TEST_FUNCTION | |
57 | #else | |
58 | return do_test (argc, argv); | |
4614167a | 59 | #endif |
80a18298 | 60 | } |
c23de0aa | 61 | #define TEST_FUNCTION_ARGV legacy_test_function |
80a18298 | 62 | |
c23de0aa FW |
63 | /* PREPARE is a function name in the new skeleton. */ |
64 | #ifdef PREPARE | |
02242448 | 65 | static void |
c23de0aa FW |
66 | legacy_prepare_function (int argc __attribute__ ((unused)), |
67 | char **argv __attribute__ ((unused))) | |
02242448 | 68 | { |
c23de0aa | 69 | PREPARE (argc, argv); |
02242448 | 70 | } |
c23de0aa FW |
71 | # undef PREPARE |
72 | # define PREPARE legacy_prepare_function | |
73 | #endif | |
02242448 | 74 | |
c23de0aa FW |
75 | /* CLEANUP_HANDLER is a function name in the new skeleton. */ |
76 | #ifdef CLEANUP_HANDLER | |
c5bb8e23 | 77 | static void |
c23de0aa | 78 | legacy_cleanup_handler_function (void) |
c5bb8e23 | 79 | { |
c23de0aa | 80 | CLEANUP_HANDLER; |
c5bb8e23 | 81 | } |
c23de0aa FW |
82 | # undef CLEANUP_HANDLER |
83 | # define CLEANUP_HANDLER legacy_cleanup_handler_function | |
84 | #endif | |
c5bb8e23 | 85 | |
c23de0aa FW |
86 | /* CMDLINE_PROCESS is a function name in the new skeleton. */ |
87 | #ifdef CMDLINE_PROCESS | |
496405af | 88 | static void |
c23de0aa | 89 | legacy_cmdline_process_function (int c) |
496405af | 90 | { |
c23de0aa | 91 | switch (c) |
496405af | 92 | { |
c23de0aa | 93 | CMDLINE_PROCESS |
496405af MF |
94 | } |
95 | } | |
c23de0aa FW |
96 | # undef CMDLINE_PROCESS |
97 | # define CMDLINE_PROCESS legacy_cmdline_process_function | |
80a18298 | 98 | #endif |
63b11dd1 | 99 | |
c23de0aa FW |
100 | /* Include the new test-skeleton. */ |
101 | #include <support/test-driver.c> | |
7e625f7e FW |
102 | |
103 | /* The following functionality is only available if <pthread.h> was | |
104 | included before this file. */ | |
105 | #ifdef _PTHREAD_H | |
c23de0aa | 106 | # include <support/xthread.h> |
7e625f7e | 107 | #endif /* _PTHREAD_H */ |