test.h 1.6 KB

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