Commit Graph

27 Commits

Author SHA1 Message Date
0f554ef216 * */Makefile.am: Reorder link libraries (libgnu.la first) 2022-03-05 16:23:15 +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
5645e709a2 Add unit test test-decompress.c
* unit-tests/Makefile.am: Add test-decompress.c
* unit-tests/test-decompress.c: New file
2019-09-21 22:16:25 +02:00
0bf3c3cdfd * unit-tests/Makefile.am: Add -DMALLOC_RETURNS_NONNULL to AM_CFLAGS and AM_CPPFLAGS 2019-08-16 15:24:19 +02:00
6880c94e2e Move server stats code from library into wget2 tool
* fuzz/Makefile.am: Add src/stats_server.c
* src/Makefile.am: Likewise
* unit-tests/Makefile.am: Likewise
* include/wget/wget.h: Move `wget_server_stats_data` to src/stats_server.c,
  change wget_server_stats_callback,
  change wget_server_set_stats_callback(),
  add wget_tcp_get_ip(),
  remove host_ips_free()
* libwget/http.c: Move stats code to src/stats_server.c
* libwget/net.c: Add wget_tcp_get_ip()
* src/options.c: Move _hpkp_string() and stats_callback_server() to src/stats_server.c
* src/wget.c (main): Remove call to host_ips_free()
* src/wget_stats.h: Add prototypes of stats_server_add, server_stats_init, server_stats_exit
2019-08-12 16:14:48 +02:00
45a78db0b1 * unit-tests/Makefile.am: Add CODE_COVERAGE flags 2019-08-07 16:05:43 +02:00
5230e1d165 Rewrite Site statistics --stats-site
* fuzz/Makefile.am: Remove ../src/stats_site.o
* include/wget/wget.h: Remove wget_stats_type_t
* po/POTFILES.in. Remove src/stats.c
* src/Makefile.am: Remove stats_site.c
* src/options.c (parse_stats_all): Remove site stats code,
  (init): Add DNS stats code,
  (deinit): Cleanup dns stats code
* src/stats.c: Remove file
* src/stats_site.c: iFix for new stats code
* src/wget.c (main): stats_print -> site_stats_print,
  (add_statistics): config.stats_site -> config.stats_site_args,
  (process_response): Likewise
* src/wget_options.h (struct config): Remove stats_site, add stats_site_args
* src/wget_stats.h: Remove stats_opt_t,
  remove stats_print_func_t,
  remove stats_callback_setter_t,
  remove struct stats_opts,
  remove stats_site_opts,
  rename stats_init -> site_stats_init,
  rename stats_exit -> site_stats_exit,
  rename stats_print -> site_stats_print
* unit-tests/Makefile.am: Remove ../src/stats.o
2019-06-21 15:43:34 +02:00
619a7456c1 Rewrite Server statistics --stats-server
* fuzz/Makefile.am: Remove ../src/stats_server.o
* include/wget/wget.h:
  remove wget_server_stats_t,
  rename wget_stats_callback_t -> wget_server_stats_callback_t,
  rename wget_tcp_set_stats_server -> wget_server_set_stats_callback,
  add wget_server_stats_data_t,
  add wget_server_stats_callback_t,
* libwget/http.c: Remove _stats_data_t,
  add server_stats_callback,
  add server_stats_ctx
* src/Makefile.am: Remove stats_server.c
* src/options.c (parse_stats_all): Remove server stats code,
  add stats_callback_server(),
  (init): Add DNS stats code,
  (deinit): Cleanup dns stats code
* src/stats.c (stats_print_func_t): Remove print_server[],
  remove WGET_STATS_TYPE_SERVER
