Commit Graph

143 Commits

Author SHA1 Message Date
7292244bec Add tests for --level
* tests/Makefile.am: Add test-level.c.
* tests/test-level.c: New file with tests for --level.
2022-04-03 14:52:36 +02:00
0f554ef216 * */Makefile.am: Reorder link libraries (libgnu.la first) 2022-03-05 16:23:15 +01:00
954c3c19b6 * tests/test--*.c: Rename to test-*.c 2022-02-19 18:44:50 +01:00
66d24458d0 Fix --directory-prefix with --content-disposition
* src/blacklist.c (get_local_filename): Remove static from definition.
* src/wget_blacklist.h (get_local_filename): Add declaration.
* src/wget.c (process_response): Use get_local_filename() to process
  the filename from Content-Disposition,
  (get_header): Likewise.
* tests/Makefile.am: Add new test file test-directory-prefix.c.
* tests/test-directory-prefix.c: New test file.
2022-02-18 19:57:14 +01:00
f517050a09 Add tests for --download-attr
* tests/Makefile.am: Add tests/test-download-attr.c.
* tests/test-download-attr.c: New file.
2020-03-17 16:49:35 +01:00
42461e5313 Added test simulations of aborts while sending response body
* tests/Makefile.am: add tests/test-interrupt-response test
* tests/libtest.c (_callback_interruptable, _answer_to_connection):
  add interruptable response callback, enable in wget_test_url_t
  settings
* tests/libtest.h: added interrupt_response_mode and
  interrupt_response_after_nbytes to wget_test_url_t
* tests/test-interrupt-response.c: add test for interruptable
  responses and interrupt of responses while timestamping active
2020-01-31 19:19:45 +01:00
0f624b16b5 Update Makefile.am for latest gnulib
* examples/Makefile.am: Amend LDADD assignment
* fuzz/Makefile.am: Likewise
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
* unit-tests/Makefile.am: Likwise
2020-01-07 15:46:12 +01:00
f944600229 * tests/Makefile.am: Add test-cut-get-vars 2019-12-07 16:20:07 +01:00
e5f33ae07a Added --convert-file-only handling
* src/options.c: Add --convert-file-only handling
* src/wget_options.h (config): Add bool convert_file_only
* src/wget.c (html_parse): conversions initialized when
convert_file_only is set
(main): Call convert_links when config.convert_file_only
(convert_links): move conversion logic to convert_link_whole and
convert_link_file_only
New function convert_link_whole: convert whole URL
New function convert_link_file_only: convert filename part of URLs
* tests/test-convert-file-only.c: testcase for --convert-file-only
with -E
* tests/Makefile.am: add test-convert-file-only object
* docs/wget2.md: Removed [unimplemented-option] from
--convert-file-only
2019-11-06 15:06:29 +01:00
5c42026ee4 Add --ignore-length handling
* include/wget/wget.h (wget_http_request): Add bool
response_ignorelength
(wget_http_response): Add bool length_inconsistent
* src/options.c: Add --ignore-length handling
* src/wget_options.h (config): Add bool ignore_length
(exit_status_e): Add WGET_EXIT_INCONSISTENT_LENGTH
* libwget/http.c (wget_http_response_cb): Set length_inconsistent
when mismatch with Content-Length
* src/wget.c (wget_send_request): Set ignore-length in request
* tests/test-ignore-length.c: test --ignore-length
* tests/Makefile.am: add test-ignore-length
* docs/wget2.md: Removed [unimplemented-option] from
--ignore-length
2019-11-05 21:43:17 +05:30
ab982269fe Fix typo: test-post-handhshake-auth -> test-post-handshake-auth
* tests/Makefile.am: Fix typo in handhshake -> handshake
* tests/test-post-handhshake-auth.c: Rename to tests/test-post-handshake-auth.c
2019-10-27 17:25:08 +01:00
a1fdeef3ae Add new test file test-E-k.c
* tests/Makefile.am: Add test-E-k.c to tests
* tests/test-E-k.c: New file
2019-10-26 18:48:33 +02:00
61a32cc596 Using --robots=off downloads robots.txt
* src/wget.c (add_url_to_queue): remove config.robots check,
  (add_url): add config.robots check when disallowing URLs
