Commit Graph

23 Commits

Author SHA1 Message Date
15ba1db248 Update copyrights 2023-08-31 12:57:30 +02:00
3dc7f71098 Update copyright year 2022-02-25 17:46:43 +01:00
22162f82b2 Update copyright year 2021-01-22 21:58:38 +01:00
59d9ecd9c0 * Update copyright year to 2020 2020-01-10 00:33:02 +01:00
5d72533570 Fix license of all tests
All the tests in tests/ are part of Wget2 the binary, not libwget. Fix
the license and copyright information accordingly.

* tests/libtest.c: libwget -> Wget. LGPLv3+ -> GPLv3+
* tests/test--accept.c: Same
* tests/test--filter-mime-type.c: Same
* tests/test--follow-tags.c: Same
* tests/test--https-enforce-hard1.c: Same
* tests/test--https-enforce-hard2.c: Same
* tests/test--https-enforce-hard3.c: Same
* tests/test--https-enforce-soft1.c: Same
* tests/test--https-enforce-soft2.c: Same
* tests/test--https-enforce-soft3.c: Same
* tests/test--page-requisites.c: Same
* tests/test--post-file.c: Same
* tests/test--save-content-on.c: Same
* tests/test--spider-r.c: Same
* tests/test-E-k.c: Same
* tests/test-auth-basic.c: Same
* tests/test-auth-digest.c: Same
* tests/test-bad-chunk.c: Same
* tests/test-base.c: Same
* tests/test-c-r.c: Same
* tests/test-chunked.c: Same
* tests/test-compression.c: Same
* tests/test-cut-dirs.c: Same
* tests/test-cut-get-vars.c: Same
* tests/test-directory-clash.c: Same
* tests/test-ftp.c: Same
* tests/test-ftps.c: Same
* tests/test-gpg-bad.c: Same
* tests/test-gpg-invalid.c: Same
* tests/test-gpg-missing.c: Same
* tests/test-gpg-save-failed.c: Same
* tests/test-gpg-styles.c: Same
* tests/test-gpg-valid.c: Same
* tests/test-gpg-verify-no-file.c: Same
* tests/test-gzip.c: Same
* tests/test-i-http.c: Same
* tests/test-i-https.c: Same
* tests/test-idn-cmd.c: Same
* tests/test-idn-meta.c: Same
* tests/test-idn-robots.c: Same
* tests/test-include-and-exclude-directories.c: Same
* tests/test-iri-disabled.c: Same
* tests/test-iri-forced-remote.c: Same
* tests/test-iri-list.c: Same
* tests/test-iri-percent.c: Same
* tests/test-iri-subdir.c: Same
* tests/test-iri.c: Same
* tests/test-k.c: Same
* tests/test-limit-rate-http2.c: Same
* tests/test-limit-rate.c: Same
* tests/test-meta-robots.c: Same
* tests/test-metalink.c: Same
* tests/test-np.c: Same
* tests/test-ocsp-server.c: Same
* tests/test-ocsp-stap.c: Same
* tests/test-p-nc.c: Same
* tests/test-parse-css.c: Same
* tests/test-parse-html-css.c: Same
* tests/test-parse-rss.c: Same
* tests/test-plugin-dummy.c: Same
* tests/test-plugin-failure.c: Same
* tests/test-plugin-interception.c: Same
* tests/test-plugin-nonexistance.c: Same
* tests/test-plugin.c: Same
* tests/test-post-handhshake-auth.c: Same
* tests/test-redirection.c: Same
* tests/test-restrict-ascii.c: Same
* tests/test-robots.c: Same
* tests/test-stats-dns.c: Same
* tests/test-stats-ocsp.c: Same
* tests/test-stats-server.c: Same
* tests/test-stats-site.c: Same
* tests/test-stats-tls.c: Same
* tests/test-timestamping.c: Same
* tests/test-unlink.c: Same
* tests/test-wget-1.c: Same
2019-11-02 16:10:19 +01:00
4b9edbad2d Update Copyright statements to be compatible with update-copyright module 2019-09-10 23:41:56 +02:00
a4dac96cf3 Update cfg.mk. Add comments for future
* cfg.mk: Multiple changes.
  (sc_GPL_version): Don't exclude all files when only one has a parsing
  issue
  (sc_po_check): Tests should always output English. Their output is for
  developers, not users
  (sc_prohibit_magic_number_exit): tests/test-plugin.c has a parsing
  issue that has been reported to gnulib. Others should be checked.
  (sc_trailing_blank): Fixed the relevant files instead of ignoring them
  (sc_two_space_separator_in_usage): Doesn't seem to trigger on removal
  (sc_prohibit_empty_lines_at_EOF): Same
  (sc_prohibit_sprintf): Same
  (sc_prohibit_printf): Re-arrange within file
  (sc_prohibit_free): Same
  (sc_prohibit_alloc): Same
  (sc_gettext_printf): Same
