Commit Graph

76 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
31762cc633 Added support for html css style tag and attribute
* include/wget/wget.h: Add 'size_t len' to wget_css_parse_buffer()
  and wget_css_get_urls()
* libwget/css.c (wget_css_parse_buffer): Use yy_scan_bytes() instead
  of yy_scan_string()
* libwget/css_url.c: Add param to wget_css_get_urls() and
  wget_css_parse_buffer()
* libwget/html_url.c: Add _css_parse_encoding() and _css_parse_uri(),
  (_html_get_url): Deal with 'style' attribute,
  (wget_html_free_urls_inline): Free url if needed
* libwget/test_linking.c: Add param to wget_css_parse_buffer()
* libwget/xml.c (parseXML): Add check for 'style'
* src/wget.c (css_parse): Add param 'size_t len'
* tests/Makefile.am: Add new test test-parse-html-css
* tests/test-parse-html-css.c: New file
2017-04-13 10:06:25 +02:00
320ac40487 Fix --cut-dirs
* src/wget.c (get_local_filename): Add / after host part
* tests/Makefile.am: Add new test 'test-cut-dirs'
* tests/test-cut-dirs.c: New file
2017-04-12 10:17:46 +02:00
4ad6d68305 Fix libraries to use libtool variables
* examples/Makefile.am: Use $(LTLIBICONV) $(LTLIBINTL) $(LTLIBTHREAD)
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
2017-04-06 12:25:07 +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
4d7238e282 Fix vpath builds
* examples/Makefile.am: Add -DWGETVER_FILE to AM_CPPFLAGS
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
* include/wget/wget.h: Include WGETVER_FILE if defined
2017-03-25 20:49:41 +01:00
62a41fbd2d Fix regression regarding chunked transfer-encoding
* libwget/http.c (wget_http_get_response_cb): Save data when chunk
  complete in one data packet.
* tests/Makefile.am: Add new test 'test-chunked'
* tests/test-chunked.c: New test
2017-03-25 20:35:05 +01:00
12cc9ef1e6 Fix charset conversion for HTML parsing
* src/wget.c: New helper function _normalize_uri()
  (sitemap_parse_text): Check size before allocating stack space
* tests/Makefile.am: Add test-iri-subdir
* tests/test-iri-subdir.c: Add new test
2017-02-23 16:20:51 +01:00
6162f84c9d Add tests with bad chunk size in the HTTP response
* tests/Makefile.am: Add test-bad-chunk.c
* tests/test-bad-chunk.c: New file with 3 tests
2016-12-02 17:54:09 +01:00
9568b0c87e Rename include/libwget.h to include/wget/wget.h+wgetver.h 2016-09-30 09:47:32 +02:00
a9c509898b Add tests for CSS parsing
* tests/Makefile.am: Add test-parse-css.c
* tests/test-parse-css.c: New file including two tests
2016-09-29 16:23:32 +02:00
36b095fd64 Fix Robots Exclusion Standard
* include/libwget.h.in: Add function wget_list_getnext().
* libwget/list.c: Add function wget_list_getnext().
* libwget/robots.c: Fix memory leak.
* src/host.c (host_remove_job): Cleanup queue after downloading and
  scanning robots.txt.
* src/job.h (struct JOB): Add flag 'requested_by_user'.
* src/wget.c (add_url_to_queue): Set 'requested_by_user',
  (add_url): Fix checking for disallowed paths.
* tests/Makefile.am: Add test 'test-robots'.
* tests/test-robots.c: New test to prove robots functionality.

Special handling for automatic robots.txt jobs
==============================================
What can happen with --recursive and --span-hosts is that a document from hostA
has links to hostB. All these links might go into the hostB queue before robots.txt
is downloaded and parsed. To avoid downloading of 'disallowed' documents, the queue
for hostB has to be cleaned up right after downloading and parsing robots.txt.
Any links links that have been explicitly requested by the user are still downloaded.
2016-09-19 15:23:48 +02:00
a8d99227e8 Add gnulib module 'manywarnings'
* autogen.sh: Add module manywarnings
* configure.ac: Add ./configure option --enable-gcc-warnings to enable
 many warnings
