]>
Commit | Line | Data |
---|---|---|
c23de0aa | 1 | /* Legacy test skeleton. |
688903eb | 2 | Copyright (C) 1998-2018 Free Software Foundation, Inc. |
41bdb6e2 | 3 | This file is part of the GNU C Library. |
80a18298 UD |
4 | Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. |
5 | ||
6 | The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
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. | |
80a18298 UD |
10 | |
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 | |
41bdb6e2 | 14 | Lesser General Public License for more details. |
80a18298 | 15 | |
41bdb6e2 | 16 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
17 | License along with the GNU C Library; if not, see |
18 | <http://www.gnu.org/licenses/>. */ | |
80a18298 | 19 | |
c23de0aa FW |
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. */ | |
24 | ||
25 | /* This list of headers is needed so that tests which include | |
26 | "../test-skeleton.c" at the beginning still compile. */ | |
d7a05d07 | 27 | #include <assert.h> |
e1d8e1b7 | 28 | #include <errno.h> |
c5bb8e23 | 29 | #include <fcntl.h> |
80a18298 | 30 | #include <getopt.h> |
854278df | 31 | #include <malloc.h> |
c5bb8e23 | 32 | #include <paths.h> |
b9337b6a | 33 | #include <search.h> |
80a18298 UD |
34 | #include <signal.h> |
35 | #include <stdio.h> | |
36 | #include <stdlib.h> | |
4380ef5e | 37 | #include <string.h> |
80a18298 UD |
38 | #include <unistd.h> |
39 | #include <sys/resource.h> | |
40 | #include <sys/wait.h> | |
63b11dd1 | 41 | #include <sys/param.h> |
fa4a36fd | 42 | #include <time.h> |
b964e066 | 43 | #include <stdint.h> |
80a18298 | 44 | |
c23de0aa FW |
45 | #include <support/support.h> |
46 | #include <support/check.h> | |
47 | #include <support/xsignal.h> | |
48 | #include <support/temp_file.h> | |
b9337b6a | 49 | |
c23de0aa | 50 | /* TEST_FUNCTION is no longer used. */ |
10e62564 | 51 | static int |
c23de0aa FW |
52 | legacy_test_function (int argc __attribute__ ((unused)), |
53 | char **argv __attribute__ ((unused))) | |
80a18298 | 54 | { |
c23de0aa FW |
55 | #ifdef TEST_FUNCTION |
56 | return TEST_FUNCTION; | |
57 | # undef TEST_FUNCTION | |
58 | #else | |
59 | return do_test (argc, argv); | |
4614167a | 60 | #endif |
80a18298 | 61 | } |
c23de0aa | 62 | #define TEST_FUNCTION_ARGV legacy_test_function |
80a18298 | 63 | |
c23de0aa FW |
64 | /* PREPARE is a function name in the new skeleton. */ |
65 | #ifdef PREPARE | |
02242448 | 66 | static void |
c23de0aa FW |
67 | legacy_prepare_function (int argc __attribute__ ((unused)), |
68 | char **argv __attribute__ ((unused))) | |
02242448 | 69 | { |
c23de0aa | 70 | PREPARE (argc, argv); |
02242448 | 71 | } |
c23de0aa FW |
72 | # undef PREPARE |
73 | # define PREPARE legacy_prepare_function | |
74 | #endif | |
02242448 | 75 | |
c23de0aa FW |
76 | /* CLEANUP_HANDLER is a function name in the new skeleton. */ |
77 | #ifdef CLEANUP_HANDLER | |
c5bb8e23 | 78 | static void |
c23de0aa | 79 | legacy_cleanup_handler_function (void) |
c5bb8e23 | 80 | { |
c23de0aa | 81 | CLEANUP_HANDLER; |
c5bb8e23 | 82 | } |
c23de0aa FW |
83 | # undef CLEANUP_HANDLER |
84 | # define CLEANUP_HANDLER legacy_cleanup_handler_function | |
85 | #endif | |
c5bb8e23 | 86 | |
c23de0aa FW |
87 | /* CMDLINE_PROCESS is a function name in the new skeleton. */ |
88 | #ifdef CMDLINE_PROCESS | |
496405af | 89 | static void |
c23de0aa | 90 | legacy_cmdline_process_function (int c) |
496405af | 91 | { |
c23de0aa | 92 | switch (c) |
496405af | 93 | { |
c23de0aa | 94 | CMDLINE_PROCESS |
496405af MF |
95 | } |
96 | } | |
c23de0aa FW |
97 | # undef CMDLINE_PROCESS |
98 | # define CMDLINE_PROCESS legacy_cmdline_process_function | |
80a18298 | 99 | #endif |
63b11dd1 | 100 | |
c23de0aa FW |
101 | /* Include the new test-skeleton. */ |
102 | #include <support/test-driver.c> | |
7e625f7e FW |
103 | |
104 | /* The following functionality is only available if <pthread.h> was | |
105 | included before this file. */ | |
106 | #ifdef _PTHREAD_H | |
c23de0aa | 107 | # include <support/xthread.h> |
7e625f7e | 108 | #endif /* _PTHREAD_H */ |