* docs/DoxygenLayout.xml: Remove trailing whitespaces
* docs/libwget.doxy.in: Same
* tests/libtest.c: Don't internationalize test suite strings
* tests/test-*.c: Use EXIT_FAILURE and EXIT_SUCCESS instead of 1 and 0
2019-09-10 23:02:05 +02:00
cdb3600791 Update copyrigght to 2019 2019-01-02 12:42:53 +01:00
77413f24e2 Use a common header file to deduplicate plugin test boilerplate
* tests/test_plugin.h: Add the OBJECT_DIR and other defines in a single
common file for all plugin tests
* tests/test-plugin*.c: Remove boilerplate code and include
"test_plugin.h"
2018-11-14 19:59:20 +01:00
3688ffb941 Update copyright to 2018 2018-04-30 20:52:11 +02:00
ce9d2c5994 Split up plugin tests into several files
* tests/Makefile.am: Add new files
* tests/test-plugin-failure.c: New file with tests based on invalid input
* tests/test-plugin-interception.c: New file for testing the various things
  plugins can intercept
* tests/test-plugin-nonexistance.c: New file for tests with plugins that don't exist)
* tests/test-plugin.c: Moved tests to the above new files
2017-11-01 16:24:33 +01:00
f7e4c13099 Add wget_options_fuzzer
* Makefile.am: Fix make target 'fuzz-coverage'
* configure.ac: Enable building static library by default,
  add option --enable-fuzzing
* fuzz/Makefile.am: Add wget_options_fuzzer,
  check for FUZZING (set with --enable-fuzzing)