* src/stats_server.c: Remove file
* src/wget_options.h (struct config): Remove stats_server, add stats_server_args
* src/wget_stats.h: Remove stats_server_opts
* unit-tests/Makefile.am: Remove ../src/stats_server.o
2019-06-21 15:33:06 +02:00
e5ef8c168f Rewrite TLS statistics --stats-tls
* fuzz/Makefile.am: Remove ../src/stats_tls.o
* include/wget/wget.h: Add wget_tls_stats_data_t,
  add wget_tls_stats_callback_t,
  add wget_ssl_set_stats_callback_tls,
  remove WGET_STATS_TYPE_TLS,
  remove wget_tls_stats_t,
  remove wget_tcp_set_stats_tls(),
  remove wget_tcp_get_stats_tls()
* libwget/ssl_gnutls.c: Remove old stats code, add new stats code
* libwget/ssl_none.c: Add/remove function stubs
* libwget/ssl_wolfssl.c: Remove old stats code, add new stats code
* src/Makefile.am: Remove stats_tls.c
* src/options.c (parse_stats_all): Remove TLS stats code,
  add stats_callback_tls(),
  (init): Add TLS stats code,
* src/stats.c (stats_print_func_t): Remove print_tls[],
  remove WGET_STATS_TYPE_TLS
* src/stats_tls.c: Remove file
* src/wget_options.h (struct config): Remove stats_tls, add stats_tls_args
* src/wget_stats.h: Remove stats_tls_opts
* unit-tests/Makefile.am: Remove ../src/stats_tls.o
2019-06-21 15:32:13 +02:00
6df1578283 Rewrite OCSP statistics --stats-ocsp
* fuzz/Makefile.am: Remove ../src/stats_ocsp.o
* include/wget/wget.h: Add wget_ocsp_stats_data_t,
  add wget_ocsp_stats_callback_t,
  add wget_ssl_set_stats_callback_ocsp,
  remove WGET_STATS_TYPE_OCSP,
  remove wget_ocsp_stats_t,
  remove wget_tcp_set_stats_ocsp(),
  remove wget_tcp_get_stats_ocsp()
* libwget/ssl_gnutls.c: Remove old stats code, add new stats code
* libwget/ssl_none.c: Add/remove function stubs
* libwget/ssl_wolfssl.c: Remove old stats code, add new stats code
* src/Makefile.am: Remove stats_ocsp.c
* src/options.c (parse_stats_all): Remove OCSP stats code,
  add stats_callback_ocsp(),
  (init): Add OCSP stats code,
* src/stats.c (stats_print_func_t): Remove print_ocsp[],
  remove WGET_STATS_TYPE_OCSP
* src/stats_ocsp.c: Remove file
* src/wget_options.h (struct config): Remove stats_ocsp, add stats_ocsp_args
* src/wget_stats.h: Remove stats_ocsp_opts
* unit-tests/Makefile.am: Remove ../src/stats_ocsp.o
2019-06-21 15:32:13 +02:00
584c7f8801 Rewrite DNS statistics --stats-dns
* fuzz/Makefile.am: Remove ../src/stats_dns.o
* include/wget/wget.h: Add wget_dns_stats_data_t,
  add wget_dns_stats_callback_t,
  add wget_dns_set_stats_callback,
  remove WGET_STATS_TYPE_DNS,
  remove wget_dns_stats_t,
  remove wget_dns_set_stats(),
  remove wget_dns_get_stats()
* libwget/dns.c: Remove _stats_data_t,
  amend struct wget_dns_st,
  add wget_dns_set_stats_callback(),
  remove wget_dns_get_stats()
* src/Makefile.am: Remove stats_dns.c
* src/options.c (parse_stats_all): Remove DNS stats code,
  add stats_callback_dns(),
  (init): Add DNS stats code,
* src/stats.c (stats_print_func_t): Remove print_dns[],
  remove WGET_STATS_TYPE_DNS
