Commit Graph

78 Commits

Author SHA1 Message Date
4f557e8121 Mew test test-redirection-loop
* tests/Makefile.am: Add test-redirection-loop to tests
* tests/libtest.c (_http_server_thread): Check scope of requested URL,
  skip check for expected files when not specified
* tests/libtest.h: Add wget_test_url_t.scope,
  define WGET_TEST_URL_SCOPE_HTTP and WGET_TEST_URL_SCOPE_HTTPS
* tests/test-redirection-loop.c: New test file
2017-05-16 21:31:32 +02:00
750d34e213 Remove redundant VGSUPPFILE macro
* tests/Makefile.am: Remove VGSUPPFILE macro from libtest.la
 * tests/libtest.c: Replace VGSUPPFILE with an expression using SRCDIR
2017-05-12 00:21:01 +05:30
1b3a28f740 * tests/libtest.c: Use --no-proxy for wget2 invocation in test-suite 2017-05-03 11:56:20 +02:00
c6ee3d79ad Fix syntax-check 'sc_prohibit_have_config_h'
* cfg.mk: Remove sc_prohibit_have_config_h from local-checks-to-skip
* libwget/*.c: Include <config.h> unconditionally
* src/*.c: Likewise
* tests/*.c: Likewise
2017-04-30 22:01:34 +02:00
59f163cd7b Remove useless cpp parens (syntax-check) 2017-04-29 20:56:57 +02:00
56efdab1a7 Remove trailing whitespaces (syntax-check) 2017-04-29 20:51:32 +02:00
c1dee14c72 Spell filesystem 'file system' (syntax-check)
* docs/wget2_manual.md: filesystem -> file system
* tests/libtest.c: Likewise
* tests/libtest.h: Likewise
* tests/test-wget-1.c: Likewise
2017-04-29 19:41:15 +02:00
dba2663197 Fix --chunk-size with missing Content-Length
* src/wget.c (process_head_response): Don't release job after HEAD
* tests/libtest.c: Implement WGET_TEST_SERVER_SEND_CONTENT_LENGTH
* tests/libtest.h: Define WGET_TEST_SERVER_SEND_CONTENT_LENGTH
* tests/test-wget-1.c: Add new tests for --chunk-size
2017-04-21 12:49:34 +02:00
f00a7574f6 * tests/libtest.c (_ftp_server_thread): Remove redundant check for WIN64 2017-04-11 14:40:47 +02:00
bae35d7790 Prevent wget2rc from being read during tests
* src/options.c: Treat parse_filename{,s} as string vectors and clear
them with a no-* command line option
* tests/libtest.c: Pass --no-config to all the tests by default
2017-04-11 11:54:50 +02:00
b4e151272c Fix VPATH issue for test suite
* tests/Makefile.am: Set SRCDIR to $(abs_srcdir)
* tests/libtest.c: Remove '../' in front of SRCDIR
* tests/test-i-https.c: Likewise

Reported-by: Akash Rawal
2017-03-30 11:53:03 +02:00
874ce8dcdc Fix path of valgrind-suppressions in vpath build
* tests/Makefile.am: For libtests.la, define VGSUPPFILE to absolute path to
  tests/valgrind-suppressions
* tests/libtest.c: Use VGSUPPFILE macro instead of hardcoded path to
  valgrind-suppressions
2017-03-30 00:41:35 +05:30
ec396c577f Fix URLs to HTTPS where possible 2017-02-28 15:31:30 +01:00
5582908092 Remove redundant check for _WIN64 2017-01-05 12:18:56 +01:00
b049eb6d3a Fix gcc/clang warnings from the new manywarnings feature
* configure.ac: Suppress -Wunsuffixed-float-constants for gcc,
  add -Wno-disabled-macro-expansion to clang flags
* examples/getstream.c: Removed 'unused' attributes from argc and argv.
* include/wget/wget.h: Fix slot to int for bar functions.
* libwget/bar.c: Fix slot to int for bar functions, cast to int,
  change type of bitfield 'redraw' to unsigned.
* libwget/hsts.c (wget_hsts_new): Fix int to bitfield conversion.
* libwget/http.c: Cast printf %p format to (void *).
* src/wget.c: Cast printf %p format to (void *),
  remove ACTION_DONE from enum actions.
* src/wget_host.h: Fix double declaration of host_remove_job()
* tests/libtest.c (wget_test_check_filesystem): Fix type of 'rc'.
* tests/test-idn-robots.c: Fix comma to semikolon at end of line.
* tests/test.c (test_strcasecmp_ascii): Fix type of loop variable.
2016-11-02 22:19:41 +01:00
2da0ad63dd Improved testing on Travis
* .travis.sh: Rewrite for clarity and speed. Testing shows that valgrind
and ASan don't play well together. So split their executions.
* .travis.yml: Enable ccache for builds. Also try to update libc6 if
possible
* .travis.yml: Do not run on OSX with CC=gcc. This is because on OSX,
gcc is only a wrapper around clang.
* .travis_setup.sh: Cosmetic changes only
* Makefile.am (check-coverage): Explcicitly disable valgrind tests when
checking coverage
* tests/libtest.c (wget_test): Use a provided suppressions file for
valgrind. This is required since the valgrind version on Travis seems to
be out of sync with libc. This causes valgrind to report a memory bug
falsely.
* tests/valgrind-suppressions: New file with some valgrind suppressions.
Included suppressions are for a valgrind/libc bug and to suppress
reachable memory messages from within gnutls
2016-10-07 17:51:48 +02:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
2ab2611f4b Fix a ubsan warning due to zero length VLA 2016-07-23 20:38:57 +02:00
79dd277c12 Refactoring to separate send, receive and HTTP state machine
* examples/websequencediagram.c (main): Call wget_http_request_set_body()
  and wget_http_send_request() instead of wget_http_send_request_with_body().
* include/libwget.h.in: Add WGET_HTTP_USER_DATA, wget_get_timemillis(),
  extend wget_thread_cond_wait(), add body, user_data, body_length to
  wget_http_request_t, remove wget_http_send_request_with_body(),
  add wget_http_request_get_int(), wget_http_request_set_ptr(),
  wget_http_request_get_ptr(), wget_http_request_set_body().
* libwget/http.c: Add wget_http_request_get_int(),
  wget_http_request_set_ptr(), wget_http_request_get_ptr(),
  wget_http_request_set_body(),
  remove wget_http_send_request_with_body(),
  (wget_http_request_to_buffer): add body to request buffer.
* libwget/http_highlevel.c (wget_http_get): Replace
  wget_http_send_request_with_body()
* libwget/iri.c: Use c-ctype.h instead of ctype.h
  (wget_iri_parse): Allow any numbers of / after scheme:
  (wget_iri_parse): Catch URIs without /after scheme:
* libwget/list.c (wget_list_browse): Small code rearrangement
* libwget/metalink.c (_add_mirror): Check mirror.iri for NULL
* libwget/ssl_gnutls.c (send_ocsp_request): Replace
  wget_http_send_request_with_body()
* libwget/thread.c (wget_thread_cond_signal): Add timeout param
* libwget/utils.c: New function wget_get_timemillis()
* src/blacklist.c: Include wget.h instead of log.h
* src/blacklist.h: Fix indentation
* src/host.c: Add queueing stuff
* src/host.h: Reflect changes in host.c
* src/job.c: Remove queueing stuff
* src/job.h: Reflect changes in job.c
* src/log.c: Sync stdout/stderr to correct output order
* src/log.h: Remove shortcuts of print functions
* src/wget.c: Remove download_part() and http_get().
  Add http_send_request(), http_receive_response(), try_connection(),
  establish_connection(), add_statistics(), process_response_header().
  Amend downloader_thread() to reflect the changes.
* src/wget.h: Add shortcut defines for print functions.
* tests/libtest.c (_http_server_thread): Fix compiler warning,
  fix debug message.
  New function _write_msg() to print server messages yellow.
  (wget_test) Add -d to wget command line.
* tests/test-metalink.c (main): Add tests for V3 and V4 metalink
  files read from command line (-i, --force-metalink)
* tests/test.c (test_iri_parse): Add test for slash-less mailto: URI
2016-07-11 14:53:36 +02:00
d393fc4ed5 Fix compiler warnings in test suite
* tests/libtest.c (wget_test_check_filesystem): Fix printf
  format warning
* tests/test-parse-html.c (html_dump): Add switch default case,
  fix printf format warning
2016-06-15 16:42:27 +02:00
4d5aff5ff5 Fix FTP PASV listening in test suite
* tests/libtest.c: Fix FTP PASV listening
2016-06-06 18:52:03 +02:00
37687a2c5b Let test suite survive on case-sensitive filesystems (e.g. HFS+)
* tests/libtest.c: New function wget_test_check_filesystem(),
  (_empty_directory, _remove_directory): Do not print
  errors about missing directories.
* tests/libtest.h: Add define WGET_TEST_FS_CASEMATTERS
* tests/test--accept.c: Renamed files to avoid casing problems
* tests/test-wget-1.c: Skip casing tests on case-sensitive filesystem
2016-05-19 16:55:43 +02:00
d4ed8ee26a Add EXEEXT to test suite executables
* tests/Makefile.am: Add $(EXEEXT) to executable names
* tests/libtest.c: Add EXEEXT to wget2 executable,
  add support for EMULATOR env variable - e.g. to test with wine
2016-05-08 23:03:51 +02:00
c6890e95cd Use wget2 without libtool wrapper for test suite
* src/Makefile.am: Add wget2_noinstall target
* src/wget.c: On exit, only release memory within test suite
* tests/libtest.c: Call wget2_noinstall for testing
2016-03-14 15:59:17 +01:00
a582d324d6 Fix / silence some Coverity findings 2016-02-07 12:48:41 +01:00
2c9f5945f5 Honor --disable-threads and support no threading
* include/libwget.h.in: Include <stdbool.h>.
Define wget_thread_support().
* libwget/thread.c: Change condition to check
for threading support.
(wget_thread_support): New function.
(wget_thread_start): [!USE_POSIX_THREADS && !USE_PTH_THREADS]
Invoke directly the function.
* src/wget.c (main): If no threads are supported then set the
number of max threads to 1.  If the queue is not empty, call again the
downloader function.  It will be used only in case no threads are
available.
(downloader_thread): Do not wait for new elements in the queue
when there are no threads.
* tests/libtest.c (wget_test_start_server): Skip the test if
there is no threads support.
2016-02-02 18:45:17 +01:00
dd3c2f63b2 Updated copyright year for all relevant files 2016-01-25 13:06:21 +01:00
41bcd1c85c Switch to Travis-CI valgrind testing
* .travis.sh: Add --enable-valgrind-tests to ./configure,
  export VALGRIND_TESTS=1
* .travis.yml: Install valgridn on Mac OS X
* tests/libtest.c: Add --max-threads=1 --prefer-family=ipv4 to wget2 command
2016-01-24 15:54:23 +01:00
3e02b28ee4 Fix test suite for Mac OSX
* tests/libtest.c (_http_server_thread): Accept HTTP msg when chunked,
  Fix removing test directories,
  (wget_test_start_server) Remove stale test directories,
  Prefer IPv4, Start FTPS thread only if needed,
  (_scan_for_unexpected) Skip test for unexpected files on Mac OSX,
  (wget_test) Add --max-threads and --prefer-family=ipv4 to wget2 command,
  Remove MSWindows conditional code
2016-01-22 14:38:40 +01:00
7250e6ccb9 Add symbol visibility control to libwget
* autogen.sh: Add gnulib module lib-symbol-visibility,
  add --libtool to gnulib-tool invokation
* examples/Makefile.am: Remove -static from AM_LDFLAGS,
  remove ../lib/libgnu.a from LDADD
* include/libwget.h.in: Define LIBWGET_EXPORT,
  add LIBWGET_EXPORT to all visible symbols
* libwget/Makefile.am: Remove AM_CPPFLAGS and LDADD,
  add libwget_la_CPPFLAGS and libwget_la_LIBADD,
  add test_linking_CPPFLAGS, fix test_linking_LDADD
* libwget/iri.c: Add LIBWGET_EXPORT to wget_iri_schemes and iri_ports
* src/Makefile.am: Remove wget2_LDFLAGS, fix wget2_LDADD
* tests/Makefile.am: Fix LDADD, fix test_LDADD, fix test_parse_html_LDADD,
  fix libtest_la_CPPFLAGS and libtest_la_LIBADD
* tests/libtest.h: Add LIBWGET_EXPORT to symbols
2016-01-15 11:21:35 +01:00
0ecbd6e69a Removed redundant buffer print routines
Removed wget_buffer_vprintf_append, wget_buffer_printf_append,
wget_buffer_vprintf2 and wget_buffer_printf2.
Renamed their *2 counterpart to their old names.
2016-01-13 15:01:43 +01:00
dbc9e54a24 Use c-ctype.h where possible
* libwget/atom_url.c, libwget/buffer_printf.c, libwget/css.c,
  libwget/html_url.c, libwget/http.c, libwget/rss_url.c, libwget/sitemap_url.c,
  src/options.c src/wget.c, tests/libtest.c, tests/test-parse-html.c:
  Use c-ctype.h where possible
2016-01-13 11:34:31 +01:00
fdc72853fd Fix test suite for CygWin
* New CygWin specific code for removing/cleaning test directory
2015-11-23 12:01:56 +01:00
a30c3fde88 Close va_start() with va_end()
* tests/libtest.c (wget_test): Add va_end()
2015-11-08 16:12:00 +01:00
3cb9027e51 Add extension of test suite port variables in response headers
* tests/libtest.h: Add member header_alloc to wget_test_url_t
* tests/libtest.c: Extend port vars in response headers
2015-10-20 22:41:36 +02:00
792a003341 Rename wget executable to wget2
* .gitignore: Replace src/wget by src/wget2
* src/Makefile.am: Rename wget to wget2
* tests/Makefile.am: Link wget2-* objects
* tests/libtest.c: Execute wget2 instead of wget
2015-10-11 11:54:00 +02:00
0f8e49128a Transfer copyright to Free Software Foundation, Inc. 2015-09-22 11:50:06 +02:00
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00
1bccc5796d Added missing breaks to switch in libtest.c 2015-09-12 11:37:28 +02:00
9de3f85c77 Add AUTH command to FTP test suite 2015-07-12 21:01:56 +02:00
a7d9d4fcf3 Add FTPS server to test suite 2015-07-11 10:01:36 +02:00
c0a5561afc Allow ordered and unordered I/O for FTP test suite 2015-07-11 09:35:26 +02:00
3bead1e606 Added EPSV to tests/libtest.c 2015-07-10 21:12:14 +02:00
0fb3db91a1 Include sys/wait.h for WIF* macros 2015-07-10 16:31:09 +02:00
c97053134e Remove unused variables from tests/libtest.c 2015-07-10 14:59:04 +02:00
08bc4602fd Fix tests/libtest.c crash recently introduced 2015-07-10 14:43:58 +02:00
91beea791e Add first FTP testing capability 2015-07-09 21:26:22 +02:00
8706d962c4 fixing two more Coverity issues 2015-03-13 11:14:31 +01:00
79cfe9f7be convert pid to int 2015-02-26 16:04:09 +01:00
4cb4e8930e updated tests/certs (old certs expired on 11.2.2015) 2015-02-22 18:34:30 +01:00