* fuzz/README.md: Amend the text
* fuzz/main.c: Use printf() instead of wget_info_printf()
* fuzz/run-clang.sh: Use fuzzer binaries built by 'make'
* fuzz/wget_options_fuzzer.c: New fuzzer
* fuzz/wget_options_fuzzer.dict: New fuzzer dictionary
* fuzz/wget_options_fuzzer.in/*: Initial fuzz corpora
* libwget/net.c: Skip IP address resolution when fuzzing
* src/log.c: Don't create files when fuzzing,
  don't print to console when fuzzing
* src/options.c: Add set_exit_status() and get_exit_status(),
  don't print --help / --version to console when fuzzing,
  do not call exit() - return error instead,
  fix recursion level in _read_config(),
  don't create files when fuzzing,
  fix memory leaks in deinit()
* src/stats.c: Don't create files when fuzzing
* src/wget.c: Remove set_exit_status()
* src/wget_main.h: Remove exit_status_t
* src/wget_options.h: Add exit_status_t
* tests/test-plugin.c: Fix expected exit codes from 1 to 2

This is for application fuzzing (namely code from src/).
The code in src/ had to be prepared in certain ways, but it
doesn't add significant overhead, even makes the code cleaner
in some ways. Several of these changes have already been committed
into the master branch.
2017-10-26 15:41:01 +02:00
93f88709be Add --no-local-db to test suite
* tests/libtest.c: Add --no-local-db to wget2 options
* tests/test-plugin.c: Fix test
2017-10-07 20:47:00 +02:00
1383c21e26 * tests/test-plugin.c: Fix check for skipping the test 2017-10-05 21:33:53 +02:00
a819be12df Skip plugin tests if shared build is disabled
The use of -shared in the LDFLAGS for the plugins does not work
with './configure --disable-shared'. Instead of failing the build
this patch SKIPs the plugin tests.
2017-10-03 21:26:45 +02:00
550c8a8b3a Extend plugin loading for CygWIN
* src/dl.c: Add PATTERN for CygWin
* tests/test-plugin.c: Define LOCAL_NAME for CygWin
* unit-tests/test-dl.c: Define BUILD_NAME and LOCAL_NAME for CygWin
2017-10-02 16:53:20 +02:00
615bef51e9 Use Feature Flags to SKIP unsupported tests
* tests/libtest.{c,h}: Add support for feature flags during test
startup. Check if Wget2 is compiled with the feature and conditionally
SKIP the tests
* tests/test-*.c: Pass the right feature flags for each test. MHD for
HTTP, FTP for FTP, IDN and PLUGIN when applicable
2017-09-18 11:28:40 +02:00
98c8e410a8 Add plugin APIs for custom HSTS, HPKP and OCSP databases
* include/wget/wget.h: Add plugin API declarations
 * libwget/hsts.c: Make wget_hsts_db_t extensible
 * libwget/hpkp.c: Make wget_hpkp_db_t extensible
 * libwget/ocsp.c: Make wget_ocsp_db_t extensible
 * libwget/plugin.c: Add virtual functions for plugin API
 * src/plugin.c: Add plugin API implementation
 * src/wget_plugin.h: Likewise
 * src/option.c: Add code to call the implementation
 * src/wget.c: Likewise
 * tests/test-plugin-dummy: Add plugin with dummy databases for testing
 * tests/Makefile.am: Add target libplugindb.la
 * tests/test-plugin.c: Add tests for custom databases
 * unit-tests/test.c: Add tests for new HPKP functions
 * libwget/ssl_gnutls.c: Adapt to API changes
 * examples/http_multi_get.c: Likewise
 * fuzz/libwget_hpkp_fuzzer.c: Likewise
 * fuzz/libwget_hsts_fuzzer.c: Likewise
 * fuzz/libwget_ocsp_fuzzer.c: Likewise

This feature implemented as per the specifications at
https://gitlab.com/akash_rawal/wget2/wikis/Stage-4
2017-09-03 18:21:39 +02:00
81cada6b7d Add plugin APIs for intercepting downloaded files.
Merged from branch tmp-akash_rawal-stage3 into master

 * include/wget/wget.h: Add function declarations
 * libwget/plugin.c: Add virtual functions
 * configure.ac: Check for fmemopen()
 * src/plugin.c: Add implementation
 * src/wget_plugin.h: Likewise
 * src/wget.c: Add code that calls the implementation
 * tests/test-plugin-dummy.c (pluginapi): Add option 'parse-rot13',
   'only-rot13' and 'test-pp'
 * tests/test-plugin.c: Add tests
 * tests/libtest.c: Load files into dynamic memory instead of stack,
   enables testing with large files.

Plugin APIs for intercepting downloaded files have been implemented
as per specifications at https://gitlab.com/akash_rawal/wget2/wikis/Stage-3
2017-09-03 12:07:11 +02:00
892e4ac761 Add plugin APIs for intercepting URLs
* include/wget/wget.h: Add function declarations
 * libwget/plugin.c: Add virtual functions
 * src/plugin.c: Add implementation
 * src/wget_plugin.h: Likewise
 * src/wget.c: Add code that calls the implementation
 * src/wget_job.h: Add a variable to store 'accept' action
 * tests/Makefile.am: Add libpluginapi.la
 * tests/test-plugin-dummy.c: Add a test plugin for testing
 * tests/test-plugin.c: Add tests

Plugin API for intercepting URLs has been implemented as per
specifications at https://gitlab.com/akash_rawal/wget2/wikis/Stage-2
2017-07-21 00:17:41 +02:00
c3a0e8ac47 Add command line option forwarding for plugins
* include/wget/wget.h: Add API for command line option forwarding
* libwget/plugin.c: Likewise
* libwget/test_linking: Add function from libwget/plugin.c
* src/dl.c: Remove unused dl_search1() and dl_list1(),
            use wget_vector_t for pointer arrays
* src/wget_dl.h: Likewise
* src/plugin.c: Implement option forwarding
* src/wget_plugin.h: Likewise
* src/options.c: Add options '--plugin-opt=', '--plugin-help'
* unit-tests/test-dl.c: Use dl_list() instead of dl_list1()
* tests/Makefile.am: Add test plugins pluginoption, pluginfaulty1,
                     pluginfaulty2
* tests/test-plugin-dummy.c: Implement additional test plugins
* tests/test-plugin.c: Extend tests for testing option processing

Command line option forwarding has been implemented as per
specifications at https://gitlab.com/akash_rawal/wget2/wikis/Stage-1

Several style issues were also fixed (Thanks Ander Juaristi)
2017-07-20 23:21:31 +02:00
c7b1597c4b Fix name clashes with gnulib
* tests/test-plugin.c: Rename setenv and unsetenv to setenv_rpl
                       and unsetenv_rpl respectively.
* unit-tests/test-dl.c: Rename rpl_remove to remove_rpl.

Reported by @gvanem
2017-06-07 08:41:44 +05:30
4d3b3f5167 Add basic plugin loading mechanism
* configure.ac: Add configure time tests for plugin support backend.
* include/wget/wget.h: Add basic plugin API
* libwget/Makefile.am: Add new file plugin.c to libwget.la
* libwget/plugin.c: Add plugin API functions (new file)
* src/Makefile.am: Add new files dl.c, wget_dl.h, plugin.c, wget_plugin.h
                   to wget2
* src/dl.c: Add abstraction for dynamic loading of object files
* src/wget_dl.h: Likewise
* src/plugin.c: Add implementation for loading plugins
* src/wget_plugin.h: likewise
* src/options.c: Add options `--plugin=`, `--local-plugin=`,
                 `--plugin-dirs=`, `--list-plugins`
* src/wget.c: Add function calls to initialize and finalize plugin
              support system
* unit-tests/Makefile.am: Add test-dl, libalpha.la, and libbeta.la
* unit-tests/test-dl.c: Add unit test for src/dl.c
* unit-tests/test-dl-dummy.c: Likewise
* tests/Makefile.am: Add test-plugin, libpluginname.la, and
                     libpluginexit.la
* tests/test-plugin.c: Add tests for plugin support
* tests/test-plugin-dummy.c: Likewise
* libwget/test-linking.c: Fix warnings with --enable-manywarnings
* unit-tests/test.c: likewise

Plugin loading mechanism has been implemented as per specifications
at https://gitlab.com/akash_rawal/wget2/wikis/Stage-0
2017-06-06 17:04:44 +02:00