* src/stats_dns.c: Remove file
* src/wget_options.h (struct config): Remove stats_dns, add stats_dns_args
* src/wget_stats.h: Remove stats_dns_opts
* tests/stats-test-util.h: Remove "human"
* unit-tests/Makefile.am: Remove ../src/stats_ocsp.o
2019-06-21 15:27:33 +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
83f37072ba Move _shell_expand() into own source file
* src/Makefile.am: Add utils.c and wget_utils.h
* src/options.c: Remove _shell_expand()
* src/stats.c: Likewise
* src/utils.c: New file with shell_expand()
* src/wget_utils.h: Header file for shell_expand()
* fuzz/Makefile.am: Add utils.o
* unit-tests/Makefile.am: Likewise
2018-02-22 14:33:03 +01:00
8f53ba4fa6 Move dns stats code into stats_dns.c 2018-02-22 14:33:03 +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
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
ebca6049b1 Add test for multi-threading
* unit-tests/Makefile.am: Add test-cond
* unit-tests/test-cond.c: New test
2017-12-20 20:38:21 +01:00
932c3e7378 Update link libraries in Makefiles
* fuzz/Makefile.am: Update link libraries and remove redundant code
* libwget/Makefile.am: Likewise
* src/Makefile.am: Likewise
* tests/Makefile.am: Likewise
* unit-tests/Makefile.am: Likewise
2017-12-05 12:33:19 +01:00
5a543187e2 * unit-tests/Makefile.am: Make libwget usable in dummy libraries 2017-11-29 20:29:11 +01:00
896163a99d Add testmode to avoid interactive functions when testing
* fuzz/Makefile.am: Link options fuzzer with testing.o
* fuzz/wget_options_fuzzer.c: Set test mode
* src/Makefile.am: Add testing.c and wget_testing.h
* src/options.c (prompt_for_password, run_use_askpass):
  Check for testing mode
* src/testing.c: New file
* src/wget_testing.h: New file
* unit-tests/Makefile.am: Link with testing.o
2017-11-18 19:13:10 +01:00
8146ea7786 Remove -static from AM_LDFLAGS in test directories
* fuzz/Makefile.am: Remove -static from AM_LDFLAGS
* tests/Makefile.am: Likewise
* unit-tests/Makefile.am: Likewise

'make check' didn't work on CygWin with these settings.
Also, GnuTLS removed these a short time ago from the fuzz/
directory since there were build issues.
2017-10-02 17:45:05 +02:00
f5d68f72ee Detangle src/hosts.c and src/stats.c
* src/host.c: Move stuff to src/stats.c
* src/options.c (init): Save --stats-site status in config
* src/stats.c: Insert stuff rom src/host.c
* src/wget.c: Cleaup regarding the above changes
* src/wget_host.h: Add structs and prototypes
* src/wget_options.h: Add config.stats_site
* src/wget_stats.h: Add prototypes
* unit-tests/Makefile.am: Link stats.o where needed
2017-09-19 10:40:34 +05:30
7aa4de6212 Fix DATADIR clash when build using MinGW64
* tests/Makefile.am: Change DATADIR to WGET_DATADIR
* unit-tests/Makefile.am: Likewise
* unit-tests/test.c: Likewise

When build Wget2 using MinGW64 and embedding other library
(Libmicrohttpd), DATADIR macro from Wget2 clash with MinGW64
header.
2017-08-13 17:17:40 +07:00
bce5b0ce21 Remove unneeded make variables 2017-07-23 22:04:35 +02:00
fdbc727c81 Disable plugin tests when plugins are disabled
* configure.ac: Add conditional PLUGIN_SUPPORT
* tests/Makefile.am: Enable plugin testing only if PLUGIN_SUPPORT exists
* unit-tests/Makefile.am: Likewise
2017-07-05 17:38:51 +02:00
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
fa600c4f04 Move unit tests from tests/ to unit-tests/
* Makefile.am: Add unit-tests
* cfg.mk: Make syntax-check work with unit-tests/
* configure.ac: Add unit-tests/Makefile
* tests/Makefile.am: Remove unit tests
* unit-tests/Makefile.am: New file with unit test rules
* unit-tests/*.c: Moved from tests/
* unit-tests/files: Moved from tests/

unit-tests/ is for library/API unit testing.
tests/ is for testing wget2 utility.
2017-05-31 20:51:10 +02:00