* examples/Makefile.am: Add WERROR_CFLAGS and WARN_CFLAGS to AM_CFLAGS
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
2016-06-14 12:22:03 +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
92ca98177a Add tests for Metalink
* tests/Makefile.am: Add test-metalink
* tests/test-metalink.c: New file

This new tests are
- --no-follow-metalink
- metalink v3, without pieces
- metalink v4, without pieces
- metalink v4, with pieces
2016-03-31 22:03:58 +02:00
9b16dc1011 Tune cookie parsing
* include/libwget.h.in: Add sort_age to struct wget_cookie_st
* libwget/cookie.c: Many code enhancements
* libwget/http.c (wget_http_parse_setcookie): Relax parsing,
  (wget_http_parse_setcookie): Allow \n and \r\n as EOL
* libwget/private.h: Add missing #includes
* tests/Makefile.am: Add disabled test-cookies-http_state
* tests/test-cookies-http_state.c: New cookie test

There still 30 out of 220 tests failing, before this commit we had
135 failing. The left over tests are mainly corner cases, but feel free
to work on it. When all tests pass, we enable test-cookies-http_state
in Makefile.am.
2016-03-18 17:01:49 +01:00
fb840427d2 Add $(LIB_PTHREAD) to makefiles
* examples/Makefile.am, libwget/Makefile.am, src/Makefile.am,
  tests/Makefile.am: Add $(LIB_PTHREAD)
2016-01-23 22:51:43 +01:00
e0261dc48e Fix double linkage finally
* tests/Makefile.am: Link only once per lib to avoid warnings
2016-01-15 15:56:48 +01:00
1be120e291 Fix Solaris issue in tests/Makefile.am
* tests/Makefile.am: Link only once per lib to avoid warnings
2016-01-15 14:52:35 +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
69d1b3392c Add gnulib module setlocale
* autogen.sh: Add gnulib module setlocale
* configure.ac: Remove searching for setlocale, locale.h, sys/time.h
* src/wget.c: Move #include <locale.h> (cosmetics)
* examples/Makefile.am: Add $(LIBTHREAD), @INTL_MACOSX_LIBS@ to LDADD
* libwget/Makefile.am: Add to $(LTLIBTHREAD), @INTL_MACOSX_LIBS@ LDADD
* src/Makefile.am: Add $(LIBTHREAD), @INTL_MACOSX_LIBS@ to LDADD
* tests/Makefile.am: Add $(LIBTHREAD), @INTL_MACOSX_LIBS@ to LDADD
2016-01-12 17:08:29 +01:00
c6e0ba1dce Add gnulib module iconv
* autogen.sh: Add gnulib module iconv
* configure.ac: Remove AM_ICONV
* examples/Makefile.am: Add $(LIBICONV) to LDADD
* libwget/Makefile.am: Add $(LIBICONV) to LDADD
* src/Makefile.am: Add $(LIBICONV) to LDADD
* tests/Makefile.am: Add $(LIBICONV) to LDADD
2016-01-12 15:58:40 +01:00
dd9cb25fcc Cover network functions with gnulib modules
* autogen.sh: Add accept, bind, close, connect, getaddrinfo, getsockname,
  listen, netdb, netinet_in, open, read, send, sendto, servent, setsockopt,
  socket, sys_socket, write to modules
* configure.ac: Remove searching for ws2_32, libsocket, libnsl, netdb.h,
  netinet/in.h, sys/socket.h, socket.
  Add searching for netinet/tcp.h.
* examples/Makefile.am: Add additional libs.
* libwget/Makefile.am: Add additional libs.
* src/Makefile.am: Add additional libs.
* tests/Makefile.am: Add additional libs.
* libwget/http.c: Remove conditional code.
* libwget/net.c: Remove conditional code. Use c_isdgit().
* libwget/net.h: Remove conditional code.
2016-01-12 15:08:14 +01:00
e8fafdeb9f Add header file gnulib modules
* autogen.sh: Add gettext-h, inttypes, stdarg, stddef, stdint
* configure.ac: Remove check for inttypes.h, libintl.h, stddef.h
  Remove AC_TYPE_* checks
