1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
23 /* Now include the setup.h file from libcurl's private libdir (the source
24 version, but that might include "curl_config.h" from the build dir so we
25 need both of them in the include path), so that we get good in-depth
26 knowledge about the system we're building this on */
28 #define CURL_NO_OLDIES
32 #include <curl/curl.h>
38 #ifdef HAVE_SYS_SOCKET_H
39 #include <sys/socket.h>
41 #ifdef HAVE_SYS_SELECT_H
42 /* since so many tests use select(), we can just as well include it here */
43 #include <sys/select.h>
46 /* at least somewhat oldish FreeBSD systems need this for select() */
54 #define TEST_ERR_MAJOR_BAD 100
55 #define TEST_ERR_RUNS_FOREVER 99
57 #define test_setopt(A,B,C) \
58 if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
60 #define test_multi_setopt(A,B,C) \
61 if((res = curl_multi_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
63 extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
64 extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */
66 /* argc and argv as passed in to the main() function */
68 extern char **test_argv;
70 extern int select_test(int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
73 extern int test(char *URL); /* the actual test function provided by each
74 individual libXXX.c file */