* tests/test-robots-off.c: New file to test --robots=off behavior
* tests/Makefile.am: Added test-robots-off
* tests/test-iri-percent.c: Add check for robots.txt
* docs/wget2.md: Describe --robots=off behaviour
2019-10-22 13:42:28 +02:00
bcf7d315bf Add new cookie test
* tests/Makefile.am: Add test-cookies
* tests/test-cookies.c: New file
2019-09-17 17:08:00 +02:00
d07ebfcf89 Move -N mode tests into a separate file
* tests/test-wget-1.c: Removed -N (timestamping) tests
* tests/test-timestamping.c: Added -N tests from tests/test-wget-1.c
* tests/Makefile.am: Added tests/test-timestamping.c to Makefile
2019-08-22 16:20:01 +00:00
c3075a1e21 Introduce nullability support for clang's static analyzer
* configure.ac: Add -Wno-nullability-extension -Wno-nullability-completeness to WARN_CFLAGS
* include/wget/wget.h: Add CLANG_VERSION_AT_LEAST,
  fix attribute defines for clang,
  make use of attributes by using static inline functions for wget allocation,
  define NULLABLE for clang
* libwget/xalloc.c: Rename wget allocation function pointers
* src/options.c: Likewise
* unit-tests/test.c: Likewise
2019-08-16 15:24:19 +02:00
bedbfa9ef3 Add convenience library for src/utils.c
* src/Makefile.am: Add libtest-utils.la
* tests/Makefile.am: Add libtest-utils.la to libtest_la_LIBADD
2019-08-15 11:08:13 +02:00
8843b8f23e Added support for ax_code_coverage version 32
* Makefile.am: Add code coverage rules as documented in ax_code_coverage.m4
* cfg.mk: Exclude m4 files from sc_GPL_version
* configure.ac: Add AX_CODE_COVERAGE
* fuzz/Makefile.am: Add coverage flags
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
* m4/ax_ac_append_to_file.m4: New file
* m4/ax_ac_print_to_file.m4: New file
* m4/ax_add_am_macro_static.m4: New file
* m4/ax_am_macros_static.m4: New file
* m4/ax_check_gnu_make.m4: New file
* m4/ax_code_coverage.m4: New file
* m4/ax_file_escapes.m4: New file
2019-08-06 15:38:47 +02:00
7166991826 Add test-limit-rate-http2
* tests/Makefile.am: Added test-limit-rate-http2
* tests/test-limit-rate-http2.c: Cloned 'test-limit-rate' to test for h2 only
2019-07-29 19:18:06 +00:00
043e650829 Added skeleton OCSP Stapling
* tests/Makefile.am: Added test-ocsp-stap
* tests/libtest.c: Added an MHD daemon to send OCSP stapled response
* tests/libtest.h: Added macro WGET_TEST_FEATURE_OCSP_STAPLING
* tests/test-ocsp-stap.c: Added test for OCSP stapling
2019-07-24 17:23:01 +05:30
f3db2dadf7 Added test-ocsp-server
* tests/Makefile.am: Modified to run the test
* tests/test-ocsp-server: Added for testing OCSP verified/revoked responses
2019-07-23 22:50:14 +05:30
afa91cb09e * tests/Makefile.am: Avoid using unportable .o reference with libtool 2019-06-24 12:23:24 +02:00
d2e5701518 * tests/Makefile.am: Use top_srcdir instead of .. to fix VPATH build 2019-06-23 15:38:25 +02:00
014360442e * tests/Makefile.am: Use top_srcdir instead of .. to fix VPATH build 2019-06-21 16:58:08 +02:00
94d3969488 Remove --stats-all
* docs/wget2.md Remove docs for --stats-all
* src/options.c: Remove --stats-all and parse_stats_all()
* fuzz/wget_options_fuzzer.dict: remove --stats-all
* tests/Makefile.am: Remove test-stats-all
* tests/test-stats-all.c: Remove file
2019-06-21 15:52:40 +02:00
73b7441e9a Move wget_restrict_file_name() to src/utils.c
* fuzz/libwget_utils_fuzzer.c: Remove test code for wget_restrict_file_name()
* include/wget/wget.h: Remove wget_restrict_file_name() prototype
* libwget/utils.c: Remove wget_restrict_file_name()
* src/utils.c: Add wget_restrict_file_name()
* src/wget_utils.h: Add wget_restrict_file_name() prototype
* tests/Makefile.am: Add ../src/utils.c to libtest_la_SOURCES
* tests/libtest.c: Include ../src/wget_utils.h
2019-06-21 12:47:06 +02:00
bd79450c7a Add new option --unlink
* bootstrap.conf: Add gnulib module 'link'
* docs/wget2.md: Remove the 'unimplemented' tag for --unlink
* src/options.c: Add --unlink option
* src/wget.c (_prepare_file): Unlink file if requested
* src/wget_options.h (struct config): Add 'unlink' member
* tests/Makefile.am: Add test-unlink
* tests/libtest.c (wget_test): Implement hardlink feature
* tests/libtest.h (wget_test_file_t): Add 'hardlink' member
* tests/test-unlink.c: New file with tests for --unlink
2019-04-30 12:52:29 +02:00
9ea3e80fbf Add TLS 1.3 post-handshake authentication
* tests/Makefile.am: Loading post-handshake-auth test
* tests/libtest.c:
Added execution of 'WGET_TEST_POST_HANDSHAKE_AUTH' key.
Value: other than 0 (Check for post handshake authentication)
Value: 0 (Don't check)
* tests/libtest.h: Defined 'WGET_TEST_POST_HANDSHAKE_AUTH'
* tests/test-post-handhshake-auth.c: Added to test post handshake authentication support
2019-04-25 16:11:17 +05:30
efebf302a8 Added tests for limit-rate
* tests/test-limit-rate.c: new test file for limit-rate
* tests/Makefile.am: added tests/test-limit-rate.c to build
2019-04-22 22:51:04 +02:00
70257dcf23 Fix for -p -nc Bug
* src/wget.c: Modified to stop redownload if document already exists
* tests/test-p-nc.c: Added test for '-p -nc'
* tests/Makefile.am: Modified to include test-p-nc.c while testing.

Fixes #209
2019-04-21 12:26:00 +02:00
ab76575a7c Fix VPATH build broken in earlier commit
* tests/Makefile.am: Add new file plugin_tests.h to DIST Files
* tests/plugin_tests.h: Use BUILDDIR not SRCDIR for .libs location
2018-11-17 13:04:47 +01:00
480db7ccf1 Add option --save-content-on
* docs/wget2.md: Add docs for --save-content-on
* src/options.c (options): Add "save-content-on"
* src/wget.c:
* src/wget_options.h (struct config): Add save_content_on member
* tests/Makefile.am: Add tests/test--save-content-on.c
* tests/test--save-content-on.c: New test file
2018-10-09 11:01:56 +02:00
Dan
756e470de9 Add -X/--exclude-directories and -I/--include-directories
* docs/wget2.md: Add docs for -I/--include-directories=list
  and -X/--exclude-directories=list
* src/options.c: New function _strchrnul_esc(),
  new function _strmemdup_esc(),
  (parse_stringlist_expand): Use new functions from above,
  new function set_char_prefix(), parse_included_directories()
  and parse_excluded_directories,
  (options): add exclude-directories and --include-directories
* src/wget.c: New functions match_subdir() and in_directory_pattern_list(),
  (add_url): check if path matches directory patterns,
  (_prepare_file): add new param 'path',
* src/wget_options.h (struct config): Add member 'exclude_directories'
* tests/Makefile.am: Add 'test-include-and-exclude-directories'
* tests/test-include-and-exclude-directories.c: New file
2018-08-31 20:23:30 +02:00
da79e8a6dc Add verify-sig missing signature file behavior test.
* tests/Makefile.am: Add new test.
* tests/test-gpg-verify-no-fail.c: Test behavior of the new missing
signature stuff.
2018-06-11 11:57:59 +02:00
93e45ceee7 Remove unconditionally set warning flags for GCC
* configure.ac: Add -W(no-)unused-macros and -Wno-missing-field-initializers
  to gcc/clang compiler flags
* libwget/Makefile.am: Remove -Wno-unused-macros
* tests/Makefile.am: Remove -Wno-missing-field-initializers
* unit-tests/Makefile.am: Likewise

Reported-by: Dagobert Michelsen
2018-05-03 22:00:02 +02:00
7b6fae2cda * tests/Makefile.am: Add $(EXEEXT) where missing 2018-05-03 12:50:13 +02:00
ff855298cc Add --[no-]compression=TYPE
* src/options.c: Add compression option support
* src/wget.c: Generate 'Accept-Encoding' headers accordingly
* src/wget_options.h: Add compression variables
* libwget/decompressor.c: Add xz and "none" types
* include/wget/wget.h: Add xz types
* docs/wget2.md: Add compression option document
* tests/Makefile.am: Add compression test
* tests/libtest.c: Add request header test support
* tests/libtest.h: Add request header test support
* tests/test-compression.c: Add compression test
2018-04-11 18:23:13 +08:00
ea9e8af04f Fix ignorant server's Content-Encoding
* libwget/decompressor.c: Fix segfault on unexpected Content-Encoding
* tests/Makefile.am: Add test-gzip.c
* tests/test-gzip.c: New test

Reported-by: Jiading Guo
2018-03-02 10:21:19 +00:00
cb78edb0bb More tests for --https-enfore
* src/options.c: Add debug lines, fix exit_status to exit_status_t
* src/wget_options.h: Amend prototype of get_exit_status()
* tests/test--https-enforce-soft2.c: New test
* tests/test--https-enforce-soft3.c: New test
* tests/Makefile.am: Add new tests
* src/wget.c (_fallback_to_http): Skip robotstxt jobs
* tests/libtest.c: New option WGET_TEST_HTTPS_REJECT_CONNECTIONS
  for wget_test_start_server()
2018-01-30 12:32:25 +01:00
e75c481a63 Add test test--https-enforce-hard3.c 2018-01-30 12:32:25 +01:00
af2a11e3ef Add tests for --https-enforce
* tests/Makefile.am: Add new tests
* tests/libtest.c: Code cleanup,
  (_answer_to_connection): implement protocol specific urls,
  (wget_test_start_server): implement WGET_TEST_HTTP(S)_ONLY,
  (wget_test): Allow absolute URLS for WGET_TEST_REQUEST_URL(S)
* tests/libtest.h (wget_test_url_t): Add https_only and http_only
2018-01-30 12:32:25 +01:00
aca8b55995 Suppress ASAN leak detection in getaddrinfo_a()
* .gitlab-ci.yml: export LSAN_OPTIONS=suppression=...
* tests/Makefile.am: Add suppression file to TESTS_ENVIRONMENT
* tests/clang-asan-suppressions: New file with leak suppression

getaddrinfo_a() has leak(s) that we have to suppress when using
the address sanitizer.
2018-01-29 14:38:51 +01:00
dd0bdac7f1 Delete signature file, and delete files that fail signature validation.
* docs/wget2.md: Added documentation for new '--verify-save-failed'
* src/gpgme.c: Exposed function to determine base downloaded file from
  signature JOB.
* src/options.c: Added '--verify-save-failed' to allow users to keep downloaded
  files that fail validation.
* src/wget.c: Logic for unlinking signatures, and files failing validation.
* src/wget_gpgme.c: Declaration for new function that determine base downloaded
  files.
* tests/Makefile.am: Added New test code, fixed missing SOURCES.
* tests/gpg-test-util.h: Conditionally expect a saved base file if exit
  code == 0, never expect a saved signature file.
* tests/test-gpg-save-failed.c: A test that tests the '--verify-save-failed'
  flag.
* tests/test-gpg-style.s: Remove signature file from expected output.

Added flag '--verify-save-failed' to disable the "fail delete" behavior.
2018-01-12 18:53:11 +01:00
8e7dec5f98 Remove data/ directory
* Makefile.am: Remove data/ from SUBDIRS
* configure.ac: Remove data/Makefile from AC_CONFIG_FILES
* tests/Makefile.am: Remove WGET_DATADIR from DEFS
* unit-tests/Makefile.am: Likewise
* data/effective_tld_names.dat: Move to unit-tests/files/public_suffix_list.dat
  and update from upstream
* unit-tests/test.c (test_cookies): Use public_suffix_list.dat
2018-01-11 12:39:00 +01:00
f1441defb7 GPG signature information now presented in --site-stats
* src/stats.c: Site stats output contains relevant GPG signature information
* stc/wget.c: Now exits with just a generic GPG error if any sigs fail validation.
More information presented in --site-stats output.
* src/wget_host.h: Added signature information to DOC struct.
* src/wget_options.h: Removed old exit codes in favor of single GPG error exit code.
* tests/Makefile.am: Added test-gpg-bad to Makefile
* tests/gpg/helloworld.txt.bad.sig: A corrupted signature (I just deleted a byte somewhere)
* tests/test-gpg-bad.c: A test for a bad (corrupted) signature.
* tests/test-gpg-invalid.c: Changed exit code to the single GPG error exit code.
2018-01-09 22:15:39 -05:00
4a0620d1a1 Add support to change the GPG signature file extension
* src/wget_options.h: Define a new option, --signature-extension
* src/options.c: Guard the SECTION_GPG in help_section_t with ifdef's.
  Set new option as a string and give it a default value
* src/wget.c(process_response): Use the value in config.sig_ext to
  decide the extension of the signature file
* tests/Makefile.am: Add new tests to Makefile
* tests/test-gpg-styles.c: New test file
2018-01-04 16:11:10 +01:00
b54fc08da6 * tests/Makefile.am: Do not build/run GPG tests if gpgme isn't installed 2018-01-03 15:33:58 +01:00
2faffa4f76 Add test for --filter-mime-type
* tests/Makefile.am: Add test--filter-mime-type
* tests/test--filter-mime-type.c: New test
2018-01-02 14:13:32 +00:00
39dfeec1ae Fixed problems pointed out in MR. Added tests and doxygen documentation.
* bootstrap.conf: Add canonicalize module.
* cfg.mk: Added exclusions to no new line at EOF for binary files used in tests.
* configure.ac: Check for libgpgme
* docs/wget2_manual.md: Added manual entries for --verify-sig, --gnupg-homedir, and new exit codes.
* fuzz/Makefile.am: Amend linker options
* include/wget/wget.h: Add error codes for GPG signature verification.
* po/POTFILES.in: Add new files.
* src/Makefile.am: Add src/gpgme.c and src/wget_gpgme.h
* src/gpgme.c: Using new error codes, and better signature verification failure detection.
* src/job.c (job_free): Free sig_filename
* src/options.c: Add new options --gnupg-homedir and --verify-sig
* src/wget.c: Verify the signature if possible, exit with the proper status code,
  print error messages
* src/wget_gpgme.h: Add documentation.
* src/wget_job.h: Extend struct JOB
* src/wget_options.h: Add new status codes, add new members to struct config
* tests/Makefile.am: Added new tests.
* tests/gpg-test-util.h: Common GPG testing functionality (tries to verify a signature, expects exit code ... etc).
* tests/gpg/helloworld.txt: Text that has been signed in the .sig files.
* tests/gpg/helloworld.txt.{invalid,no-pub,missing,trusted}.sig: Signatures on helloworld.txt with properties described by their names.
* tests/gpg/openpgp-revocs.d/*: Revocation certs for the fake "homedir"
* tests/gpg/private-keys-v1.d/*: The not-so-private private keys used to sign the test file.
* tests/gpg/pubring.kbx: Fake gnupg homedir public key ring.
* tests/gpg/test-gpg-*.c: Tests.
* tests/valgrind-supressions: Supress failures due to oddness with GPGME.
* unit-tests/Makefile.am: Add src/gpgme.o to BASE_OBJS
2018-01-01 13:28:43 +01:00
7a634d0571 Use BUILDDIR for popen() in test suite
* tests/Makefile.am: Set BUILDDIR
* tests/libtest.c: Use BUILDDIR for executable path
2017-12-06 09:35:34 +01:00