* include/libwget.h.in: Include gnulib gettext.h
* examples/Makefile.am: Fix AM_CPPFLAGS, add $(LIBINTL) to LDADD
* libwget/Makefile.am: Fix LDADD and test_linking_LDADD
* src/Makefile.am: Add $(LIBINTL) to wget2_LDADD
* tests/Makefile.am: Fix AM_CPPFLAGS and libtest_la_CPPFLAGS,
  add $(LIBINTL) to LDADD, test_LDADD and test_parse_html_LDADD
2016-01-12 10:18:09 +01:00
b770fc7197 Add $(LIB_POLL) to *_LDADD
* examples/Makefile.am, src/Makefile.am, tests/Makefile.am:
  Add $(LIB_POLL) to *_LDADD
2016-01-11 22:22:29 +01:00
e6671d769f Add $(LIB_CLOCK_GETTIME) to tests
* tests/Makefile.am: Add $(LIB_CLOCK_GETTIME)
2016-01-11 12:10:41 +01:00
11c102fada Use nanosleep gnulib fallback
* autogen.sh: Add nanosleep to gnulib modules
* configure.ac: Remove searching for nanosleep
* examples/Makefile.am: Add $(LIBSOCKET) $(LIB_NANOSLEEP) $(LIB_SELECT)
* src/Makefile.am: Add $(LIBSOCKET) $(LIB_NANOSLEEP) $(LIB_SELECT)
* tests/Makefile.am: Add $(LIBSOCKET) $(LIB_NANOSLEEP) $(LIB_SELECT)
* libwget/utils.c: Remove conditional code
2016-01-11 11:36:34 +01:00
34eefff8db Remove test-ftp and test-ftps from test suite
* tests/Makefile.am: Remove test-ftp and test-ftps

These test were introduced as helpers for FTPS integration for
Wget1.x (GSOC 2015 project). We disable them until Wget2 supports
FTP/FTPS.
2016-01-10 21:21:10 +01:00
8a9d2cf348 Link with libgnu.a
* libwget/Makefile.am: Add lib/ to AM_CPPFLAGS, add libgnu.a to *_LDADD
* src/Makefile.am: Same
* tests/Makefile.am: Same, rename object files to link with tests
2016-01-09 19:34:29 +01:00
ad691f1f3f Remove API version from library file names
* .gitignore, Makefile.am, configure.ac, examples/Makefile.am,
  libwget.pc.in, libwget/Makefile.am, src/Makefile.am, tests/Makefile.am:
  Remove API version from library file names
2016-01-09 17:56:32 +01:00
e3b89db8c7 Hook gnulib into project 2016-01-09 16:04:25 +01:00
b60b8e3ab2 Use absolute pathanme to find PSL data
* tests/Makefile.am: PSL DATADIR should be the absolute pathname to
    allow us to run tests from any directory.
2016-01-08 10:45:03 +01:00
1cbb8ae9f7 Rename LIBWGET_API_VERSION to LIBWGET_VERSION 2016-01-06 16:25:27 +01:00
48543621ab Fix HTML BASE with absolute path
* src/wget.c (html_parse): Fix HTML BASE with absolute path
* tests/Makefile.am: Add test-base.c
* tests/test-base.c: New file
2015-10-25 21:02:33 +01:00
4a186f1732 Add new test tests/test-redirection.c 2015-10-20 22:43:56 +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
c6b0e461a1 Transform Mget into Wget 2015-09-19 22:54:38 +02:00
716fb160e5 Add tests/test-ftps.c 2015-07-12 21:01:28 +02:00
e10caca51c Remove tests/.test_* with make clean 2015-07-10 15:16:17 +02:00
91beea791e Add first FTP testing capability 2015-07-09 21:26:22 +02:00
438eb64c32 fixed tests/Makefile.am 2015-02-22 18:37:53 +01:00
c8984f38de add @LTLIBICONV@ @LTLIBINTL@ to tests 2015-02-06 17:13:20 +01:00
a11ceba71e changed valgrind testing 2014-10-10 15:20:06 +02:00
3492252d05 use AM_TESTS_ENVIRONMENT for valgrind testing 2014-10-07 17:15:35 +02:00
ec18aa3bbb tuned makefiles 2014-10-07 10:33:09 +02:00
1187e0aac5 fixed directory clashes and added test-directory-clash 2014-09-22 12:13:37 +02:00
a85b163ee9 added --follow-tags and --ignore-tags 2014-09-09 13:18:32 +02:00