Git init
[external/curl.git] / tests / libtest / test.h
1 /*****************************************************************************
2  *                                  _   _ ____  _
3  *  Project                     ___| | | |  _ \| |
4  *                             / __| | | | |_) | |
5  *                            | (__| |_| |  _ <| |___
6  *                             \___|\___/|_| \_\_____|
7  *
8  */
9
10 /* Now include the setup.h file from libcurl's private libdir (the source
11    version, but that might include "curl_config.h" from the build dir so we
12    need both of them in the include path), so that we get good in-depth
13    knowledge about the system we're building this on */
14
15 #define CURL_NO_OLDIES
16
17 #include "setup.h"
18
19 #include <curl/curl.h>
20 #include <stdio.h>
21 #include <string.h>
22 #include <stdlib.h>
23 #include <errno.h>
24
25 #ifdef HAVE_SYS_SOCKET_H
26 #include <sys/socket.h>
27 #endif
28 #ifdef HAVE_SYS_SELECT_H
29 /* since so many tests use select(), we can just as well include it here */
30 #include <sys/select.h>
31 #endif
32 #ifdef HAVE_UNISTD_H
33 /* at least somewhat oldish FreeBSD systems need this for select() */
34 #include <unistd.h>
35 #endif
36
37 #ifdef TPF
38 #  include "select.h"
39 #endif
40
41 #define TEST_ERR_MAJOR_BAD     100
42 #define TEST_ERR_RUNS_FOREVER   99
43
44 #define test_setopt(A,B,C) \
45   if((res = curl_easy_setopt((A),(B),(C))) != CURLE_OK) goto test_cleanup
46
47 extern char *libtest_arg2; /* set by first.c to the argv[2] or NULL */
48 extern char *libtest_arg3; /* set by first.c to the argv[3] or NULL */
49
50 /* argc and argv as passed in to the main() function */
51 extern int test_argc;
52 extern char **test_argv;
53
54 extern int select_test(int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
55                        struct timeval *tv);
56
57 extern int test(char *URL); /* the actual test function provided by each
58                                individual libXXX.c file */
59