tests: speed up builds with single-binary test bundles
—
$ git checkout -f 71cf0d1fca9e1f53524e1545ef0c08d174458d80
Previous HEAD position was 4b378ea439 GHA: revert some build test steps added by #14772
HEAD is now at 71cf0d1fca tests: speed up builds with single-binary test bundles
$ git clean -fdx
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing buildinfo.txt
Removing compile
Removing config.guess
Removing config.log
Removing config.status
Removing config.sub
Removing configure
Removing curl-config
Removing depcomp
Removing docs/Makefile
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile
Removing docs/cmdline-opts/Makefile.in
Removing docs/examples/.deps/
Removing docs/examples/Makefile
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile
Removing include/Makefile.in
Removing include/curl/Makefile
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/.deps/
Removing lib/.dirstamp
Removing lib/.libs/
Removing lib/Makefile
Removing lib/Makefile.in
Removing lib/base64.o
Removing lib/curl_config.h
Removing lib/curl_config.h.in
Removing lib/curl_multibyte.o
Removing lib/dynbuf.o
Removing lib/libcurl.la
Removing lib/libcurl.vers
Removing lib/libcurl_la-altsvc.lo
Removing lib/libcurl_la-altsvc.o
Removing lib/libcurl_la-amigaos.lo
Removing lib/libcurl_la-amigaos.o
Removing lib/libcurl_la-asyn-ares.lo
Removing lib/libcurl_la-asyn-ares.o
Removing lib/libcurl_la-asyn-thread.lo
Removing lib/libcurl_la-asyn-thread.o
Removing lib/libcurl_la-base64.lo
Removing lib/libcurl_la-base64.o
Removing lib/libcurl_la-bufq.lo
Removing lib/libcurl_la-bufq.o
Removing lib/libcurl_la-bufref.lo
Removing lib/libcurl_la-bufref.o
Removing lib/libcurl_la-c-hyper.lo
Removing lib/libcurl_la-c-hyper.o
Removing lib/libcurl_la-cf-h1-proxy.lo
Removing lib/libcurl_la-cf-h1-proxy.o
Removing lib/libcurl_la-cf-h2-proxy.lo
Removing lib/libcurl_la-cf-h2-proxy.o
Removing lib/libcurl_la-cf-haproxy.lo
Removing lib/libcurl_la-cf-haproxy.o
Removing lib/libcurl_la-cf-https-connect.lo
Removing lib/libcurl_la-cf-https-connect.o
Removing lib/libcurl_la-cf-socket.lo
Removing lib/libcurl_la-cf-socket.o
Removing lib/libcurl_la-cfilters.lo
Removing lib/libcurl_la-cfilters.o
Removing lib/libcurl_la-conncache.lo
Removing lib/libcurl_la-conncache.o
Removing lib/libcurl_la-connect.lo
Removing lib/libcurl_la-connect.o
Removing lib/libcurl_la-content_encoding.lo
Removing lib/libcurl_la-content_encoding.o
Removing lib/libcurl_la-cookie.lo
Removing lib/libcurl_la-cookie.o
Removing lib/libcurl_la-curl_addrinfo.lo
Removing lib/libcurl_la-curl_addrinfo.o
Removing lib/libcurl_la-curl_des.lo
Removing lib/libcurl_la-curl_des.o
Removing lib/libcurl_la-curl_endian.lo
Removing lib/libcurl_la-curl_endian.o
Removing lib/libcurl_la-curl_fnmatch.lo
Removing lib/libcurl_la-curl_fnmatch.o
Removing lib/libcurl_la-curl_get_line.lo
Removing lib/libcurl_la-curl_get_line.o
Removing lib/libcurl_la-curl_gethostname.lo
Removing lib/libcurl_la-curl_gethostname.o
Removing lib/libcurl_la-curl_gssapi.lo
Removing lib/libcurl_la-curl_gssapi.o
Removing lib/libcurl_la-curl_memrchr.lo
Removing lib/libcurl_la-curl_memrchr.o
Removing lib/libcurl_la-curl_multibyte.lo
Removing lib/libcurl_la-curl_multibyte.o
Removing lib/libcurl_la-curl_ntlm_core.lo
Removing lib/libcurl_la-curl_ntlm_core.o
Removing lib/libcurl_la-curl_path.lo
Removing lib/libcurl_la-curl_path.o
Removing lib/libcurl_la-curl_range.lo
Removing lib/libcurl_la-curl_range.o
Removing lib/libcurl_la-curl_rtmp.lo
Removing lib/libcurl_la-curl_rtmp.o
Removing lib/libcurl_la-curl_sasl.lo
Removing lib/libcurl_la-curl_sasl.o
Removing lib/libcurl_la-curl_sha512_256.lo
Removing lib/libcurl_la-curl_sha512_256.o
Removing lib/libcurl_la-curl_sspi.lo
Removing lib/libcurl_la-curl_sspi.o
Removing lib/libcurl_la-curl_threads.lo
Removing lib/libcurl_la-curl_threads.o
Removing lib/libcurl_la-curl_trc.lo
Removing lib/libcurl_la-curl_trc.o
Removing lib/libcurl_la-cw-out.lo
Removing lib/libcurl_la-cw-out.o
Removing lib/libcurl_la-dict.lo
Removing lib/libcurl_la-dict.o
Removing lib/libcurl_la-dllmain.lo
Removing lib/libcurl_la-dllmain.o
Removing lib/libcurl_la-doh.lo
Removing lib/libcurl_la-doh.o
Removing lib/libcurl_la-dynbuf.lo
Removing lib/libcurl_la-dynbuf.o
Removing lib/libcurl_la-dynhds.lo
Removing lib/libcurl_la-dynhds.o
Removing lib/libcurl_la-easy.lo
Removing lib/libcurl_la-easy.o
Removing lib/libcurl_la-easygetopt.lo
Removing lib/libcurl_la-easygetopt.o
Removing lib/libcurl_la-easyoptions.lo
Removing lib/libcurl_la-easyoptions.o
Removing lib/libcurl_la-escape.lo
Removing lib/libcurl_la-escape.o
Removing lib/libcurl_la-file.lo
Removing lib/libcurl_la-file.o
Removing lib/libcurl_la-fileinfo.lo
Removing lib/libcurl_la-fileinfo.o
Removing lib/libcurl_la-fopen.lo
Removing lib/libcurl_la-fopen.o
Removing lib/libcurl_la-formdata.lo
Removing lib/libcurl_la-formdata.o
Removing lib/libcurl_la-ftp.lo
Removing lib/libcurl_la-ftp.o
Removing lib/libcurl_la-ftplistparser.lo
Removing lib/libcurl_la-ftplistparser.o
Removing lib/libcurl_la-getenv.lo
Removing lib/libcurl_la-getenv.o
Removing lib/libcurl_la-getinfo.lo
Removing lib/libcurl_la-getinfo.o
Removing lib/libcurl_la-gopher.lo
Removing lib/libcurl_la-gopher.o
Removing lib/libcurl_la-hash.lo
Removing lib/libcurl_la-hash.o
Removing lib/libcurl_la-headers.lo
Removing lib/libcurl_la-headers.o
Removing lib/libcurl_la-hmac.lo
Removing lib/libcurl_la-hmac.o
Removing lib/libcurl_la-hostasyn.lo
Removing lib/libcurl_la-hostasyn.o
Removing lib/libcurl_la-hostip.lo
Removing lib/libcurl_la-hostip.o
Removing lib/libcurl_la-hostip4.lo
Removing lib/libcurl_la-hostip4.o
Removing lib/libcurl_la-hostip6.lo
Removing lib/libcurl_la-hostip6.o
Removing lib/libcurl_la-hostsyn.lo
Removing lib/libcurl_la-hostsyn.o
Removing lib/libcurl_la-hsts.lo
Removing lib/libcurl_la-hsts.o
Removing lib/libcurl_la-http.lo
Removing lib/libcurl_la-http.o
Removing lib/libcurl_la-http1.lo
Removing lib/libcurl_la-http1.o
Removing lib/libcurl_la-http2.lo
Removing lib/libcurl_la-http2.o
Removing lib/libcurl_la-http_aws_sigv4.lo
Removing lib/libcurl_la-http_aws_sigv4.o
Removing lib/libcurl_la-http_chunks.lo
Removing lib/libcurl_la-http_chunks.o
Removing lib/libcurl_la-http_digest.lo
Removing lib/libcurl_la-http_digest.o
Removing lib/libcurl_la-http_negotiate.lo
Removing lib/libcurl_la-http_negotiate.o
Removing lib/libcurl_la-http_ntlm.lo
Removing lib/libcurl_la-http_ntlm.o
Removing lib/libcurl_la-http_proxy.lo
Removing lib/libcurl_la-http_proxy.o
Removing lib/libcurl_la-idn.lo
Removing lib/libcurl_la-idn.o
Removing lib/libcurl_la-if2ip.lo
Removing lib/libcurl_la-if2ip.o
Removing lib/libcurl_la-imap.lo
Removing lib/libcurl_la-imap.o
Removing lib/libcurl_la-inet_ntop.lo
Removing lib/libcurl_la-inet_ntop.o
Removing lib/libcurl_la-inet_pton.lo
Removing lib/libcurl_la-inet_pton.o
Removing lib/libcurl_la-krb5.lo
Removing lib/libcurl_la-krb5.o
Removing lib/libcurl_la-ldap.lo
Removing lib/libcurl_la-ldap.o
Removing lib/libcurl_la-llist.lo
Removing lib/libcurl_la-llist.o
Removing lib/libcurl_la-macos.lo
Removing lib/libcurl_la-macos.o
Removing lib/libcurl_la-md4.lo
Removing lib/libcurl_la-md4.o
Removing lib/libcurl_la-md5.lo
Removing lib/libcurl_la-md5.o
Removing lib/libcurl_la-memdebug.lo
Removing lib/libcurl_la-memdebug.o
Removing lib/libcurl_la-mime.lo
Removing lib/libcurl_la-mime.o
Removing lib/libcurl_la-mprintf.lo
Removing lib/libcurl_la-mprintf.o
Removing lib/libcurl_la-mqtt.lo
Removing lib/libcurl_la-mqtt.o
Removing lib/libcurl_la-multi.lo
Removing lib/libcurl_la-multi.o
Removing lib/libcurl_la-netrc.lo
Removing lib/libcurl_la-netrc.o
Removing lib/libcurl_la-nonblock.lo
Removing lib/libcurl_la-nonblock.o
Removing lib/libcurl_la-noproxy.lo
Removing lib/libcurl_la-noproxy.o
Removing lib/libcurl_la-openldap.lo
Removing lib/libcurl_la-openldap.o
Removing lib/libcurl_la-parsedate.lo
Removing lib/libcurl_la-parsedate.o
Removing lib/libcurl_la-pingpong.lo
Removing lib/libcurl_la-pingpong.o
Removing lib/libcurl_la-pop3.lo
Removing lib/libcurl_la-pop3.o
Removing lib/libcurl_la-progress.lo
Removing lib/libcurl_la-progress.o
Removing lib/libcurl_la-psl.lo
Removing lib/libcurl_la-psl.o
Removing lib/libcurl_la-rand.lo
Removing lib/libcurl_la-rand.o
Removing lib/libcurl_la-rename.lo
Removing lib/libcurl_la-rename.o
Removing lib/libcurl_la-request.lo
Removing lib/libcurl_la-request.o
Removing lib/libcurl_la-rtsp.lo
Removing lib/libcurl_la-rtsp.o
Removing lib/libcurl_la-select.lo
Removing lib/libcurl_la-select.o
Removing lib/libcurl_la-sendf.lo
Removing lib/libcurl_la-sendf.o
Removing lib/libcurl_la-setopt.lo
Removing lib/libcurl_la-setopt.o
Removing lib/libcurl_la-sha256.lo
Removing lib/libcurl_la-sha256.o
Removing lib/libcurl_la-share.lo
Removing lib/libcurl_la-share.o
Removing lib/libcurl_la-slist.lo
Removing lib/libcurl_la-slist.o
Removing lib/libcurl_la-smb.lo
Removing lib/libcurl_la-smb.o
Removing lib/libcurl_la-smtp.lo
Removing lib/libcurl_la-smtp.o
Removing lib/libcurl_la-socketpair.lo
Removing lib/libcurl_la-socketpair.o
Removing lib/libcurl_la-socks.lo
Removing lib/libcurl_la-socks.o
Removing lib/libcurl_la-socks_gssapi.lo
Removing lib/libcurl_la-socks_gssapi.o
Removing lib/libcurl_la-socks_sspi.lo
Removing lib/libcurl_la-socks_sspi.o
Removing lib/libcurl_la-speedcheck.lo
Removing lib/libcurl_la-speedcheck.o
Removing lib/libcurl_la-splay.lo
Removing lib/libcurl_la-splay.o
Removing lib/libcurl_la-strcase.lo
Removing lib/libcurl_la-strcase.o
Removing lib/libcurl_la-strdup.lo
Removing lib/libcurl_la-strdup.o
Removing lib/libcurl_la-strerror.lo
Removing lib/libcurl_la-strerror.o
Removing lib/libcurl_la-strtok.lo
Removing lib/libcurl_la-strtok.o
Removing lib/libcurl_la-strtoofft.lo
Removing lib/libcurl_la-strtoofft.o
Removing lib/libcurl_la-system_win32.lo
Removing lib/libcurl_la-system_win32.o
Removing lib/libcurl_la-telnet.lo
Removing lib/libcurl_la-telnet.o
Removing lib/libcurl_la-tftp.lo
Removing lib/libcurl_la-tftp.o
Removing lib/libcurl_la-timediff.lo
Removing lib/libcurl_la-timediff.o
Removing lib/libcurl_la-timeval.lo
Removing lib/libcurl_la-timeval.o
Removing lib/libcurl_la-transfer.lo
Removing lib/libcurl_la-transfer.o
Removing lib/libcurl_la-url.lo
Removing lib/libcurl_la-url.o
Removing lib/libcurl_la-urlapi.lo
Removing lib/libcurl_la-urlapi.o
Removing lib/libcurl_la-version.lo
Removing lib/libcurl_la-version.o
Removing lib/libcurl_la-version_win32.lo
Removing lib/libcurl_la-version_win32.o
Removing lib/libcurl_la-warnless.lo
Removing lib/libcurl_la-warnless.o
Removing lib/libcurl_la-ws.lo
Removing lib/libcurl_la-ws.o
Removing lib/nonblock.o
Removing lib/stamp-h1
Removing lib/strtoofft.o
Removing lib/timediff.o
Removing lib/vauth/.deps/
Removing lib/vauth/.dirstamp
Removing lib/vauth/libcurl_la-cleartext.lo
Removing lib/vauth/libcurl_la-cleartext.o
Removing lib/vauth/libcurl_la-cram.lo
Removing lib/vauth/libcurl_la-cram.o
Removing lib/vauth/libcurl_la-digest.lo
Removing lib/vauth/libcurl_la-digest.o
Removing lib/vauth/libcurl_la-digest_sspi.lo
Removing lib/vauth/libcurl_la-digest_sspi.o
Removing lib/vauth/libcurl_la-gsasl.lo
Removing lib/vauth/libcurl_la-gsasl.o
Removing lib/vauth/libcurl_la-krb5_gssapi.lo
Removing lib/vauth/libcurl_la-krb5_gssapi.o
Removing lib/vauth/libcurl_la-krb5_sspi.lo
Removing lib/vauth/libcurl_la-krb5_sspi.o
Removing lib/vauth/libcurl_la-ntlm.lo
Removing lib/vauth/libcurl_la-ntlm.o
Removing lib/vauth/libcurl_la-ntlm_sspi.lo
Removing lib/vauth/libcurl_la-ntlm_sspi.o
Removing lib/vauth/libcurl_la-oauth2.lo
Removing lib/vauth/libcurl_la-oauth2.o
Removing lib/vauth/libcurl_la-spnego_gssapi.lo
Removing lib/vauth/libcurl_la-spnego_gssapi.o
Removing lib/vauth/libcurl_la-spnego_sspi.lo
Removing lib/vauth/libcurl_la-spnego_sspi.o
Removing lib/vauth/libcurl_la-vauth.lo
Removing lib/vauth/libcurl_la-vauth.o
Removing lib/version_win32.o
Removing lib/vquic/.deps/
Removing lib/vquic/.dirstamp
Removing lib/vquic/libcurl_la-curl_msh3.lo
Removing lib/vquic/libcurl_la-curl_msh3.o
Removing lib/vquic/libcurl_la-curl_ngtcp2.lo
Removing lib/vquic/libcurl_la-curl_ngtcp2.o
Removing lib/vquic/libcurl_la-curl_osslq.lo
Removing lib/vquic/libcurl_la-curl_osslq.o
Removing lib/vquic/libcurl_la-curl_quiche.lo
Removing lib/vquic/libcurl_la-curl_quiche.o
Removing lib/vquic/libcurl_la-vquic-tls.lo
Removing lib/vquic/libcurl_la-vquic-tls.o
Removing lib/vquic/libcurl_la-vquic.lo
Removing lib/vquic/libcurl_la-vquic.o
Removing lib/vssh/.deps/
Removing lib/vssh/.dirstamp
Removing lib/vssh/libcurl_la-libssh.lo
Removing lib/vssh/libcurl_la-libssh.o
Removing lib/vssh/libcurl_la-libssh2.lo
Removing lib/vssh/libcurl_la-libssh2.o
Removing lib/vssh/libcurl_la-wolfssh.lo
Removing lib/vssh/libcurl_la-wolfssh.o
Removing lib/vtls/.deps/
Removing lib/vtls/.dirstamp
Removing lib/vtls/libcurl_la-bearssl.lo
Removing lib/vtls/libcurl_la-bearssl.o
Removing lib/vtls/libcurl_la-cipher_suite.lo
Removing lib/vtls/libcurl_la-cipher_suite.o
Removing lib/vtls/libcurl_la-gtls.lo
Removing lib/vtls/libcurl_la-gtls.o
Removing lib/vtls/libcurl_la-hostcheck.lo
Removing lib/vtls/libcurl_la-hostcheck.o
Removing lib/vtls/libcurl_la-keylog.lo
Removing lib/vtls/libcurl_la-keylog.o
Removing lib/vtls/libcurl_la-mbedtls.lo
Removing lib/vtls/libcurl_la-mbedtls.o
Removing lib/vtls/libcurl_la-mbedtls_threadlock.lo
Removing lib/vtls/libcurl_la-mbedtls_threadlock.o
Removing lib/vtls/libcurl_la-openssl.lo
Removing lib/vtls/libcurl_la-openssl.o
Removing lib/vtls/libcurl_la-rustls.lo
Removing lib/vtls/libcurl_la-rustls.o
Removing lib/vtls/libcurl_la-schannel.lo
Removing lib/vtls/libcurl_la-schannel.o
Removing lib/vtls/libcurl_la-schannel_verify.lo
Removing lib/vtls/libcurl_la-schannel_verify.o
Removing lib/vtls/libcurl_la-sectransp.lo
Removing lib/vtls/libcurl_la-sectransp.o
Removing lib/vtls/libcurl_la-vtls.lo
Removing lib/vtls/libcurl_la-vtls.o
Removing lib/vtls/libcurl_la-wolfssl.lo
Removing lib/vtls/libcurl_la-wolfssl.o
Removing lib/vtls/libcurl_la-x509asn1.lo
Removing lib/vtls/libcurl_la-x509asn1.o
Removing lib/warnless.o
Removing libcurl.pc
Removing libtool
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile
Removing packages/Makefile.in
Removing packages/vms/Makefile
Removing packages/vms/Makefile.in
Removing scripts/Makefile
Removing scripts/Makefile.in
Removing src/.deps/
Removing src/.libs/
Removing src/Makefile
Removing src/Makefile.in
Removing src/curl
Removing src/slist_wc.o
Removing src/terminal.o
Removing src/tool_binmode.o
Removing src/tool_bname.o
Removing src/tool_ca_embed.c
Removing src/tool_ca_embed.o
Removing src/tool_cb_dbg.o
Removing src/tool_cb_hdr.o
Removing src/tool_cb_prg.o
Removing src/tool_cb_rea.o
Removing src/tool_cb_see.o
Removing src/tool_cb_soc.o
Removing src/tool_cb_wrt.o
Removing src/tool_cfgable.o
Removing src/tool_dirhie.o
Removing src/tool_doswin.o
Removing src/tool_easysrc.o
Removing src/tool_filetime.o
Removing src/tool_findfile.o
Removing src/tool_formparse.o
Removing src/tool_getparam.o
Removing src/tool_getpass.o
Removing src/tool_help.o
Removing src/tool_helpers.o
Removing src/tool_hugehelp.c
Removing src/tool_hugehelp.o
Removing src/tool_ipfs.o
Removing src/tool_libinfo.o
Removing src/tool_listhelp.o
Removing src/tool_main.o
Removing src/tool_msgs.o
Removing src/tool_operate.o
Removing src/tool_operhlp.o
Removing src/tool_paramhlp.o
Removing src/tool_parsecfg.o
Removing src/tool_progress.o
Removing src/tool_setopt.o
Removing src/tool_sleep.o
Removing src/tool_stderr.o
Removing src/tool_strdup.o
Removing src/tool_urlglob.o
Removing src/tool_util.o
Removing src/tool_vms.o
Removing src/tool_writeout.o
Removing src/tool_writeout_json.o
Removing src/tool_xattr.o
Removing src/var.o
Removing tests/Makefile
Removing tests/Makefile.in
Removing tests/certs/Makefile
Removing tests/certs/Makefile.in
Removing tests/certs/scripts/Makefile
Removing tests/certs/scripts/Makefile.in
Removing tests/config
Removing tests/configurehelp.pm
Removing tests/data/Makefile
Removing tests/data/Makefile.in
Removing tests/http/Makefile
Removing tests/http/Makefile.in
Removing tests/http/clients/.deps/
Removing tests/http/clients/Makefile
Removing tests/http/clients/Makefile.in
Removing tests/http/config.ini
Removing tests/libtest/.deps/
Removing tests/libtest/Makefile
Removing tests/libtest/Makefile.in
Removing tests/server/.deps/
Removing tests/server/Makefile
Removing tests/server/Makefile.in
Removing tests/unit/.deps/
Removing tests/unit/Makefile
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:125: installing './compile'
configure.ac:438: installing './config.guess'
configure.ac:438: installing './config.sub'
configure.ac:125: installing './install-sh'
configure.ac:131: installing './missing'
docs/examples/Makefile.am: installing './depcomp'
$ bash -c find . -name config.guess -exec cp /usr/share/misc/config.guess {} \;
$ bash -c find . -name config.sub -exec cp /usr/share/misc/config.sub {} \;
$ chmod +x configure
$ ./configure --disable-shared --without-ssl --disable-docs
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking whether to disable dependency on -lrt... (assumed no)
checking whether to enable HTTPSRR support... no
checking whether to enable ECH support... no
checking for path separator... :
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking that grep -E works... yes
checking for ar... /usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... ccache gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether ccache gcc accepts -g... yes
checking for ccache gcc option to enable C11 features... none needed
checking whether ccache gcc understands -c and -o together... yes
checking how to run the C preprocessor... ccache gcc -E
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for stdatomic.h... yes
checking if _Atomic is available... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for code coverage support... no
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of ccache gcc... gcc3
checking curl version... 8.10.2-DEV
checking for httpd... no
checking for apache2... no
checking for apachectl... no
checking for apxs... no
configure: httpd/apache2 not in PATH, http tests disabled
configure: apxs not in PATH, http tests disabled
checking for nghttpx... no
checking for caddy... /usr/bin/caddy
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking if OS is AIX (to define _ALL_SOURCE)... no
checking if _THREAD_SAFE is already defined... no
checking if _THREAD_SAFE is actually needed... no
checking if _THREAD_SAFE is onwards defined... no
checking if _REENTRANT is already defined... no
checking if _REENTRANT is actually needed... no
checking if _REENTRANT is onwards defined... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by ccache gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from ccache gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if ccache gcc supports -fno-rtti -fno-exceptions... no
checking for ccache gcc option to produce PIC... -fPIC -DPIC
checking if ccache gcc PIC flag -fPIC -DPIC works... yes
checking if ccache gcc static flag -static works... yes
checking if ccache gcc supports -c -o file.o... yes
checking if ccache gcc supports -c -o file.o... (cached) yes
checking whether the ccache gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether to build shared libraries with -version-info... yes
checking whether to build shared libraries with -no-undefined... no
checking whether to build shared libraries with -mimpure-text... no
checking whether to build shared libraries with PIC... yes
checking whether to build static libraries with PIC... yes
checking whether to build shared libraries only... no
checking whether to build static libraries only... yes
checking for windres... no
checking if cpp -P is needed... yes
checking if cpp -P works... yes
checking if compiler is DEC/Compaq/HP C... no
checking if compiler is HP-UX C... no
checking if compiler is IBM C... no
checking if compiler is Intel C... no
checking if compiler is clang... no
checking if compiler is GNU C... yes
checking compiler version... gcc '1100' (raw: '11')
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking whether build target is a native Windows one... no
checking if compiler accepts some basic options... yes
configure: compiler options added: -Werror-implicit-function-declaration
checking if compiler optimizer assumed setting might be used... yes
checking if compiler accepts optimizer enabling options... yes
configure: compiler options added: -O2
checking if compiler accepts strict warning options... yes
configure: compiler options added: -Wno-system-headers
checking if compiler halts on compilation errors... yes
checking if compiler halts on negative sized arrays... yes
checking if compiler halts on function prototype mismatch... yes
checking if compiler supports hiding library internal symbols... yes
checking whether build target supports Win32 file API... no
checking whether build target supports Win32 crypto API... no
checking for good-to-use Darwin CFLAGS... no
checking whether to build libcurl and curl in "unity" mode... no
checking whether to build tests into single-binary bundles... no
checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support IPFS... yes
checking whether to support ldap... yes
checking whether to support ldaps... yes
checking whether to support rtsp... yes
checking whether to support proxies... yes
checking whether to support dict... yes
checking whether to support telnet... yes
checking whether to support tftp... yes
checking whether to support pop3... yes
checking whether to support imap... yes
checking whether to support smb... yes
checking whether to support smtp... yes
checking whether to support gopher... yes
checking whether to support mqtt... no
checking whether to provide built-in manual... yes
checking whether to build documentation... no
checking whether to enable generation of C code... yes
checking whether to use libgcc... no
checking if X/Open network library is required... no
checking for gethostbyname... yes
checking whether build target is a native Windows one... (cached) no
checking for proto/bsdsocket.h... no
checking for connect in libraries... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... yes
checking for monotonic clock_gettime... yes
checking for clock_gettime in libraries... no additional lib required
checking if monotonic clock_gettime works... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for raw monotonic clock_gettime... yes
checking for pkg-config... /usr/bin/pkg-config
checking for zlib options with pkg-config... found
checking for zlib.h... yes
configure: found both libz and libz.h header
checking for BrotliDecoderDecompress in -lbrotlidec... no
checking for brotli/decode.h... no
checking for ZSTD_createDStream in -lzstd... no
checking for zstd.h... no
checking for lber.h... no
checking for ldap.h... no
checking for ldap_ssl.h... no
checking for LDAP libraries... cannot find LDAP libraries
checking whether to enable IPv6... yes
checking if struct sockaddr_in6 has sin6_scope_id member... yes
checking if argv can be written to... yes
checking if GSS-API support is requested... no
checking whether to enable Windows native SSL/TLS... no
checking whether to enable Secure Transport... no
checking whether to enable Amiga native SSL/TLS (AmiSSL v5)... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libpsl options with pkg-config... found
checking for psl_builtin in -lpsl... yes
checking for libpsl.h... yes
checking for library containing gsasl_init... no
checking for RTMP_Init in -lrtmp... no
checking whether versioned symbols are wanted... no
checking whether to build with libidn2... (assumed) yes
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libidn2 options with pkg-config... no
configure: IDN_LIBS: "-lidn2"
configure: IDN_LDFLAGS: ""
configure: IDN_CPPFLAGS: ""
configure: IDN_DIR: ""
checking if idn2_lookup_ul can be linked... no
checking for idn2.h... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for libnghttp2 options with pkg-config... no
checking for nghttp2_session_get_stream_local_window_size in -lnghttp2... no
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking for sys/ioctl.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for arpa/inet.h... yes
checking for net/if.h... yes
checking for netinet/in.h... yes
checking for netinet/in6.h... no
checking for sys/un.h... yes
checking for linux/tcp.h... yes
checking for netinet/tcp.h... yes
checking for netinet/udp.h... yes
checking for netdb.h... yes
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking for sys/param.h... yes
checking for termios.h... yes
checking for termio.h... yes
checking for fcntl.h... yes
checking for io.h... no
checking for pwd.h... yes
checking for utime.h... yes
checking for sys/utime.h... no
checking for sys/poll.h... yes
checking for poll.h... yes
checking for socket.h... no
checking for sys/resource.h... yes
checking for libgen.h... yes
checking for locale.h... yes
checking for stdbool.h... yes
checking for sys/filio.h... no
checking for sys/wait.h... yes
checking for sys/eventfd.h... yes
checking for setjmp.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for struct timeval... yes
checking run-time libs availability... fine
checking size of size_t... 8
checking size of long... 8
checking size of int... 4
checking size of time_t... 8
checking size of off_t... 8
checking size of curl_off_t... 8
checking size of curl_socket_t... 4
checking for long long... yes
checking for ssize_t... yes
checking for bool... yes
checking for sa_family_t... yes
checking for suseconds_t... yes
checking if time_t is unsigned... no
checking for in_addr_t... yes
checking for struct sockaddr_storage... yes
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for select... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for recv... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for send... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for MSG_NOSIGNAL... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking if alarm can be linked... yes
checking if alarm is prototyped... yes
checking if alarm is compilable... yes
checking if alarm usage allowed... yes
checking if alarm might be used... yes
checking for sys/types.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for libgen.h... (cached) yes
checking if basename can be linked... yes
checking if basename is prototyped... yes
checking if basename is compilable... yes
checking if basename usage allowed... yes
checking if basename might be used... yes
checking for sys/types.h... (cached) yes
checking for socket.h... (cached) no
checking if closesocket can be linked... no
checking if closesocket might be used... no
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking if CloseSocket can be linked... no
checking if CloseSocket might be used... no
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for fcntl.h... (cached) yes
checking if fcntl can be linked... yes
checking if fcntl is prototyped... yes
checking if fcntl is compilable... yes
checking if fcntl usage allowed... yes
checking if fcntl might be used... yes
checking if fcntl O_NONBLOCK is compilable... yes
checking if fcntl O_NONBLOCK usage allowed... yes
checking if fcntl O_NONBLOCK might be used... yes
checking whether build target is a native Windows one... (cached) no
checking for sys/types.h... (cached) yes
checking for netdb.h... (cached) yes
checking if freeaddrinfo can be linked... yes
checking if freeaddrinfo is prototyped... yes
checking if freeaddrinfo is compilable... yes
checking if freeaddrinfo usage allowed... yes
checking if freeaddrinfo might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/xattr.h... yes
checking if fsetxattr can be linked... yes
checking if fsetxattr is prototyped... yes
checking if fsetxattr takes 5 args.... yes
checking if fsetxattr is compilable... yes
checking if fsetxattr usage allowed... yes
checking if fsetxattr might be used... yes
checking if ftruncate can be linked... yes
checking if ftruncate is prototyped... yes
checking if ftruncate is compilable... yes
checking if ftruncate usage allowed... yes
checking if ftruncate might be used... yes
checking for sys/types.h... (cached) yes
checking if getaddrinfo can be linked... yes
checking if getaddrinfo is prototyped... yes
checking if getaddrinfo is compilable... yes
checking if getaddrinfo seems to work... yes
checking if getaddrinfo usage allowed... yes
checking if getaddrinfo might be used... yes
checking if getaddrinfo is threadsafe... yes
checking if gethostbyname can be linked... yes
checking if gethostbyname is prototyped... yes
checking if gethostbyname is compilable... yes
checking if gethostbyname usage allowed... yes
checking if gethostbyname might be used... yes
checking if gethostbyname_r can be linked... yes
checking if gethostbyname_r is prototyped... yes
checking if gethostbyname_r takes 3 args.... no
checking if gethostbyname_r takes 5 args.... no
checking if gethostbyname_r takes 6 args.... yes
checking if gethostbyname_r is compilable... yes
checking if gethostbyname_r usage allowed... yes
checking if gethostbyname_r might be used... yes
checking if gethostname can be linked... yes
checking if gethostname is prototyped... yes
checking if gethostname is compilable... yes
checking for gethostname arg 2 data type... size_t
checking if gethostname usage allowed... yes
checking if gethostname might be used... yes
checking if getpeername can be linked... yes
checking if getpeername is prototyped... yes
checking if getpeername is compilable... yes
checking if getpeername usage allowed... yes
checking if getpeername might be used... yes
checking if getsockname can be linked... yes
checking if getsockname is prototyped... yes
checking if getsockname is compilable... yes
checking if getsockname usage allowed... yes
checking if getsockname might be used... yes
checking for net/if.h... (cached) yes
checking if if_nametoindex can be linked... yes
checking if if_nametoindex is prototyped... yes
checking if if_nametoindex is compilable... yes
checking if if_nametoindex usage allowed... yes
checking if if_nametoindex might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for ifaddrs.h... yes
checking if getifaddrs can be linked... yes
checking if getifaddrs is prototyped... yes
checking if getifaddrs is compilable... yes
checking if getifaddrs seems to work... yes
checking if getifaddrs usage allowed... yes
checking if getifaddrs might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/time.h... (cached) yes
checking if gmtime_r can be linked... yes
checking if gmtime_r is prototyped... yes
checking if gmtime_r is compilable... yes
checking if gmtime_r seems to work... yes
checking if gmtime_r usage allowed... yes
checking if gmtime_r might be used... yes
checking for sys/types.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking if inet_ntop can be linked... yes
checking if inet_ntop is prototyped... yes
checking if inet_ntop is compilable... yes
checking if inet_ntop seems to work... yes
checking if inet_ntop usage allowed... yes
checking if inet_ntop might be used... yes
checking if inet_pton can be linked... yes
checking if inet_pton is prototyped... yes
checking if inet_pton is compilable... yes
checking if inet_pton seems to work... yes
checking if inet_pton usage allowed... yes
checking if inet_pton might be used... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for stropts.h... no
checking if ioctl can be linked... yes
checking if ioctl is prototyped... yes
checking if ioctl is compilable... yes
checking if ioctl usage allowed... yes
checking if ioctl might be used... yes
checking if ioctl FIONBIO is compilable... yes
checking if ioctl FIONBIO usage allowed... yes
checking if ioctl FIONBIO might be used... yes
checking if ioctl SIOCGIFADDR is compilable... yes
checking if ioctl SIOCGIFADDR usage allowed... yes
checking if ioctl SIOCGIFADDR might be used... yes
checking if ioctlsocket can be linked... no
checking if ioctlsocket might be used... no
checking if IoctlSocket can be linked... no
checking if IoctlSocket might be used... no
checking if memrchr can be linked... yes
checking if memrchr is prototyped... no
checking if memrchr might be used... no
checking for sys/types.h... (cached) yes
checking for poll.h... (cached) yes
checking for sys/poll.h... (cached) yes
checking if poll can be linked... yes
checking if poll is prototyped... yes
checking if poll is compilable... yes
checking if poll seems to work... yes
checking if poll usage allowed... yes
checking if poll might be used... yes
checking for sys/types.h... (cached) yes
checking if sigaction can be linked... yes
checking if sigaction is prototyped... yes
checking if sigaction is compilable... yes
checking if sigaction usage allowed... yes
checking if sigaction might be used... yes
checking if siginterrupt can be linked... yes
checking if siginterrupt is prototyped... yes
checking if siginterrupt is compilable... yes
checking if siginterrupt usage allowed... yes
checking if siginterrupt might be used... yes
checking if signal can be linked... yes
checking if signal is prototyped... yes
checking if signal is compilable... yes
checking if signal usage allowed... yes
checking if signal might be used... yes
checking for sys/types.h... (cached) yes
checking if sigsetjmp can be linked... no
checking if sigsetjmp seems a macro... yes
checking if sigsetjmp is compilable... yes
checking if sigsetjmp usage allowed... yes
checking if sigsetjmp might be used... yes
checking if socket can be linked... yes
checking if socket is prototyped... yes
checking if socket is compilable... yes
checking if socket usage allowed... yes
checking if socket might be used... yes
checking if socketpair can be linked... yes
checking if socketpair is prototyped... yes
checking if socketpair is compilable... yes
checking if socketpair usage allowed... yes
checking if socketpair might be used... yes
checking if strcasecmp can be linked... yes
checking if strcasecmp is prototyped... yes
checking if strcasecmp is compilable... yes
checking if strcasecmp usage allowed... yes
checking if strcasecmp might be used... yes
checking if strcmpi can be linked... no
checking if strcmpi might be used... no
checking if strdup can be linked... yes
checking if strdup is prototyped... yes
checking if strdup is compilable... yes
checking if strdup usage allowed... yes
checking if strdup might be used... yes
checking if strerror_r can be linked... yes
checking if strerror_r is prototyped... yes
checking if strerror_r is compilable... yes
checking if strerror_r is glibc like... no
checking if strerror_r is POSIX like... yes
checking if strerror_r seems to work... yes
checking if strerror_r usage allowed... yes
checking if strerror_r might be used... yes
checking if stricmp can be linked... no
checking if stricmp might be used... no
checking if strtok_r can be linked... yes
checking if strtok_r is prototyped... yes
checking if strtok_r is compilable... yes
checking if strtok_r usage allowed... yes
checking if strtok_r might be used... yes
checking if strtoll can be linked... yes
checking if strtoll is prototyped... yes
checking if strtoll is compilable... yes
checking if strtoll usage allowed... yes
checking if strtoll might be used... yes
checking for ccache gcc options needed to detect all undeclared functions... none needed
checking whether getpwuid_r is declared... yes
checking for _fseeki64... no
checking for eventfd... yes
checking for fnmatch... yes
checking for geteuid... yes
checking for getpass_r... no
checking for getppid... yes
checking for getpwuid... yes
checking for getpwuid_r... yes
checking for getrlimit... yes
checking for gettimeofday... yes
checking for if_nametoindex... yes
checking for mach_absolute_time... no
checking for pipe... yes
checking for sched_yield... yes
checking for sendmsg... yes
checking for setlocale... yes
checking for setmode... no
checking for setrlimit... yes
checking for snprintf... yes
checking for utime... yes
checking for utimes... yes
checking for arc4random... no
checking for fseeko... yes
checking whether fseeko is declared... yes
checking how to set a socket into non-blocking mode... fcntl O_NONBLOCK
checking whether to enable the threaded resolver... yes
checking whether to link macOS CoreFoundation, CoreServices, and SystemConfiguration frameworks... no
checking whether to use POSIX threads for threaded resolver... auto
checking for pthread.h... yes
checking for pthread_create... yes
checking for dirent.h... yes
checking for opendir... yes
checking convert -I options to -isystem... yes
checking whether to enable verbose strings... yes
checking whether to enable SSPI support (Windows native builds only)... no
checking whether to enable basic authentication method... yes
checking whether to enable bearer authentication method... yes
checking whether to enable digest authentication method... yes
checking whether to enable kerberos authentication method... yes
checking whether to enable negotiate authentication method... yes
checking whether to enable aws sig methods... yes
checking whether to support NTLM... yes
checking whether to enable TLS-SRP authentication... yes
checking whether to enable Unix domain sockets... auto
checking for struct sockaddr_un.sun_path... yes
checking whether to support cookies... yes
checking whether to support socketpair... yes
checking whether to support HTTP authentication... yes
checking whether to support DoH... yes
checking whether to support the MIME API... yes
checking whether to support binding connections locally... yes
checking whether to support the form API... yes
checking whether to support date parsing... yes
checking whether to support netrc parsing... yes
checking whether to support progress-meter... yes
checking whether to support the SHA-512/256 hash algorithm... yes
checking whether to support DNS shuffling... yes
checking whether to support curl_easy_option*... yes
checking whether to support alt-svc... yes
checking whether to support headers-api... yes
configure: disables HSTS due to lack of SSL
checking whether to support WebSockets... no
checking whether hiding of library internal symbols will actually happen... yes
checking if this build supports HTTPS-proxy... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/examples/Makefile
config.status: creating docs/libcurl/Makefile
config.status: creating docs/libcurl/opts/Makefile
config.status: creating docs/cmdline-opts/Makefile
config.status: creating include/Makefile
config.status: creating include/curl/Makefile
config.status: creating src/Makefile
config.status: creating lib/Makefile
config.status: creating scripts/Makefile
config.status: creating lib/libcurl.vers
config.status: creating tests/Makefile
config.status: creating tests/config
config.status: creating tests/configurehelp.pm
config.status: creating tests/certs/Makefile
config.status: creating tests/certs/scripts/Makefile
config.status: creating tests/data/Makefile
config.status: creating tests/server/Makefile
config.status: creating tests/libtest/Makefile
config.status: creating tests/unit/Makefile
config.status: creating tests/http/config.ini
config.status: creating tests/http/Makefile
config.status: creating tests/http/clients/Makefile
config.status: creating packages/Makefile
config.status: creating packages/vms/Makefile
config.status: creating curl-config
config.status: creating libcurl.pc
config.status: creating lib/curl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: Configured to build curl/libcurl:
Host setup: x86_64-pc-linux-gnu
Install prefix: /usr/local
Compiler: ccache gcc
CFLAGS: -Werror-implicit-function-declaration -O2 -Wno-system-headers
CFLAGS extras:
CPPFLAGS:
LDFLAGS:
LIBS: -lpsl -lz
curl version: 8.10.2-DEV
SSL: no (--with-{openssl,gnutls,mbedtls,wolfssl,schannel,secure-transport,amissl,bearssl,rustls} )
SSH: no (--with-{libssh,libssh2})
zlib: enabled
brotli: no (--with-brotli)
zstd: no (--with-zstd)
GSS-API: no (--with-gssapi)
GSASL: no (libgsasl not found)
TLS-SRP: no (--enable-tls-srp)
resolver: POSIX threaded
IPv6: enabled
Unix sockets: enabled
IDN: no (--with-{libidn2,winidn})
Build docs: no
Build libcurl: Shared=no, Static=yes
Built-in manual: no (--enable-manual)
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
Code coverage: disabled
SSPI: no (--enable-sspi)
ca cert bundle: no
ca cert path:
ca fallback:
LDAP: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS: no (--enable-ldaps)
IPFS/IPNS: enabled
RTSP: enabled
RTMP: no (--with-librtmp)
PSL: enabled
Alt-svc: enabled (--disable-alt-svc)
Headers API: enabled (--disable-headers-api)
HSTS: no (--enable-hsts)
HTTP1: enabled (internal)
HTTP2: no (--with-nghttp2)
HTTP3: no (--with-ngtcp2 --with-nghttp3, --with-quiche, --with-openssl-quic, --with-msh3)
ECH: no (--enable-ech)
WebSockets: no (--enable-websockets)
Protocols: dict file ftp gopher http imap ipfs ipns mqtt pop3 rtsp smtp telnet tftp
Features: alt-svc AsynchDNS IPv6 Largefile libz PSL threadsafe UnixSockets
configure: WARNING: Cannot find libraries for LDAP support: LDAP disabled
configure: WARNING: libgsasl was not found
configure: WARNING: Cannot find libidn2
$ make -j3
Making all in lib
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make all-am
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
CC libcurl_la-altsvc.lo
CC libcurl_la-amigaos.lo
CC libcurl_la-asyn-ares.lo
CC libcurl_la-asyn-thread.lo
CC libcurl_la-base64.lo
CC libcurl_la-bufq.lo
CC libcurl_la-bufref.lo
CC libcurl_la-c-hyper.lo
CC libcurl_la-cf-h1-proxy.lo
CC libcurl_la-cf-h2-proxy.lo
CC libcurl_la-cf-haproxy.lo
CC libcurl_la-cf-https-connect.lo
CC libcurl_la-cf-socket.lo
CC libcurl_la-cfilters.lo
CC libcurl_la-conncache.lo
CC libcurl_la-connect.lo
CC libcurl_la-content_encoding.lo
CC libcurl_la-cookie.lo
CC libcurl_la-curl_addrinfo.lo
CC libcurl_la-curl_des.lo
CC libcurl_la-curl_endian.lo
CC libcurl_la-curl_fnmatch.lo
CC libcurl_la-curl_get_line.lo
CC libcurl_la-curl_gethostname.lo
CC libcurl_la-curl_gssapi.lo
CC libcurl_la-curl_memrchr.lo
CC libcurl_la-curl_multibyte.lo
CC libcurl_la-curl_ntlm_core.lo
CC libcurl_la-curl_path.lo
CC libcurl_la-curl_range.lo
CC libcurl_la-curl_rtmp.lo
CC libcurl_la-curl_sasl.lo
CC libcurl_la-curl_sha512_256.lo
CC libcurl_la-curl_sspi.lo
CC libcurl_la-curl_threads.lo
CC libcurl_la-curl_trc.lo
CC libcurl_la-cw-out.lo
CC libcurl_la-dict.lo
CC libcurl_la-dllmain.lo
CC libcurl_la-doh.lo
CC libcurl_la-dynbuf.lo
CC libcurl_la-dynhds.lo
CC libcurl_la-easy.lo
CC libcurl_la-easygetopt.lo
CC libcurl_la-easyoptions.lo
CC libcurl_la-escape.lo
CC libcurl_la-file.lo
CC libcurl_la-fileinfo.lo
CC libcurl_la-fopen.lo
CC libcurl_la-formdata.lo
CC libcurl_la-ftp.lo
CC libcurl_la-ftplistparser.lo
CC libcurl_la-getenv.lo
CC libcurl_la-getinfo.lo
CC libcurl_la-gopher.lo
CC libcurl_la-hash.lo
CC libcurl_la-headers.lo
CC libcurl_la-hmac.lo
CC libcurl_la-hostasyn.lo
CC libcurl_la-hostip.lo
CC libcurl_la-hostip4.lo
CC libcurl_la-hostip6.lo
CC libcurl_la-hostsyn.lo
CC libcurl_la-hsts.lo
CC libcurl_la-http.lo
CC libcurl_la-http1.lo
CC libcurl_la-http2.lo
CC libcurl_la-http_aws_sigv4.lo
CC libcurl_la-http_chunks.lo
CC libcurl_la-http_digest.lo
CC libcurl_la-http_negotiate.lo
CC libcurl_la-http_ntlm.lo
CC libcurl_la-http_proxy.lo
CC libcurl_la-idn.lo
CC libcurl_la-if2ip.lo
CC libcurl_la-imap.lo
CC libcurl_la-inet_ntop.lo
CC libcurl_la-inet_pton.lo
CC libcurl_la-krb5.lo
CC libcurl_la-ldap.lo
CC libcurl_la-llist.lo
CC libcurl_la-macos.lo
CC libcurl_la-md4.lo
CC libcurl_la-md5.lo
CC libcurl_la-memdebug.lo
CC libcurl_la-mime.lo
CC libcurl_la-mprintf.lo
CC libcurl_la-mqtt.lo
CC libcurl_la-multi.lo
CC libcurl_la-netrc.lo
CC libcurl_la-nonblock.lo
CC libcurl_la-noproxy.lo
CC libcurl_la-openldap.lo
CC libcurl_la-parsedate.lo
CC libcurl_la-pingpong.lo
CC libcurl_la-pop3.lo
CC libcurl_la-progress.lo
CC libcurl_la-psl.lo
CC libcurl_la-rand.lo
CC libcurl_la-rename.lo
CC libcurl_la-request.lo
CC libcurl_la-rtsp.lo
CC libcurl_la-select.lo
CC libcurl_la-sendf.lo
CC libcurl_la-setopt.lo
CC libcurl_la-sha256.lo
CC libcurl_la-share.lo
CC libcurl_la-slist.lo
CC libcurl_la-smb.lo
CC libcurl_la-smtp.lo
CC libcurl_la-socketpair.lo
CC libcurl_la-socks.lo
CC libcurl_la-socks_gssapi.lo
CC libcurl_la-socks_sspi.lo
CC libcurl_la-speedcheck.lo
CC libcurl_la-splay.lo
CC libcurl_la-strcase.lo
CC libcurl_la-strdup.lo
CC libcurl_la-strerror.lo
CC libcurl_la-strtok.lo
CC libcurl_la-strtoofft.lo
CC libcurl_la-system_win32.lo
CC libcurl_la-telnet.lo
CC libcurl_la-tftp.lo
CC libcurl_la-timediff.lo
CC libcurl_la-timeval.lo
CC libcurl_la-transfer.lo
CC libcurl_la-url.lo
CC libcurl_la-urlapi.lo
CC libcurl_la-version.lo
CC libcurl_la-version_win32.lo
CC libcurl_la-warnless.lo
CC libcurl_la-ws.lo
CC vauth/libcurl_la-cram.lo
CC vauth/libcurl_la-cleartext.lo
CC vauth/libcurl_la-digest.lo
CC vauth/libcurl_la-digest_sspi.lo
CC vauth/libcurl_la-gsasl.lo
CC vauth/libcurl_la-krb5_gssapi.lo
CC vauth/libcurl_la-krb5_sspi.lo
CC vauth/libcurl_la-ntlm.lo
CC vauth/libcurl_la-ntlm_sspi.lo
CC vauth/libcurl_la-oauth2.lo
CC vauth/libcurl_la-spnego_gssapi.lo
CC vauth/libcurl_la-spnego_sspi.lo
CC vauth/libcurl_la-vauth.lo
CC vtls/libcurl_la-bearssl.lo
CC vtls/libcurl_la-cipher_suite.lo
CC vtls/libcurl_la-gtls.lo
CC vtls/libcurl_la-hostcheck.lo
CC vtls/libcurl_la-keylog.lo
CC vtls/libcurl_la-mbedtls.lo
CC vtls/libcurl_la-mbedtls_threadlock.lo
CC vtls/libcurl_la-openssl.lo
CC vtls/libcurl_la-rustls.lo
CC vtls/libcurl_la-schannel.lo
CC vtls/libcurl_la-schannel_verify.lo
CC vtls/libcurl_la-sectransp.lo
CC vtls/libcurl_la-vtls.lo
CC vtls/libcurl_la-wolfssl.lo
CC vtls/libcurl_la-x509asn1.lo
CC vquic/libcurl_la-curl_msh3.lo
CC vquic/libcurl_la-curl_ngtcp2.lo
CC vquic/libcurl_la-curl_osslq.lo
CC vquic/libcurl_la-curl_quiche.lo
CC vquic/libcurl_la-vquic.lo
CC vquic/libcurl_la-vquic-tls.lo
CC vssh/libcurl_la-libssh.lo
CC vssh/libcurl_la-libssh2.lo
CC vssh/libcurl_la-wolfssh.lo
CCLD libcurl.la
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/lib'
Making all in docs
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in .
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
make[2]: Nothing to be done for 'all-am'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in cmdline-opts
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/cmdline-opts'
Making all in libcurl
make[2]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
Making all in opts
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl/opts'
make[3]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[2]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs/libcurl'
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/docs'
Making all in src
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/src'
CC terminal.o
CC slist_wc.o
CC tool_binmode.o
CC tool_cb_dbg.o
CC tool_bname.o
CC tool_cb_hdr.o
CC tool_cb_prg.o
CC tool_cb_rea.o
CC tool_cb_see.o
CC tool_cb_soc.o
CC tool_cb_wrt.o
CC tool_cfgable.o
CC tool_dirhie.o
CC tool_doswin.o
CC tool_easysrc.o
CC tool_filetime.o
CC tool_findfile.o
CC tool_formparse.o
CC tool_getparam.o
CC tool_getpass.o
CC tool_help.o
echo '#include "tool_hugehelp.h"' >> tool_hugehelp.c
CC tool_helpers.o
CC tool_ipfs.o
CC tool_libinfo.o
CC tool_listhelp.o
CC tool_main.o
CC tool_msgs.o
CC tool_operate.o
CC tool_operhlp.o
CC tool_paramhlp.o
CC tool_parsecfg.o
CC tool_progress.o
CC tool_setopt.o
CC tool_sleep.o
CC tool_stderr.o
CC tool_strdup.o
CC tool_urlglob.o
CC tool_util.o
CC tool_vms.o
CC tool_writeout.o
CC tool_writeout_json.o
CC tool_xattr.o
CC var.o
echo 'extern const void *curl_ca_embed; const void *curl_ca_embed;' > tool_ca_embed.c
CC tool_hugehelp.o
CC tool_ca_embed.o
CC ../lib/base64.o
CC ../lib/curl_multibyte.o
CC ../lib/dynbuf.o
CC ../lib/nonblock.o
CC ../lib/strtoofft.o
CC ../lib/timediff.o
CC ../lib/version_win32.o
CC ../lib/warnless.o
CCLD curl
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/src'
Making all in scripts
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0/scripts'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0/scripts'
make[1]: Entering directory '/root/asi_db/builds/curl/_worktrees/w0'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/root/asi_db/builds/curl/_worktrees/w0'
| @@ -33,7 +33,7 @@ commands: | |
| - run: | |
| command: | | |
| autoreconf -fi | |
| - | ./configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror --with-openssl \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror --with-openssl \ |
| || { tail -1000 config.log; false; } | |
| configure-openssl-no-verbose: | |
| @@ -41,7 +41,7 @@ commands: | |
| - run: | |
| command: | | |
| autoreconf -fi | |
| - | ./configure --disable-dependency-tracking --enable-unity --disable-verbose --enable-werror --with-openssl \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --disable-verbose --enable-werror --with-openssl \ |
| || { tail -1000 config.log; false; } | |
| configure-no-proxy: | |
| @@ -49,7 +49,7 @@ commands: | |
| - run: | |
| command: | | |
| autoreconf -fi | |
| - | ./configure --disable-dependency-tracking --enable-unity --disable-proxy --enable-werror --with-openssl \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --disable-proxy --enable-werror --with-openssl \ |
| || { tail -1000 config.log; false; } | |
| install-cares: | |
| @@ -110,7 +110,7 @@ commands: | |
| - run: | |
| command: | | |
| autoreconf -fi | |
| - | ./configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror --with-openssl --enable-ares \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror --with-openssl --enable-ares \ |
| || { tail -1000 config.log; false; } | |
| configure-wolfssh: | |
| @@ -118,7 +118,7 @@ commands: | |
| - run: | |
| command: | | |
| autoreconf -fi | |
| - | LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" ./configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror --with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh \ |
| + | LDFLAGS="-Wl,-rpath,$HOME/wssh/lib" ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror --with-wolfssl=$HOME/wssl --with-wolfssh=$HOME/wssh \ |
| || { tail -1000 config.log; false; } | |
| configure-cares-debug: | |
| @@ -126,7 +126,7 @@ commands: | |
| - run: | |
| command: | | |
| autoreconf -fi | |
| - | ./configure --disable-dependency-tracking --enable-unity --enable-debug --enable-werror --with-openssl --enable-ares \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-debug --enable-werror --with-openssl --enable-ares \ |
| || { tail -1000 config.log; false; } | |
| build: | |
| @@ -142,7 +142,9 @@ jobs: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
| - | - run: cmake -Bbuild -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DOPENSSL_ROOT_DIR=$HOME/awslc -DBUILD_SHARED_LIBS=ON . |
| + | - run: | |
| + | cmake -B build -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ |
| + | -DOPENSSL_ROOT_DIR=$HOME/awslc -DBUILD_SHARED_LIBS=ON |
| name: 'cmake generate out-of-tree' | |
| - run: cmake --build build --parallel | |
| @@ -150,3 +152,6 @@ jobs: | |
| - run: cmake --install build --prefix $HOME/curl --strip | |
| name: 'cmake install' | |
| + | |
| + | - run: cmake --build build --parallel --target testdeps |
| + | name: 'cmake build tests' |
| @@ -81,7 +81,7 @@ jobs: | |
| timeout-minutes: 5 | |
| run: | | |
| PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| --prefix="${HOME}"/install \ | |
| --enable-websockets \ | |
| --with-openssl \ | |
| @@ -139,7 +139,7 @@ jobs: | |
| run: | | |
| PATH="/usr/bin:$(cygpath "${SYSTEMROOT}")/System32" | |
| cmake -B bld -G Ninja ${options} \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| -DCURL_BROTLI=ON \ | |
| @@ -451,7 +451,7 @@ jobs: | |
| - run: autoreconf -fi | |
| name: 'autoreconf' | |
| - | - run: ./configure --disable-dependency-tracking --enable-unity ${{ matrix.build.configure }} |
| + | - run: ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles ${{ matrix.build.configure }} |
| name: 'configure' | |
| - run: make V=1 | |
| @@ -79,7 +79,7 @@ jobs: | |
| run: | | |
| mkdir bld-1 | |
| cd bld-1 | |
| - | cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ |
| + | cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ |
| -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON -DENABLE_WEBSOCKETS=ON | |
| make install | |
| src/curl --disable --version | |
| @@ -88,7 +88,7 @@ jobs: | |
| run: | | |
| mkdir bld-cares | |
| cd bld-cares | |
| - | cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ |
| + | cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \ |
| -DENABLE_ARES=ON -DCURL_ZSTD=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_LIBRTMP=ON -DENABLE_WEBSOCKETS=ON \ | |
| -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON | |
| @@ -113,7 +113,7 @@ jobs: | |
| run: | | |
| mkdir bld-am | |
| cd bld-am | |
| - | ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \ |
| + | ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| --with-openssl --enable-ares --with-libssh --with-zstd --with-gssapi --with-librtmp --enable-websockets \ | |
| --prefix="$PWD"/../install-am | |
| @@ -498,7 +498,7 @@ jobs: | |
| - run: | | |
| ${{ matrix.build.configure-prefix }} \ | |
| - | ./configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| ${{ matrix.build.configure }} | |
| if: ${{ matrix.build.configure }} | |
| name: 'configure (autotools)' | |
| @@ -70,7 +70,7 @@ jobs: | |
| name: 'autoreconf' | |
| - run: | | |
| - | ./configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \ |
| + | ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| ${{ matrix.build.configure }} | |
| name: 'configure' | |
| @@ -193,7 +193,7 @@ jobs: | |
| options+=" --with-sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" | |
| CFLAGS+=" --sysroot=$(xcrun --sdk macosx --show-sdk-path 2>/dev/null)" | |
| fi | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| --disable-dependency-tracking \ | |
| --with-libpsl=$(brew --prefix libpsl) \ | |
| ${{ matrix.configure }} ${options} | |
| @@ -343,7 +343,7 @@ jobs: | |
| fi | |
| done | |
| fi | |
| - | cmake -B bld -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \ |
| + | cmake -B bld -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ |
| -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.build.macos-version-min }} \ | |
| "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ | |
| ${{ matrix.build.generate }} | |
| @@ -608,7 +608,7 @@ jobs: | |
| [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' --with-secure-transport' | |
| CFLAGS+=' -mmacosx-version-min=${{ matrix.macos-version-min }}' | |
| # would pick up nghttp2, libidn2, but libssh2 is disabled by default | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| --disable-dependency-tracking \ | |
| --disable-docs --disable-manual \ | |
| --without-nghttp2 --without-libidn2 \ | |
| @@ -618,7 +618,7 @@ jobs: | |
| [ '${{ matrix.config }}' = 'OpenSSL' ] && options+=' -DCURL_USE_OPENSSL=ON' | |
| [ '${{ matrix.config }}' = 'SecureTransport' ] && options+=' -DCURL_USE_SECTRANSP=ON' | |
| # would pick up nghttp2, libidn2, and libssh2 | |
| - | cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \ |
| + | cmake -B bld -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ |
| -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ matrix.macos-version-min }} \ | |
| "-DCMAKE_IGNORE_PREFIX_PATH=$(brew --prefix)" \ | |
| "-DCMAKE_C_COMPILER_TARGET=$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \ | |
| @@ -55,7 +55,7 @@ jobs: | |
| # https://pkgsrc.se/ | |
| sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket | |
| cmake -B bld -G Ninja \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| @@ -64,8 +64,8 @@ jobs: | |
| || { cat bld/CMakeFiles/CMake*.yaml; false; } | |
| cmake --build bld --config Debug --parallel 3 | |
| bld/src/curl --disable --version | |
| + | cmake --build bld --config Debug --parallel 3 --target testdeps |
| if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU | |
| - | cmake --build bld --config Debug --parallel 3 --target testdeps |
| export TFLAGS='-j0' # flakies: ~389 ~392 ~TFTP and more | |
| cmake --build bld --config Debug --target test-ci | |
| fi | |
| @@ -92,7 +92,7 @@ jobs: | |
| # https://openbsd.app/ | |
| sudo pkg_add cmake ninja perl brotli openldap-client libssh2 libidn2 libpsl nghttp2 python3 py3-impacket | |
| cmake -B bld -G Ninja \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| @@ -101,8 +101,8 @@ jobs: | |
| || { cat bld/CMakeFiles/CMake*.yaml; false; } | |
| cmake --build bld --config Debug --parallel 3 | |
| bld/src/curl --disable --version | |
| + | cmake --build bld --config Debug --parallel 3 --target testdeps |
| if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU | |
| - | cmake --build bld --config Debug --parallel 3 --target testdeps |
| export TFLAGS='-j8 ~3017 ~TFTP ~FTP' # FIXME: TFTP requests executed twice? Related: `curl: (69) TFTP: Access Violation`? | |
| cmake --build bld --config Debug --target test-ci | |
| fi | |
| @@ -136,7 +136,7 @@ jobs: | |
| pkgconf brotli openldap26-client libidn2 libnghttp2 nghttp2 stunnel py311-impacket | |
| autoreconf -fi | |
| export CC='${{ matrix.compiler }}' | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \ |
| --prefix="${HOME}"/install \ | |
| --enable-websockets \ | |
| --with-openssl \ | |
| @@ -144,8 +144,8 @@ jobs: | |
| --disable-dependency-tracking || { tail -n 1000 config.log; false; } | |
| make -j3 install | |
| src/curl --disable --version | |
| + | make -j3 -C tests |
| if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU | |
| - | make -j3 -C tests |
| make test-ci V=1 TFLAGS='-j8 ~FTP' | |
| fi | |
| echo '::group::build examples' | |
| @@ -165,7 +165,7 @@ jobs: | |
| pkgconf brotli openldap26-client libidn2 libnghttp2 nghttp2 stunnel py311-impacket | |
| cmake -B bld -G Ninja \ | |
| '-DCMAKE_C_COMPILER=${{ matrix.compiler }}' \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| @@ -174,8 +174,8 @@ jobs: | |
| || { cat bld/CMakeFiles/CMake*.yaml; false; } | |
| cmake --build bld --config Debug --parallel 3 | |
| bld/src/curl --disable --version | |
| + | cmake --build bld --config Debug --parallel 3 --target testdeps |
| if [ '${{ matrix.arch }}' = 'x86_64' ]; then # Slow on emulated CPU | |
| - | cmake --build bld --config Debug --parallel 3 --target testdeps |
| export TFLAGS='-j8 ~FTP' | |
| cmake --build bld --config Debug --target test-ci | |
| fi | |
| @@ -198,7 +198,7 @@ jobs: | |
| run: | | |
| ln -s /usr/bin/gcpp /usr/bin/cpp # Some tests expect `cpp`, which is named `gcpp` in this env. | |
| autoreconf -fi | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \ |
| --prefix="${HOME}"/install \ | |
| --enable-websockets \ | |
| --with-openssl \ | |
| @@ -69,7 +69,7 @@ jobs: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
| - run: | | |
| - | cmake -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \ |
| + | cmake -G Ninja -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \ |
| -DCURL_BROTLI=ON -DCURL_ZSTD=ON \ | |
| ${{ matrix.build.generate }} | |
| name: 'cmake configure' | |
| @@ -103,7 +103,7 @@ jobs: | |
| if: ${{ matrix.build == 'autotools' }} | |
| timeout-minutes: 5 | |
| run: | | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| --prefix="${HOME}"/install \ | |
| --enable-websockets \ | |
| --with-openssl \ | |
| @@ -196,7 +196,7 @@ jobs: | |
| "-DCMAKE_C_FLAGS=${cflags}" \ | |
| "-DCMAKE_RC_COMPILE_OBJECT=${rcopts}" \ | |
| '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| -DCURL_BROTLI=ON \ | |
| @@ -329,7 +329,7 @@ jobs: | |
| '-GMSYS Makefiles' \ | |
| -DCMAKE_C_COMPILER=gcc \ | |
| '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| -DCURL_USE_LIBPSL=OFF \ | |
| @@ -415,7 +415,7 @@ jobs: | |
| - name: 'autotools configure' | |
| if: ${{ matrix.build == 'autotools' }} | |
| run: | | |
| - | mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \ |
| + | mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ |
| --host=${TRIPLET} \ | |
| --with-schannel --with-winidn \ | |
| --without-libpsl \ | |
| @@ -429,6 +429,10 @@ jobs: | |
| if: ${{ matrix.build == 'autotools' }} | |
| run: make -C bld -j5 | |
| + | - name: 'autotools build tests' |
| + | if: ${{ matrix.build == 'autotools' }} |
| + | run: make -C bld -j5 -C tests |
| + | |
| - name: 'autotools build examples' | |
| if: ${{ matrix.build == 'autotools' }} | |
| run: make -C bld -j5 examples | |
| @@ -440,7 +444,7 @@ jobs: | |
| -DCMAKE_SYSTEM_NAME=Windows \ | |
| -DCMAKE_C_COMPILER_TARGET=${TRIPLET} \ | |
| -DCMAKE_C_COMPILER=${TRIPLET}-gcc \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \ | |
| -DCURL_USE_LIBPSL=OFF | |
| @@ -453,6 +457,10 @@ jobs: | |
| if: ${{ matrix.build == 'cmake' }} | |
| run: cmake --build bld --parallel 5 | |
| + | - name: 'cmake build tests' |
| + | if: ${{ matrix.build == 'cmake' }} |
| + | run: cmake --build bld --parallel 5 --target testdeps |
| + | |
| - name: 'cmake build examples' | |
| if: ${{ matrix.build == 'cmake' }} | |
| run: cmake --build bld --parallel 5 --target curl-examples | |
| @@ -565,7 +573,7 @@ jobs: | |
| '-DVCPKG_TARGET_TRIPLET=${{ matrix.arch }}-${{ matrix.plat }}' \ | |
| -DCMAKE_VS_GLOBALS=TrackFileAccess=false \ | |
| '-DCMAKE_BUILD_TYPE=${{ matrix.type }}' \ | |
| - | -DCMAKE_UNITY_BUILD=ON \ |
| + | -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ |
| -DCURL_WERROR=ON \ | |
| -DENABLE_WEBSOCKETS=ON \ | |
| -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG= \ | |
| @@ -84,7 +84,7 @@ jobs: | |
| - run: autoreconf -fi | |
| name: 'autoreconf' | |
| - | - run: ./configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror ${{ matrix.build.configure }} |
| + | - run: ./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror ${{ matrix.build.configure }} |
| name: 'configure' | |
| - run: make V=1 | |
| @@ -56,6 +56,7 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then | |
| "-DBUILD_SHARED_LIBS=${SHARED}" \ | |
| "-DENABLE_WEBSOCKETS=${WEBSOCKETS:-}" \ | |
| "-DCMAKE_UNITY_BUILD=${UNITY}" \ | |
| + | '-DCURL_TEST_BUNDLES=ON' \ |
| '-DCURL_WERROR=ON' \ | |
| "-DENABLE_DEBUG=${DEBUG}" \ | |
| "-DENABLE_UNICODE=${ENABLE_UNICODE}" \ | |
| @@ -35,13 +35,13 @@ environment: | |
| OPENSSL: 'OFF' | |
| DEBUG: 'ON' | |
| SHARED: 'OFF' | |
| - | TFLAGS: 'skipall' |
| + | TFLAGS: 'skiprun' |
| EXAMPLES: 'OFF' | |
| matrix: | |
| # generated CMake-based Visual Studio builds | |
| - | - job_name: 'CMake, VS2008, Release, x86, Schannel, Build-only' |
| + | - job_name: 'CMake, VS2008, Release, x86, Schannel, Build-tests' |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' | |
| BUILD_SYSTEM: CMake | |
| PRJ_GEN: 'Visual Studio 9 2008' | |
| @@ -60,9 +60,8 @@ environment: | |
| ENABLE_UNICODE: 'OFF' | |
| HTTP_ONLY: 'OFF' | |
| SHARED: 'ON' | |
| - | TFLAGS: 'skiprun' |
| EXAMPLES: 'ON' | |
| - | - job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.2, WebSockets, Build-only' |
| + | - job_name: 'CMake, VS2022, Release, x64, OpenSSL 3.2, WebSockets, Build-tests' |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' | |
| BUILD_SYSTEM: CMake | |
| PRJ_GEN: 'Visual Studio 17 2022' | |
| @@ -85,7 +84,6 @@ environment: | |
| HTTP_ONLY: 'OFF' | |
| DEBUG: 'OFF' | |
| CURLDEBUG: 'ON' | |
| - | TFLAGS: 'skiprun' |
| - job_name: 'CMake, VS2010, Debug, x64, Schannel, Static, Build-tests & examples' | |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2015' | |
| BUILD_SYSTEM: CMake | |
| @@ -94,9 +92,8 @@ environment: | |
| SCHANNEL: 'ON' | |
| ENABLE_UNICODE: 'OFF' | |
| HTTP_ONLY: 'OFF' | |
| - | TFLAGS: 'skiprun' |
| EXAMPLES: 'ON' | |
| - | - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-only' |
| + | - job_name: 'CMake, VS2022, Debug, x64, Schannel, Static, Unicode, Build-tests' |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' | |
| BUILD_SYSTEM: CMake | |
| PRJ_GEN: 'Visual Studio 17 2022' | |
| @@ -105,7 +102,7 @@ environment: | |
| SCHANNEL: 'ON' | |
| ENABLE_UNICODE: 'ON' | |
| HTTP_ONLY: 'OFF' | |
| - | - job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBULID, no-CURLDEBUG, Build-only' |
| + | - job_name: 'CMake, VS2022, Release, x64, Schannel, Shared, Unicode, DEBUGBULID, no-CURLDEBUG, Build-tests' |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' | |
| BUILD_SYSTEM: CMake | |
| PRJ_GEN: 'Visual Studio 17 2022' | |
| @@ -116,7 +113,7 @@ environment: | |
| HTTP_ONLY: 'OFF' | |
| SHARED: 'ON' | |
| CURLDEBUG: 'OFF' | |
| - | - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-only' |
| + | - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, Build-tests' |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' | |
| BUILD_SYSTEM: CMake | |
| PRJ_GEN: 'Visual Studio 17 2022' | |
| @@ -125,7 +122,7 @@ environment: | |
| SCHANNEL: 'OFF' | |
| ENABLE_UNICODE: 'OFF' | |
| HTTP_ONLY: 'OFF' | |
| - | - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-only' |
| + | - job_name: 'CMake, VS2022, Debug, x64, no SSL, Static, HTTP only, Build-tests' |
| APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' | |
| BUILD_SYSTEM: CMake | |
| PRJ_GEN: 'Visual Studio 17 2022' | |
| @@ -629,6 +629,29 @@ AS_HELP_STRING([--disable-unity],[Disable unity (default)]), | |
| AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes']) | |
| + | dnl ----------------------- |
| + | dnl whether to bundle tests |
| + | dnl ----------------------- |
| + | |
| + | want_test_bundles='no' |
| + | AC_MSG_CHECKING([whether to build tests into single-binary bundles]) |
| + | AC_ARG_ENABLE(test-bundles, |
| + | AS_HELP_STRING([--enable-test-bundles],[Enable test bundles]) |
| + | AS_HELP_STRING([--disable-test-bundles],[Disable test bundles (default)]), |
| + | [ case "$enableval" in |
| + | yes) |
| + | want_test_bundles='yes' |
| + | AC_MSG_RESULT([yes]) |
| + | ;; |
| + | *) |
| + | AC_MSG_RESULT([no]) |
| + | ;; |
| + | esac ], |
| + | AC_MSG_RESULT([no]) |
| + | ) |
| + | |
| + | AM_CONDITIONAL([USE_TEST_BUNDLES], [test "$want_test_bundles" = 'yes']) |
| + | |
| dnl ************************************************************ | |
| dnl switch off particular protocols | |
| dnl | |
| @@ -21,6 +21,8 @@ | |
| # SPDX-License-Identifier: curl | |
| # | |
| ########################################################################### | |
| + | option(CURL_TEST_BUNDLES "Bundle libtests/unittests into single binaries" OFF) |
| + | |
| find_program(TEST_NGHTTPX "nghttpx") | |
| if(NOT TEST_NGHTTPX) | |
| set(TEST_NGHTTPX "nghttpx") | |
| @@ -38,6 +40,9 @@ add_subdirectory(unit) | |
| add_subdirectory(certs EXCLUDE_FROM_ALL) | |
| function(add_runtests _targetname _test_flags) | |
| + | if(CURL_TEST_BUNDLES) |
| + | set(_test_flags "${_test_flags} -bundle") |
| + | endif() |
| # Use a special '$TFLAGS' placeholder as last argument which will be | |
| # replaced by the contents of the environment variable in runtests.pl. | |
| # This is a workaround for CMake's limitation where commands executed by | |
| @@ -71,6 +71,8 @@ EXTRA_DIST = \ | |
| http2-server.pl \ | |
| http3-server.pl \ | |
| memanalyze.pl \ | |
| + | mk-bundle-hints.sh \ |
| + | mk-bundle.pl \ |
| negtelnetserver.py \ | |
| nghttpx.conf \ | |
| pathhelp.pm \ | |
| @@ -116,10 +118,16 @@ CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES) | |
| curl: | |
| @cd $(top_builddir) && $(MAKE) | |
| + | TEST_COMMON = |
| + | |
| if CROSSCOMPILING | |
| TEST = @echo "NOTICE: we can't run the tests when cross-compiling!" | |
| else # if not cross-compiling: | |
| - | TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl |
| + | if USE_TEST_BUNDLES |
| + | TEST_COMMON += -bundle |
| + | endif |
| + | |
| + | TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl $(TEST_COMMON) |
| TEST_Q = -a -s | |
| TEST_AM = -a -am | |
| TEST_F = -a -p -r | |
| @@ -65,6 +65,7 @@ BEGIN { | |
| %feature | |
| %keywords | |
| @protocols | |
| + | $bundle |
| ); | |
| } | |
| use pathhelp qw(exe_ext); | |
| @@ -102,6 +103,7 @@ our $VCURL=$CURL; # what curl binary to use to verify the servers with | |
| # the path to the script that analyzes the memory debug output file | |
| our $memanalyze="$perl $srcdir/memanalyze.pl"; | |
| our $valgrind; # path to valgrind, or empty if disabled | |
| + | our $bundle = 0; # use bundled server, libtest, unit binaries |
| # paths in $LOGDIR | |
| our $LOCKDIR = "lock"; # root of the server directory with lock files | |
| @@ -5,6 +5,7 @@ | |
| lib[1234][0-9][0-9][0-9] | |
| lib[56][0-9][0-9] | |
| lib1521.c | |
| + | libtests.c |
| libauthretry | |
| libntlmconnect | |
| libprereq | |
| @@ -22,13 +22,39 @@ | |
| # | |
| ########################################################################### | |
| - | # Get 'noinst_PROGRAMS', '*_SOURCES', WARNLESS, MULTIBYTE, TIMEDIFF variables |
| + | # Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'TIMEDIFF', 'THREADS', 'FIRSTFILES' variables |
| transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| set_source_files_properties("../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) | |
| - | foreach(_target IN LISTS noinst_PROGRAMS) |
| + | add_custom_command( |
| + | OUTPUT "lib1521.c" |
| + | COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" < "${CURL_SOURCE_DIR}/include/curl/curl.h" > "lib1521.c" |
| + | DEPENDS |
| + | "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" |
| + | "${CURL_SOURCE_DIR}/include/curl/curl.h" |
| + | VERBATIM) |
| + | |
| + | if(CURL_TEST_BUNDLES) |
| + | add_custom_command( |
| + | OUTPUT "libtest_bundle.c" |
| + | COMMAND ${PERL_EXECUTABLE} "${CURL_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "libtest_bundle.c" |
| + | DEPENDS |
| + | "${CURL_SOURCE_DIR}/tests/mk-bundle.pl" ${FIRSTFILES} "lib1521.c" |
| + | "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" |
| + | VERBATIM) |
| + | |
| + | set(LIBTESTPROGS "libtests") |
| + | set(libtests_SOURCES "libtest_bundle.c") |
| + | list(APPEND libtests_SOURCES ${TESTUTIL} ${TSTTRACE}) |
| + | if(LIB_SELECTED STREQUAL LIB_SHARED) |
| + | # These are part of the libcurl static lib. Add them here when linking shared. |
| + | list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${TIMEDIFF} ${THREADS}) |
| + | endif() |
| + | endif() |
| + | |
| + | foreach(_target IN LISTS LIBTESTPROGS) |
| if(DEFINED ${_target}_SOURCES) | |
| set(_sources ${${_target}_SOURCES}) | |
| else() | |
| @@ -50,16 +76,11 @@ foreach(_target IN LISTS noinst_PROGRAMS) | |
| "${CURL_SOURCE_DIR}/lib" # for "curl_setup.h" | |
| "${CURL_SOURCE_DIR}/tests/libtest" # to be able to build generated tests | |
| ) | |
| + | if(NOT CURL_TEST_BUNDLES) |
| + | set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS ${_upper_target}) |
| + | endif() |
| + | set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_NO_GETADDRINFO_OVERRIDE") |
| set_target_properties(${_target_name} PROPERTIES | |
| - | COMPILE_DEFINITIONS ${_upper_target} |
| OUTPUT_NAME "${_target}" | |
| PROJECT_LABEL "Test libtest ${_target}") | |
| endforeach() | |
| - | |
| - | add_custom_command( |
| - | OUTPUT "lib1521.c" |
| - | COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" < "${CURL_SOURCE_DIR}/include/curl/curl.h" > "lib1521.c" |
| - | DEPENDS |
| - | "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" |
| - | "${CURL_SOURCE_DIR}/include/curl/curl.h" |
| - | VERBATIM) |
| @@ -34,7 +34,8 @@ AUTOMAKE_OPTIONS = foreign nostdinc | |
| AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| - | -I$(top_srcdir)/lib |
| + | -I$(top_srcdir)/lib \ |
| + | -I$(top_srcdir)/tests/libtest |
| EXTRA_DIST = test307.pl test610.pl test613.pl test1013.pl test1022.pl \ | |
| notexists.pl CMakeLists.txt mk-lib1521.pl .checksrc | |
| @@ -55,7 +56,7 @@ TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@ | |
| LDADD = $(SUPPORTFILES_LIBS) | |
| # Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES, | |
| - | # noinst_PROGRAMS, lib*_SOURCES, and lib*_CFLAGS) |
| + | # LIBTESTPROGS, lib*_SOURCES, and lib*_CFLAGS) |
| include Makefile.inc | |
| noinst_LTLIBRARIES = | |
| @@ -87,6 +88,26 @@ libstubgss_la_LIBADD = | |
| libstubgss_la_DEPENDENCIES = | |
| endif | |
| + | if USE_TEST_BUNDLES |
| + | AM_CPPFLAGS += -DCURL_NO_GETADDRINFO_OVERRIDE |
| + | |
| + | libtest_bundle.c: $(top_srcdir)/tests/mk-bundle.pl lib1521.c |
| + | @PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > libtest_bundle.c |
| + | |
| + | noinst_PROGRAMS = libtests |
| + | nodist_libtests_SOURCES = libtest_bundle.c |
| + | libtests_SOURCES = $(TESTUTIL) $(TSTTRACE) |
| + | libtests_LDADD = $(TESTUTIL_LIBS) |
| + | CLEANFILES += libtest_bundle.c |
| + | |
| + | if USE_CPPFLAG_CURL_STATICLIB |
| + | else |
| + | # These are part of the libcurl static lib. Add them here when linking shared. |
| + | libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(TIMEDIFF) $(THREADS) |
| + | endif |
| + | else |
| + | noinst_PROGRAMS = $(LIBTESTPROGS) |
| + | endif |
| lib1521.c: $(top_srcdir)/tests/libtest/mk-lib1521.pl $(top_srcdir)/include/curl/curl.h | |
| @PERL@ $(top_srcdir)/tests/libtest/mk-lib1521.pl < $(top_srcdir)/include/curl/curl.h > lib1521.c | |
| @@ -35,12 +35,13 @@ MULTIBYTE = ../../lib/curl_multibyte.c ../../lib/curl_multibyte.h | |
| # these files are used in every single test program below | |
| TIMEDIFF = ../../lib/timediff.c ../../lib/timediff.h | |
| - | SUPPORTFILES = $(TIMEDIFF) first.c test.h |
| + | FIRSTFILES = first.c first.h |
| + | SUPPORTFILES = $(TIMEDIFF) $(FIRSTFILES) test.h |
| THREADS = ../../lib/curl_threads.c ../../lib/curl_threads.h | |
| # These are all libcurl test programs | |
| - | noinst_PROGRAMS = libauthretry libntlmconnect libprereq \ |
| + | LIBTESTPROGS = libauthretry libntlmconnect libprereq \ |
| lib500 lib501 lib502 lib503 lib504 lib505 lib506 lib507 lib508 lib509 \ | |
| lib510 lib511 lib512 lib513 lib514 lib515 lib516 lib517 lib518 lib519 \ | |
| lib520 lib521 lib523 lib524 lib525 lib526 lib527 lib529 lib530 lib532 \ | |
| @@ -22,6 +22,7 @@ | |
| * | |
| ***************************************************************************/ | |
| #include "test.h" | |
| + | #include "first.h" |
| #ifdef HAVE_LOCALE_H | |
| # include <locale.h> /* for setlocale() */ | |
| @@ -137,6 +138,8 @@ int main(int argc, char **argv) | |
| { | |
| char *URL; | |
| CURLcode result; | |
| + | int basearg; |
| + | test_func_t test_func; |
| #ifdef O_BINARY | |
| # ifdef __HIGHC__ | |
| @@ -157,25 +160,64 @@ int main(int argc, char **argv) | |
| setlocale(LC_ALL, ""); | |
| #endif | |
| - | if(argc < 2) { |
| + | test_argc = argc; |
| + | test_argv = argv; |
| + | |
| + | #ifdef CURLTESTS_BUNDLED |
| + | { |
| + | char *test_name; |
| + | |
| + | --test_argc; |
| + | ++test_argv; |
| + | |
| + | basearg = 2; |
| + | |
| + | if(argc < (basearg + 1)) { |
| + | fprintf(stderr, "Pass testname and URL as arguments please\n"); |
| + | return 1; |
| + | } |
| + | |
| + | test_name = argv[basearg - 1]; |
| + | test_func = NULL; |
| + | { |
| + | size_t tmp; |
| + | for(tmp = 0; tmp < (sizeof(s_tests)/sizeof((s_tests)[0])); ++tmp) { |
| + | if(strcmp(test_name, s_tests[tmp].name) == 0) { |
| + | test_func = s_tests[tmp].ptr; |
| + | break; |
| + | } |
| + | } |
| + | } |
| + | |
| + | if(!test_func) { |
| + | fprintf(stderr, "Test '%s' not found.\n", test_name); |
| + | return 1; |
| + | } |
| + | |
| + | fprintf(stderr, "Test: %s\n", test_name); |
| + | } |
| + | #else |
| + | basearg = 1; |
| + | |
| + | if(argc < (basearg + 1)) { |
| fprintf(stderr, "Pass URL as argument please\n"); | |
| return 1; | |
| } | |
| - | test_argc = argc; |
| - | test_argv = argv; |
| + | test_func = test; |
| + | #endif |
| - | if(argc > 2) |
| - | libtest_arg2 = argv[2]; |
| + | if(argc > (basearg + 1)) |
| + | libtest_arg2 = argv[basearg + 1]; |
| - | if(argc > 3) |
| - | libtest_arg3 = argv[3]; |
| + | if(argc > (basearg + 2)) |
| + | libtest_arg3 = argv[basearg + 2]; |
| - | URL = argv[1]; /* provide this to the rest */ |
| + | URL = argv[basearg]; /* provide this to the rest */ |
| fprintf(stderr, "URL: %s\n", URL); | |
| - | result = test(URL); |
| + | result = test_func(URL); |
| fprintf(stderr, "Test ended with result %d\n", result); | |
| #ifdef _WIN32 | |
| @@ -0,0 +1,38 @@ | |
| + | #ifndef HEADER_LIBTEST_FIRST_H |
| + | #define HEADER_LIBTEST_FIRST_H |
| + | /*************************************************************************** |
| + | * _ _ ____ _ |
| + | * Project ___| | | | _ \| | |
| + | * / __| | | | |_) | | |
| + | * | (__| |_| | _ <| |___ |
| + | * \___|\___/|_| \_\_____| |
| + | * |
| + | * Copyright (C) Daniel Stenberg, <[email protected]>, et al. |
| + | * |
| + | * This software is licensed as described in the file COPYING, which |
| + | * you should have received as part of this distribution. The terms |
| + | * are also available at https://curl.se/docs/copyright.html. |
| + | * |
| + | * You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| + | * copies of the Software, and permit persons to whom the Software is |
| + | * furnished to do so, under the terms of the COPYING file. |
| + | * |
| + | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| + | * KIND, either express or implied. |
| + | * |
| + | * SPDX-License-Identifier: curl |
| + | * |
| + | ***************************************************************************/ |
| + | #include "curl_setup.h" |
| + | #include <curl/curl.h> |
| + | |
| + | typedef CURLcode (*test_func_t)(char *); |
| + | |
| + | #ifdef CURLTESTS_BUNDLED |
| + | struct onetest { |
| + | const char *name; |
| + | test_func_t ptr; |
| + | }; |
| + | #endif |
| + | |
| + | #endif /* HEADER_LIBTEST_FIRST_H */ |
| @@ -47,7 +47,7 @@ struct testparams { | |
| CURLcode result; /* Code that should be returned by curl_easy_perform(). */ | |
| }; | |
| - | static const struct testparams params[] = { |
| + | static const struct testparams testparams[] = { |
| { 0, CURLE_OK }, | |
| { F_CONTENTRANGE, CURLE_OK }, | |
| { F_FAIL, CURLE_OK }, | |
| @@ -143,7 +143,7 @@ CURLcode test(char *URL) | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| - | for(i = 0; i < sizeof(params) / sizeof(params[0]); i++) { |
| + | for(i = 0; i < sizeof(testparams) / sizeof(testparams[0]); i++) { |
| curl = curl_easy_init(); | |
| if(!curl) { | |
| fprintf(stderr, "curl_easy_init() failed\n"); | |
| @@ -156,7 +156,7 @@ CURLcode test(char *URL) | |
| #ifdef SINGLETEST | |
| if(SINGLETEST == i) | |
| #endif | |
| - | status |= onetest(curl, URL, params + i, i); |
| + | status |= onetest(curl, URL, testparams + i, i); |
| curl_easy_cleanup(curl); | |
| } | |
| @@ -30,7 +30,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]="dummy"; |
| + | static char testdata[]="dummy"; |
| struct WriteThis { | |
| char *readptr; | |
| @@ -59,7 +59,7 @@ CURLcode test(char *URL) | |
| CURL *curl; | |
| CURLcode result = CURLE_OK; | |
| CURLcode res = CURLE_OK; | |
| - | struct WriteThis pooh = { data, sizeof(data)-1 }; |
| + | struct WriteThis pooh = { testdata, sizeof(testdata)-1 }; |
| global_init(CURL_GLOBAL_ALL); | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]="this is what we post to the silly web server\n"; |
| + | static char testdata[]="this is what we post to the silly web server\n"; |
| struct WriteThis { | |
| char *readptr; | |
| @@ -70,8 +70,8 @@ CURLcode test(char *URL) | |
| #endif | |
| } | |
| - | pooh.readptr = data; |
| - | pooh.sizeleft = strlen(data); |
| + | pooh.readptr = testdata; |
| + | pooh.sizeleft = strlen(testdata); |
| if(curl_global_init(CURL_GLOBAL_ALL)) { | |
| fprintf(stderr, "curl_global_init() failed\n"); | |
| @@ -32,17 +32,17 @@ | |
| #include "memdebug.h" | |
| - | static char data [] = "Hello Cloud!\n"; |
| + | static char testdata[] = "Hello Cloud!\n"; |
| static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) | |
| { | |
| size_t amount = nmemb * size; /* Total bytes curl wants */ | |
| - | if(amount < strlen(data)) { |
| - | return strlen(data); |
| + | if(amount < strlen(testdata)) { |
| + | return strlen(testdata); |
| } | |
| (void)stream; | |
| - | memcpy(ptr, data, strlen(data)); |
| - | return strlen(data); |
| + | memcpy(ptr, testdata, strlen(testdata)); |
| + | return strlen(testdata); |
| } | |
| @@ -84,7 +84,7 @@ CURLcode test(char *URL) | |
| test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); | |
| test_setopt(curl, CURLOPT_READFUNCTION, read_callback); | |
| test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); | |
| - | test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data)); |
| + | test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(testdata)); |
| res = curl_easy_perform(curl); | |
| @@ -31,17 +31,17 @@ | |
| #include "memdebug.h" | |
| - | static char data [] = "Hello Cloud!\n"; |
| + | static char testdata[] = "Hello Cloud!\n"; |
| static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) | |
| { | |
| size_t amount = nmemb * size; /* Total bytes curl wants */ | |
| - | if(amount < strlen(data)) { |
| - | return strlen(data); |
| + | if(amount < strlen(testdata)) { |
| + | return strlen(testdata); |
| } | |
| (void)stream; | |
| - | memcpy(ptr, data, strlen(data)); |
| - | return strlen(data); |
| + | memcpy(ptr, testdata, strlen(testdata)); |
| + | return strlen(testdata); |
| } | |
| CURLcode test(char *URL) | |
| @@ -87,7 +87,7 @@ CURLcode test(char *URL) | |
| test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); | |
| test_setopt(curl, CURLOPT_READFUNCTION, read_callback); | |
| test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); | |
| - | test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data)); |
| + | test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(testdata)); |
| res = curl_easy_perform(curl); | |
| @@ -31,17 +31,17 @@ | |
| #include "memdebug.h" | |
| - | static char data [] = "Hello Cloud!\n"; |
| + | static char testdata[] = "Hello Cloud!\n"; |
| static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) | |
| { | |
| size_t amount = nmemb * size; /* Total bytes curl wants */ | |
| - | if(amount < strlen(data)) { |
| - | return strlen(data); |
| + | if(amount < strlen(testdata)) { |
| + | return strlen(testdata); |
| } | |
| (void)stream; | |
| - | memcpy(ptr, data, strlen(data)); |
| - | return strlen(data); |
| + | memcpy(ptr, testdata, strlen(testdata)); |
| + | return strlen(testdata); |
| } | |
| @@ -85,7 +85,7 @@ CURLcode test(char *URL) | |
| test_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); | |
| test_setopt(curl, CURLOPT_READFUNCTION, read_callback); | |
| test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); | |
| - | test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(data)); |
| + | test_setopt(curl, CURLOPT_INFILESIZE, (long)strlen(testdata)); |
| test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED); | |
| res = curl_easy_perform(curl); | |
| @@ -36,8 +36,8 @@ static const char *ldata_names[] = { | |
| "NULL", | |
| }; | |
| - | static void my_lock(CURL *handle, curl_lock_data data, |
| - | curl_lock_access laccess, void *useptr) |
| + | static void test_lock(CURL *handle, curl_lock_data data, |
| + | curl_lock_access laccess, void *useptr) |
| { | |
| (void)handle; | |
| (void)data; | |
| @@ -46,7 +46,7 @@ static void my_lock(CURL *handle, curl_lock_data data, | |
| printf("-> Mutex lock %s\n", ldata_names[data]); | |
| } | |
| - | static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| + | static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| { | |
| (void)handle; | |
| (void)data; | |
| @@ -70,8 +70,8 @@ CURLcode test(char *URL) | |
| } | |
| curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); | |
| - | curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); |
| - | curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); |
| + | curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); |
| + | curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); |
| /* Loop the transfer and cleanup the handle properly every lap. This will | |
| still reuse connections since the pool is in the shared object! */ | |
| @@ -40,7 +40,7 @@ static CURL *pending_handles[CONN_NUM]; | |
| static int pending_num = 0; | |
| static CURLcode test_failure = CURLE_OK; | |
| - | static CURLM *multi = NULL; |
| + | static CURLM *testmulti = NULL; |
| static const char *url; | |
| static void *run_thread(void *ptr) | |
| @@ -72,7 +72,7 @@ static void *run_thread(void *ptr) | |
| pthread_mutex_unlock(&lock); | |
| - | res_multi_wakeup(multi); |
| + | res_multi_wakeup(testmulti); |
| } | |
| test_cleanup: | |
| @@ -107,7 +107,7 @@ CURLcode test(char *URL) | |
| global_init(CURL_GLOBAL_ALL); | |
| - | multi_init(multi); |
| + | multi_init(testmulti); |
| url = URL; | |
| @@ -121,16 +121,16 @@ CURLcode test(char *URL) | |
| } | |
| while(1) { | |
| - | multi_perform(multi, &still_running); |
| + | multi_perform(testmulti, &still_running); |
| abort_on_test_timeout(); | |
| - | while((message = curl_multi_info_read(multi, &num))) { |
| + | while((message = curl_multi_info_read(testmulti, &num))) { |
| if(message->msg == CURLMSG_DONE) { | |
| res = message->data.result; | |
| if(res) | |
| goto test_cleanup; | |
| - | multi_remove_handle(multi, message->easy_handle); |
| + | multi_remove_handle(testmulti, message->easy_handle); |
| finished_num++; | |
| } | |
| else { | |
| @@ -146,14 +146,14 @@ CURLcode test(char *URL) | |
| if(CONN_NUM == finished_num) | |
| break; | |
| - | multi_poll(multi, NULL, 0, TEST_HANG_TIMEOUT, &num); |
| + | multi_poll(testmulti, NULL, 0, TEST_HANG_TIMEOUT, &num); |
| abort_on_test_timeout(); | |
| pthread_mutex_lock(&lock); | |
| while(pending_num > 0) { | |
| - | res_multi_add_handle(multi, pending_handles[pending_num - 1]); |
| + | res_multi_add_handle(testmulti, pending_handles[pending_num - 1]); |
| if(res) { | |
| pthread_mutex_unlock(&lock); | |
| goto test_cleanup; | |
| @@ -191,7 +191,7 @@ test_cleanup: | |
| if(tid_valid) | |
| pthread_join(tid, NULL); | |
| - | curl_multi_cleanup(multi); |
| + | curl_multi_cleanup(testmulti); |
| for(i = 0; i < pending_num; i++) | |
| curl_easy_cleanup(pending_handles[i]); | |
| for(i = 0; i < started_num; i++) | |
| @@ -31,24 +31,24 @@ | |
| #include <stdio.h> | |
| #include "memdebug.h" | |
| - | static char data [] = "Hello Cloud!\r\n"; |
| + | static char testdata[] = "Hello Cloud!\r\n"; |
| static size_t consumed = 0; | |
| static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *stream) | |
| { | |
| size_t amount = nmemb * size; /* Total bytes curl wants */ | |
| - | if(consumed == strlen(data)) { |
| + | if(consumed == strlen(testdata)) { |
| return 0; | |
| } | |
| - | if(amount > strlen(data)-consumed) { |
| - | amount = strlen(data); |
| + | if(amount > strlen(testdata)-consumed) { |
| + | amount = strlen(testdata); |
| } | |
| consumed += amount; | |
| (void)stream; | |
| - | memcpy(ptr, data, amount); |
| + | memcpy(ptr, testdata, amount); |
| return amount; | |
| } | |
| @@ -23,7 +23,7 @@ | |
| ***************************************************************************/ | |
| #include "test.h" | |
| - | static char data[]="mooaaa"; |
| + | static char testdata[]="mooaaa"; |
| struct WriteThis { | |
| size_t sizeleft; | |
| @@ -32,13 +32,13 @@ struct WriteThis { | |
| static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| { | |
| struct WriteThis *pooh = (struct WriteThis *)userp; | |
| - | size_t len = strlen(data); |
| + | size_t len = strlen(testdata); |
| if(size*nmemb < len) | |
| return 0; | |
| if(pooh->sizeleft) { | |
| - | memcpy(ptr, data, strlen(data)); |
| + | memcpy(ptr, testdata, strlen(testdata)); |
| pooh->sizeleft = 0; | |
| return len; | |
| } | |
| @@ -31,7 +31,7 @@ | |
| define not publicly exposed so we set our own */ | |
| #define MAX_INPUT_LENGTH 8000000 | |
| - | static char buffer[MAX_INPUT_LENGTH + 2]; |
| + | static char testbuf[MAX_INPUT_LENGTH + 2]; |
| CURLcode test(char *URL) | |
| { | |
| @@ -48,10 +48,10 @@ CURLcode test(char *URL) | |
| } | |
| /* make it a null-terminated C string with just As */ | |
| - | memset(buffer, 'A', MAX_INPUT_LENGTH + 1); |
| - | buffer[MAX_INPUT_LENGTH + 1] = 0; |
| + | memset(testbuf, 'A', MAX_INPUT_LENGTH + 1); |
| + | testbuf[MAX_INPUT_LENGTH + 1] = 0; |
| - | printf("string length: %d\n", (int)strlen(buffer)); |
| + | printf("string length: %d\n", (int)strlen(testbuf)); |
| for(o = curl_easy_option_next(NULL); | |
| o; | |
| @@ -76,7 +76,7 @@ CURLcode test(char *URL) | |
| /* This is a string. Make sure that passing in a string longer | |
| CURL_MAX_INPUT_LENGTH returns an error */ | |
| - | result = curl_easy_setopt(easy, o->id, buffer); |
| + | result = curl_easy_setopt(easy, o->id, testbuf); |
| switch(result) { | |
| case CURLE_BAD_FUNCTION_ARGUMENT: /* the most normal */ | |
| case CURLE_UNKNOWN_OPTION: /* left out from the build */ | |
| @@ -26,7 +26,7 @@ | |
| #include "memdebug.h" | |
| - | static const char *show[]={ |
| + | static const char *testdata[]={ |
| "daTE", | |
| "Server", | |
| "content-type", | |
| @@ -50,9 +50,9 @@ static void showem(CURL *easy, unsigned int type) | |
| { | |
| int i; | |
| struct curl_header *header; | |
| - | for(i = 0; show[i]; i++) { |
| - | if(CURLHE_OK == curl_easy_header(easy, show[i], 0, type, HEADER_REQUEST, |
| - | &header)) { |
| + | for(i = 0; testdata[i]; i++) { |
| + | if(CURLHE_OK == curl_easy_header(easy, testdata[i], 0, type, |
| + | HEADER_REQUEST, &header)) { |
| if(header->amount > 1) { | |
| /* more than one, iterate over them */ | |
| size_t index = 0; | |
| @@ -63,7 +63,7 @@ static void showem(CURL *easy, unsigned int type) | |
| if(++index == amount) | |
| break; | |
| - | if(CURLHE_OK != curl_easy_header(easy, show[i], index, type, |
| + | if(CURLHE_OK != curl_easy_header(easy, testdata[i], index, type, |
| HEADER_REQUEST, &header)) | |
| break; | |
| } while(1); | |
| @@ -27,7 +27,7 @@ | |
| #ifdef USE_WEBSOCKETS | |
| #if 0 | |
| - | static CURLcode ping(CURL *curl, const char *send_payload) |
| + | static CURLcode send_ping(CURL *curl, const char *send_payload) |
| { | |
| size_t sent; | |
| CURLcode result = | |
| @@ -80,7 +80,7 @@ static void websocket(CURL *curl) | |
| int i = 0; | |
| fprintf(stderr, "ws: websocket() starts\n"); | |
| do { | |
| - | if(ping(curl, "foobar")) |
| + | if(send_ping(curl, "foobar")) |
| return; | |
| if(recv_pong(curl, "foobar")) | |
| return; | |
| @@ -26,7 +26,7 @@ | |
| #ifdef USE_WEBSOCKETS | |
| - | static CURLcode ping(CURL *curl, const char *send_payload) |
| + | static CURLcode send_ping(CURL *curl, const char *send_payload) |
| { | |
| size_t sent; | |
| CURLcode result = | |
| @@ -98,7 +98,7 @@ static void websocket(CURL *curl) | |
| do { | |
| recv_any(curl); | |
| fprintf(stderr, "Send ping\n"); | |
| - | if(ping(curl, "foobar")) |
| + | if(send_ping(curl, "foobar")) |
| return; | |
| fprintf(stderr, "Receive pong\n"); | |
| if(recv_pong(curl, "foobar")) { | |
| @@ -55,6 +55,7 @@ static void websocket(CURL *curl) | |
| if(result == CURLE_AGAIN) | |
| /* crude busy-loop */ | |
| continue; | |
| + | fclose(save); |
| printf("curl_ws_recv returned %d\n", result); | |
| return; | |
| } | |
| @@ -38,8 +38,7 @@ | |
| #define THREAD_SIZE 16 | |
| #define PER_THREAD_SIZE 8 | |
| - | struct Ctx |
| - | { |
| + | struct Ctx { |
| const char *URL; | |
| CURLSH *share; | |
| int result; | |
| @@ -126,8 +125,8 @@ test_cleanup: | |
| #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) | |
| - | static void my_lock(CURL *handle, curl_lock_data data, |
| - | curl_lock_access laccess, void *useptr) |
| + | static void test_lock(CURL *handle, curl_lock_data data, |
| + | curl_lock_access laccess, void *useptr) |
| { | |
| curl_mutex_t *mutexes = (curl_mutex_t*) useptr; | |
| (void)handle; | |
| @@ -135,14 +134,14 @@ static void my_lock(CURL *handle, curl_lock_data data, | |
| Curl_mutex_acquire(&mutexes[data]); | |
| } | |
| - | static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| + | static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| { | |
| curl_mutex_t *mutexes = (curl_mutex_t*) useptr; | |
| (void)handle; | |
| Curl_mutex_release(&mutexes[data]); | |
| } | |
| - | static void execute(struct Curl_share *share, struct Ctx *ctx) |
| + | static void execute(CURLSH *share, struct Ctx *ctx) |
| { | |
| int i; | |
| curl_mutex_t mutexes[CURL_LOCK_DATA_LAST - 1]; | |
| @@ -150,8 +149,8 @@ static void execute(struct Curl_share *share, struct Ctx *ctx) | |
| for(i = 0; i < CURL_LOCK_DATA_LAST - 1; i++) { | |
| Curl_mutex_init(&mutexes[i]); | |
| } | |
| - | curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); |
| - | curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); |
| + | curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); |
| + | curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); |
| curl_share_setopt(share, CURLSHOPT_USERDATA, (void *)mutexes); | |
| curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); | |
| @@ -173,7 +172,7 @@ static void execute(struct Curl_share *share, struct Ctx *ctx) | |
| #else /* without pthread, run serially */ | |
| - | static void execute(struct Curl_share *share, struct Ctx *ctx) |
| + | static void execute(CURLSH *share, struct Ctx *ctx) |
| { | |
| int i; | |
| (void) share; | |
| @@ -28,7 +28,7 @@ | |
| #ifdef LIB585 | |
| - | static int counter; |
| + | static int testcounter; |
| static curl_socket_t tst_opensocket(void *clientp, | |
| curlsocktype purpose, | |
| @@ -36,14 +36,14 @@ static curl_socket_t tst_opensocket(void *clientp, | |
| { | |
| (void)clientp; | |
| (void)purpose; | |
| - | printf("[OPEN] counter: %d\n", ++counter); |
| + | printf("[OPEN] counter: %d\n", ++testcounter); |
| return socket(addr->family, addr->socktype, addr->protocol); | |
| } | |
| static int tst_closesocket(void *clientp, curl_socket_t sock) | |
| { | |
| (void)clientp; | |
| - | printf("[CLOSE] counter: %d\n", counter--); |
| + | printf("[CLOSE] counter: %d\n", testcounter--); |
| return sclose(sock); | |
| } | |
| @@ -51,7 +51,7 @@ static void setupcallbacks(CURL *curl) | |
| { | |
| curl_easy_setopt(curl, CURLOPT_OPENSOCKETFUNCTION, tst_opensocket); | |
| curl_easy_setopt(curl, CURLOPT_CLOSESOCKETFUNCTION, tst_closesocket); | |
| - | counter = 0; |
| + | testcounter = 0; |
| } | |
| #else | |
| @@ -174,3 +174,5 @@ test_cleanup: | |
| return res; | |
| } | |
| + | |
| + | #undef setupcallbacks |
| @@ -42,8 +42,8 @@ struct userdata { | |
| static int locks[3]; | |
| /* lock callback */ | |
| - | static void my_lock(CURL *handle, curl_lock_data data, |
| - | curl_lock_access laccess, void *useptr) |
| + | static void test_lock(CURL *handle, curl_lock_data data, |
| + | curl_lock_access laccess, void *useptr) |
| { | |
| const char *what; | |
| struct userdata *user = (struct userdata *)useptr; | |
| @@ -82,7 +82,7 @@ static void my_lock(CURL *handle, curl_lock_data data, | |
| } | |
| /* unlock callback */ | |
| - | static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| + | static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| { | |
| const char *what; | |
| struct userdata *user = (struct userdata *)useptr; | |
| @@ -127,7 +127,7 @@ static struct curl_slist *sethost(struct curl_slist *headers) | |
| /* the dummy thread function */ | |
| - | static void *fire(void *ptr) |
| + | static void *test_fire(void *ptr) |
| { | |
| CURLcode code; | |
| struct curl_slist *headers; | |
| @@ -207,11 +207,11 @@ CURLcode test(char *URL) | |
| if(CURLSHE_OK == scode) { | |
| printf("CURLSHOPT_LOCKFUNC\n"); | |
| - | scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); |
| + | scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); |
| } | |
| if(CURLSHE_OK == scode) { | |
| printf("CURLSHOPT_UNLOCKFUNC\n"); | |
| - | scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); |
| + | scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); |
| } | |
| if(CURLSHE_OK == scode) { | |
| printf("CURLSHOPT_USERDATA\n"); | |
| @@ -272,7 +272,7 @@ CURLcode test(char *URL) | |
| /* simulate thread, direct call of "thread" function */ | |
| printf("*** run %d\n",i); | |
| - | fire(&tdata); |
| + | test_fire(&tdata); |
| curl_free(tdata.url); | |
| } | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]="this is what we post to the silly web server\n"; |
| + | static char testdata[]="this is what we post to the silly web server\n"; |
| struct WriteThis { | |
| char *readptr; | |
| @@ -56,8 +56,8 @@ CURLcode test(char *URL) | |
| struct WriteThis pooh; | |
| - | pooh.readptr = data; |
| - | pooh.sizeleft = strlen(data); |
| + | pooh.readptr = testdata; |
| + | pooh.sizeleft = strlen(testdata); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| fprintf(stderr, "curl_global_init() failed\n"); | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static const char *post[]={ |
| + | static const char * const testpost[]={ |
| "one", | |
| "two", | |
| "three", | |
| @@ -46,7 +46,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| if(size*nmemb < 1) | |
| return 0; | |
| - | data = post[pooh->counter]; |
| + | data = testpost[pooh->counter]; |
| if(data) { | |
| size_t len = strlen(data); | |
| @@ -50,7 +50,7 @@ | |
| #if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) | |
| - | static int *fd = NULL; |
| + | static int *testfd = NULL; |
| static struct rlimit num_open; | |
| static char msgbuff[256]; | |
| @@ -68,10 +68,10 @@ static void close_file_descriptors(void) | |
| for(num_open.rlim_cur = 0; | |
| num_open.rlim_cur < num_open.rlim_max; | |
| num_open.rlim_cur++) | |
| - | if(fd[num_open.rlim_cur] > 0) |
| - | close(fd[num_open.rlim_cur]); |
| - | free(fd); |
| - | fd = NULL; |
| + | if(testfd[num_open.rlim_cur] > 0) |
| + | close(testfd[num_open.rlim_cur]); |
| + | free(testfd); |
| + | testfd = NULL; |
| } | |
| static int fopen_works(void) | |
| @@ -120,7 +120,7 @@ static void rlim2str(char *buf, size_t len, rlim_t val) | |
| } | |
| } | |
| - | static int rlimit(int keep_open) |
| + | static int test_rlimit(int keep_open) |
| { | |
| rlim_t nitems, i; | |
| int *memchunk = NULL; | |
| @@ -239,7 +239,7 @@ static int rlimit(int keep_open) | |
| * avoid a low memory condition once the file descriptors are | |
| * open. System conditions that could make the test fail should | |
| * be addressed in the precheck phase. This chunk of memory shall | |
| - | * be always free()ed before exiting the rlimit() function so |
| + | * be always free()ed before exiting the test_rlimit() function so |
| * that it becomes available to the test. | |
| */ | |
| @@ -276,7 +276,7 @@ static int rlimit(int keep_open) | |
| /* verify that we won't overflow size_t in malloc() */ | |
| - | if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) { |
| + | if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*testfd)) { |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); | |
| msnprintf(strbuff, sizeof(strbuff), "unable to allocate an array for %s " | |
| "file descriptors, would overflow size_t", strbuff1); | |
| @@ -291,9 +291,9 @@ static int rlimit(int keep_open) | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| fprintf(stderr, "allocating array for %s file descriptors\n", strbuff); | |
| - | fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max)); |
| - | if(!fd) { |
| - | store_errmsg("fd, malloc() failed", errno); |
| + | testfd = malloc(sizeof(*testfd) * (size_t)(num_open.rlim_max)); |
| + | if(!testfd) { |
| + | store_errmsg("testfd, malloc() failed", errno); |
| fprintf(stderr, "%s\n", msgbuff); | |
| free(memchunk); | |
| return -7; | |
| @@ -301,25 +301,25 @@ static int rlimit(int keep_open) | |
| /* initialize it to fight lazy allocation */ | |
| - | fprintf(stderr, "initializing fd array\n"); |
| + | fprintf(stderr, "initializing testfd array\n"); |
| for(num_open.rlim_cur = 0; | |
| num_open.rlim_cur < num_open.rlim_max; | |
| num_open.rlim_cur++) | |
| - | fd[num_open.rlim_cur] = -1; |
| + | testfd[num_open.rlim_cur] = -1; |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| fprintf(stderr, "trying to open %s file descriptors\n", strbuff); | |
| /* open a dummy descriptor */ | |
| - | fd[0] = open(DEV_NULL, O_RDONLY); |
| - | if(fd[0] < 0) { |
| + | testfd[0] = open(DEV_NULL, O_RDONLY); |
| + | if(testfd[0] < 0) { |
| msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); | |
| store_errmsg(strbuff, errno); | |
| fprintf(stderr, "%s\n", msgbuff); | |
| - | free(fd); |
| - | fd = NULL; |
| + | free(testfd); |
| + | testfd = NULL; |
| free(memchunk); | |
| return -8; | |
| } | |
| @@ -330,11 +330,11 @@ static int rlimit(int keep_open) | |
| num_open.rlim_cur < num_open.rlim_max; | |
| num_open.rlim_cur++) { | |
| - | fd[num_open.rlim_cur] = dup(fd[0]); |
| + | testfd[num_open.rlim_cur] = dup(testfd[0]); |
| - | if(fd[num_open.rlim_cur] < 0) { |
| + | if(testfd[num_open.rlim_cur] < 0) { |
| - | fd[num_open.rlim_cur] = -1; |
| + | testfd[num_open.rlim_cur] = -1; |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", strbuff1); | |
| @@ -355,11 +355,11 @@ static int rlimit(int keep_open) | |
| fprintf(stderr, "%s\n", msgbuff); | |
| for(num_open.rlim_cur = 0; | |
| - | fd[num_open.rlim_cur] >= 0; |
| + | testfd[num_open.rlim_cur] >= 0; |
| num_open.rlim_cur++) | |
| - | close(fd[num_open.rlim_cur]); |
| - | free(fd); |
| - | fd = NULL; |
| + | close(testfd[num_open.rlim_cur]); |
| + | free(testfd); |
| + | testfd = NULL; |
| free(memchunk); | |
| return -9; | |
| } | |
| @@ -396,8 +396,8 @@ static int rlimit(int keep_open) | |
| for(rl.rlim_cur = 0; | |
| rl.rlim_cur < num_open.rlim_max; | |
| rl.rlim_cur++) { | |
| - | if((fd[rl.rlim_cur] > 0) && |
| - | ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) { |
| + | if((testfd[rl.rlim_cur] > 0) && |
| + | ((unsigned int)testfd[rl.rlim_cur] > num_open.rlim_cur)) { |
| msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", | |
| FD_SETSIZE); | |
| store_errmsg(strbuff, 0); | |
| @@ -452,14 +452,14 @@ CURLcode test(char *URL) | |
| if(!strcmp(URL, "check")) { | |
| /* used by the test script to ask if we can run this test or not */ | |
| - | if(rlimit(FALSE)) { |
| - | fprintf(stdout, "rlimit problem: %s\n", msgbuff); |
| + | if(test_rlimit(FALSE)) { |
| + | fprintf(stdout, "test_rlimit problem: %s\n", msgbuff); |
| return (CURLcode)1; | |
| } | |
| return CURLE_OK; /* sure, run this! */ | |
| } | |
| - | if(rlimit(TRUE)) { |
| + | if(test_rlimit(TRUE)) { |
| /* failure */ | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -38,15 +38,13 @@ | |
| #define TEST_HANG_TIMEOUT 60 * 1000 | |
| - | struct Sockets |
| - | { |
| + | struct Sockets { |
| curl_socket_t *sockets; | |
| int count; /* number of sockets actually stored in array */ | |
| int max_count; /* max number of sockets that fit in allocated array */ | |
| }; | |
| - | struct ReadWriteSockets |
| - | { |
| + | struct ReadWriteSockets { |
| struct Sockets read, write; | |
| }; | |
| @@ -50,7 +50,7 @@ | |
| #if defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) | |
| - | static int *fd = NULL; |
| + | static int *testfd = NULL; |
| static struct rlimit num_open; | |
| static char msgbuff[256]; | |
| @@ -68,10 +68,10 @@ static void close_file_descriptors(void) | |
| for(num_open.rlim_cur = 0; | |
| num_open.rlim_cur < num_open.rlim_max; | |
| num_open.rlim_cur++) | |
| - | if(fd[num_open.rlim_cur] > 0) |
| - | close(fd[num_open.rlim_cur]); |
| - | free(fd); |
| - | fd = NULL; |
| + | if(testfd[num_open.rlim_cur] > 0) |
| + | close(testfd[num_open.rlim_cur]); |
| + | free(testfd); |
| + | testfd = NULL; |
| } | |
| static int fopen_works(void) | |
| @@ -120,7 +120,7 @@ static void rlim2str(char *buf, size_t len, rlim_t val) | |
| } | |
| } | |
| - | static int rlimit(int keep_open) |
| + | static int test_rlimit(int keep_open) |
| { | |
| int *tmpfd; | |
| rlim_t nitems, i; | |
| @@ -221,7 +221,7 @@ static int rlimit(int keep_open) | |
| * avoid a low memory condition once the file descriptors are | |
| * open. System conditions that could make the test fail should | |
| * be addressed in the precheck phase. This chunk of memory shall | |
| - | * be always free()ed before exiting the rlimit() function so |
| + | * be always free()ed before exiting the test_rlimit() function so |
| * that it becomes available to the test. | |
| */ | |
| @@ -273,7 +273,7 @@ static int rlimit(int keep_open) | |
| /* verify that we won't overflow size_t in malloc() */ | |
| - | if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*fd)) { |
| + | if((size_t)(num_open.rlim_max) > ((size_t)-1) / sizeof(*testfd)) { |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_max); | |
| msnprintf(strbuff, sizeof(strbuff), "unable to allocate an array for %s " | |
| "file descriptors, would overflow size_t", strbuff1); | |
| @@ -289,14 +289,14 @@ static int rlimit(int keep_open) | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| fprintf(stderr, "allocating array for %s file descriptors\n", strbuff); | |
| - | fd = malloc(sizeof(*fd) * (size_t)(num_open.rlim_max)); |
| - | if(!fd) { |
| - | fprintf(stderr, "fd, malloc() failed\n"); |
| + | testfd = malloc(sizeof(*testfd) * (size_t)(num_open.rlim_max)); |
| + | if(!testfd) { |
| + | fprintf(stderr, "testfd, malloc() failed\n"); |
| num_open.rlim_max /= 2; | |
| } | |
| - | } while(num_open.rlim_max && !fd); |
| - | if(!fd) { |
| - | store_errmsg("fd, malloc() failed", errno); |
| + | } while(num_open.rlim_max && !testfd); |
| + | if(!testfd) { |
| + | store_errmsg("testfd, malloc() failed", errno); |
| fprintf(stderr, "%s\n", msgbuff); | |
| free(memchunk); | |
| return -6; | |
| @@ -304,25 +304,25 @@ static int rlimit(int keep_open) | |
| /* initialize it to fight lazy allocation */ | |
| - | fprintf(stderr, "initializing fd array\n"); |
| + | fprintf(stderr, "initializing testfd array\n"); |
| for(num_open.rlim_cur = 0; | |
| num_open.rlim_cur < num_open.rlim_max; | |
| num_open.rlim_cur++) | |
| - | fd[num_open.rlim_cur] = -1; |
| + | testfd[num_open.rlim_cur] = -1; |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| fprintf(stderr, "trying to open %s file descriptors\n", strbuff); | |
| /* open a dummy descriptor */ | |
| - | fd[0] = open(DEV_NULL, O_RDONLY); |
| - | if(fd[0] < 0) { |
| + | testfd[0] = open(DEV_NULL, O_RDONLY); |
| + | if(testfd[0] < 0) { |
| msnprintf(strbuff, sizeof(strbuff), "opening of %s failed", DEV_NULL); | |
| store_errmsg(strbuff, errno); | |
| fprintf(stderr, "%s\n", msgbuff); | |
| - | free(fd); |
| - | fd = NULL; |
| + | free(testfd); |
| + | testfd = NULL; |
| free(memchunk); | |
| return -7; | |
| } | |
| @@ -333,11 +333,11 @@ static int rlimit(int keep_open) | |
| num_open.rlim_cur < num_open.rlim_max; | |
| num_open.rlim_cur++) { | |
| - | fd[num_open.rlim_cur] = dup(fd[0]); |
| + | testfd[num_open.rlim_cur] = dup(testfd[0]); |
| - | if(fd[num_open.rlim_cur] < 0) { |
| + | if(testfd[num_open.rlim_cur] < 0) { |
| - | fd[num_open.rlim_cur] = -1; |
| + | testfd[num_open.rlim_cur] = -1; |
| rlim2str(strbuff1, sizeof(strbuff1), num_open.rlim_cur); | |
| msnprintf(strbuff, sizeof(strbuff), "dup() attempt %s failed", strbuff1); | |
| @@ -357,10 +357,10 @@ static int rlimit(int keep_open) | |
| fprintf(stderr, "%s\n", strbuff); | |
| for(num_open.rlim_cur = num_open.rlim_max; | |
| - | fd[num_open.rlim_cur] >= 0; |
| + | testfd[num_open.rlim_cur] >= 0; |
| num_open.rlim_cur++) { | |
| - | close(fd[num_open.rlim_cur]); |
| - | fd[num_open.rlim_cur] = -1; |
| + | close(testfd[num_open.rlim_cur]); |
| + | testfd[num_open.rlim_cur] = -1; |
| } | |
| rlim2str(strbuff, sizeof(strbuff), num_open.rlim_max); | |
| @@ -368,9 +368,9 @@ static int rlimit(int keep_open) | |
| /* we don't care if we can't shrink it */ | |
| - | tmpfd = realloc(fd, sizeof(*fd) * (size_t)(num_open.rlim_max)); |
| + | tmpfd = realloc(testfd, sizeof(*testfd) * (size_t)(num_open.rlim_max)); |
| if(tmpfd) { | |
| - | fd = tmpfd; |
| + | testfd = tmpfd; |
| tmpfd = NULL; | |
| } | |
| @@ -409,8 +409,8 @@ static int rlimit(int keep_open) | |
| for(rl.rlim_cur = 0; | |
| rl.rlim_cur < num_open.rlim_max; | |
| rl.rlim_cur++) { | |
| - | if((fd[rl.rlim_cur] > 0) && |
| - | ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur)) { |
| + | if((testfd[rl.rlim_cur] > 0) && |
| + | ((unsigned int)testfd[rl.rlim_cur] > num_open.rlim_cur)) { |
| msnprintf(strbuff, sizeof(strbuff), "select limit is FD_SETSIZE %d", | |
| FD_SETSIZE); | |
| store_errmsg(strbuff, 0); | |
| @@ -465,14 +465,14 @@ CURLcode test(char *URL) | |
| if(!strcmp(URL, "check")) { | |
| /* used by the test script to ask if we can run this test or not */ | |
| - | if(rlimit(FALSE)) { |
| - | fprintf(stdout, "rlimit problem: %s\n", msgbuff); |
| + | if(test_rlimit(FALSE)) { |
| + | fprintf(stdout, "test_rlimit problem: %s\n", msgbuff); |
| return (CURLcode)1; | |
| } | |
| return CURLE_OK; /* sure, run this! */ | |
| } | |
| - | if(rlimit(TRUE)) { |
| + | if(test_rlimit(TRUE)) { |
| /* failure */ | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| @@ -46,46 +46,46 @@ | |
| #define NUM_HANDLES 2 | |
| - | static CURL *eh[NUM_HANDLES]; |
| + | static CURL *testeh[NUM_HANDLES]; |
| static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd, | |
| struct curl_slist *headers) | |
| { | |
| CURLcode res = CURLE_OK; | |
| - | res_easy_init(eh[num]); |
| + | res_easy_init(testeh[num]); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_URL, url); |
| + | res_easy_setopt(testeh[num], CURLOPT_URL, url); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_PROXY, PROXY); |
| + | res_easy_setopt(testeh[num], CURLOPT_PROXY, PROXY); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_PROXYUSERPWD, userpwd); |
| + | res_easy_setopt(testeh[num], CURLOPT_PROXYUSERPWD, userpwd); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); |
| + | res_easy_setopt(testeh[num], CURLOPT_PROXYAUTH, (long)CURLAUTH_ANY); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_VERBOSE, 1L); |
| + | res_easy_setopt(testeh[num], CURLOPT_VERBOSE, 1L); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_HEADER, 1L); |
| + | res_easy_setopt(testeh[num], CURLOPT_HEADER, 1L); |
| if(res) | |
| goto init_failed; | |
| - | res_easy_setopt(eh[num], CURLOPT_HTTPHEADER, headers); /* custom Host: */ |
| + | res_easy_setopt(testeh[num], CURLOPT_HTTPHEADER, headers); /* custom Host: */ |
| if(res) | |
| goto init_failed; | |
| - | res_multi_add_handle(cm, eh[num]); |
| + | res_multi_add_handle(cm, testeh[num]); |
| if(res) | |
| goto init_failed; | |
| @@ -93,8 +93,8 @@ static CURLcode init(int num, CURLM *cm, const char *url, const char *userpwd, | |
| init_failed: | |
| - | curl_easy_cleanup(eh[num]); |
| - | eh[num] = NULL; |
| + | curl_easy_cleanup(testeh[num]); |
| + | testeh[num] = NULL; |
| return res; /* failure */ | |
| } | |
| @@ -174,8 +174,8 @@ static CURLcode loop(int num, CURLM *cm, const char *url, const char *userpwd, | |
| curl_multi_remove_handle(cm, e); | |
| curl_easy_cleanup(e); | |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| - | if(eh[i] == e) { |
| - | eh[i] = NULL; |
| + | if(testeh[i] == e) { |
| + | testeh[i] = NULL; |
| break; | |
| } | |
| } | |
| @@ -201,7 +201,7 @@ CURLcode test(char *URL) | |
| int i; | |
| for(i = 0; i < NUM_HANDLES; i++) | |
| - | eh[i] = NULL; |
| + | testeh[i] = NULL; |
| start_test_timing(); | |
| @@ -243,8 +243,8 @@ test_cleanup: | |
| /* proper cleanup sequence - type PB */ | |
| for(i = 0; i < NUM_HANDLES; i++) { | |
| - | curl_multi_remove_handle(cm, eh[i]); |
| - | curl_easy_cleanup(eh[i]); |
| + | curl_multi_remove_handle(cm, testeh[i]); |
| + | curl_easy_cleanup(testeh[i]); |
| } | |
| curl_multi_cleanup(cm); | |
| @@ -30,7 +30,7 @@ | |
| #include "warnless.h" | |
| #include "memdebug.h" | |
| - | struct data { |
| + | struct testdata { |
| char trace_ascii; /* 1 or 0 */ | |
| }; | |
| @@ -89,7 +89,7 @@ int my_trace(CURL *handle, curl_infotype type, | |
| char *data, size_t size, | |
| void *userp) | |
| { | |
| - | struct data *config = (struct data *)userp; |
| + | struct testdata *config = (struct testdata *)userp; |
| const char *text; | |
| (void)handle; /* prevent compiler warning */ | |
| @@ -170,7 +170,7 @@ CURLcode test(char *URL) | |
| { | |
| CURL *curl; | |
| CURLcode res = CURLE_OK; | |
| - | struct data config; |
| + | struct testdata config; |
| size_t i; | |
| static const char fill[] = "test data"; | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]= |
| + | static char testdata[]= |
| "this is what we post to the silly web server\n"; | |
| struct WriteThis { | |
| @@ -59,7 +59,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| #endif | |
| } | |
| - | static CURLcode once(char *URL, bool oldstyle) |
| + | static CURLcode test_once(char *URL, bool oldstyle) |
| { | |
| CURL *curl; | |
| CURLcode res = CURLE_OK; | |
| @@ -70,8 +70,8 @@ static CURLcode once(char *URL, bool oldstyle) | |
| struct WriteThis pooh; | |
| struct WriteThis pooh2; | |
| - | pooh.readptr = data; |
| - | pooh.sizeleft = strlen(data); |
| + | pooh.readptr = testdata; |
| + | pooh.sizeleft = strlen(testdata); |
| /* Fill in the file upload field */ | |
| if(oldstyle) { | |
| @@ -104,8 +104,8 @@ static CURLcode once(char *URL, bool oldstyle) | |
| /* Now add the same data with another name and make it not look like | |
| a file upload but still using the callback */ | |
| - | pooh2.readptr = data; |
| - | pooh2.sizeleft = strlen(data); |
| + | pooh2.readptr = testdata; |
| + | pooh2.sizeleft = strlen(testdata); |
| CURL_IGNORE_DEPRECATION( | |
| /* Fill in the file upload field */ | |
| @@ -213,9 +213,9 @@ CURLcode test(char *URL) | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| - | res = once(URL, TRUE); /* old */ |
| + | res = test_once(URL, TRUE); /* old */ |
| if(!res) | |
| - | res = once(URL, FALSE); /* new */ |
| + | res = test_once(URL, FALSE); /* new */ |
| curl_global_cleanup(); | |
| @@ -27,8 +27,6 @@ | |
| * curl_m*printf formatting capabilities and handling of some data types. | |
| */ | |
| - | #define CURL_NO_FMT_CHECKS /* disable compiler *printf format checks */ |
| - | |
| #include "test.h" | |
| #include <limits.h> | |
| @@ -39,6 +37,12 @@ | |
| #include "memdebug.h" | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic push |
| + | #pragma GCC diagnostic ignored "-Wformat" |
| + | #pragma GCC diagnostic ignored "-Wformat-extra-args" |
| + | #endif |
| + | |
| #if (SIZEOF_CURL_OFF_T > SIZEOF_LONG) | |
| # define MPRNT_SUFFIX_CURL_OFF_T LL | |
| #else | |
| @@ -1507,3 +1511,7 @@ CURLcode test(char *URL) | |
| else | |
| return CURLE_OK; | |
| } | |
| + | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic pop |
| + | #endif |
| @@ -26,9 +26,9 @@ | |
| #include "memdebug.h" | |
| /* The size of data should be kept below MAX_INITIAL_POST_SIZE! */ | |
| - | static char data[]="this is a short string.\n"; |
| + | static char testdata[]="this is a short string.\n"; |
| - | static size_t data_size = sizeof(data) / sizeof(char); |
| + | static size_t data_size = sizeof(testdata) / sizeof(char); |
| static int progress_callback(void *clientp, double dltotal, double dlnow, | |
| double ultotal, double ulnow) | |
| @@ -75,7 +75,7 @@ CURLcode test(char *URL) | |
| /* Set the expected POST size */ | |
| test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)data_size); | |
| - | test_setopt(curl, CURLOPT_POSTFIELDS, data); |
| + | test_setopt(curl, CURLOPT_POSTFIELDS, testdata); |
| /* we want to use our own progress function */ | |
| CURL_IGNORE_DEPRECATION( | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static const char * const post[]={ |
| + | static const char * const testpost[]={ |
| "one", | |
| "two", | |
| "three", | |
| @@ -81,7 +81,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| if(size*nmemb < 1) | |
| return 0; | |
| - | data = post[pooh->counter]; |
| + | data = testpost[pooh->counter]; |
| if(data) { | |
| size_t len = strlen(data); | |
| @@ -31,15 +31,13 @@ | |
| #define TEST_HANG_TIMEOUT 60 * 1000 | |
| - | struct Sockets |
| - | { |
| + | struct Sockets { |
| curl_socket_t *sockets; | |
| int count; /* number of sockets actually stored in array */ | |
| int max_count; /* max number of sockets that fit in allocated array */ | |
| }; | |
| - | struct ReadWriteSockets |
| - | { |
| + | struct ReadWriteSockets { |
| struct Sockets read, write; | |
| }; | |
| @@ -38,8 +38,8 @@ struct userdata { | |
| }; | |
| /* lock callback */ | |
| - | static void my_lock(CURL *handle, curl_lock_data data, |
| - | curl_lock_access laccess, void *useptr) |
| + | static void test_lock(CURL *handle, curl_lock_data data, |
| + | curl_lock_access laccess, void *useptr) |
| { | |
| const char *what; | |
| struct userdata *user = (struct userdata *)useptr; | |
| @@ -69,7 +69,7 @@ static void my_lock(CURL *handle, curl_lock_data data, | |
| } | |
| /* unlock callback */ | |
| - | static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| + | static void test_unlock(CURL *handle, curl_lock_data data, void *useptr) |
| { | |
| const char *what; | |
| struct userdata *user = (struct userdata *)useptr; | |
| @@ -96,7 +96,7 @@ static void my_unlock(CURL *handle, curl_lock_data data, void *useptr) | |
| } | |
| /* the dummy thread function */ | |
| - | static void *fire(void *ptr) |
| + | static void *test_fire(void *ptr) |
| { | |
| CURLcode code; | |
| struct Tdata *tdata = (struct Tdata*)ptr; | |
| @@ -160,11 +160,11 @@ CURLcode test(char *URL) | |
| if(CURLSHE_OK == scode) { | |
| printf("CURLSHOPT_LOCKFUNC\n"); | |
| - | scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock); |
| + | scode = curl_share_setopt(share, CURLSHOPT_LOCKFUNC, test_lock); |
| } | |
| if(CURLSHE_OK == scode) { | |
| printf("CURLSHOPT_UNLOCKFUNC\n"); | |
| - | scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock); |
| + | scode = curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, test_unlock); |
| } | |
| if(CURLSHE_OK == scode) { | |
| printf("CURLSHOPT_USERDATA\n"); | |
| @@ -193,7 +193,7 @@ CURLcode test(char *URL) | |
| /* simulate thread, direct call of "thread" function */ | |
| printf("*** run %d\n",i); | |
| - | fire(&tdata); |
| + | test_fire(&tdata); |
| } | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]= |
| + | static char testdata[]= |
| "dummy\n"; | |
| struct WriteThis { | |
| @@ -56,7 +56,7 @@ static size_t read_callback(char *ptr, size_t size, size_t nmemb, void *userp) | |
| return 0; /* no more data left to deliver */ | |
| } | |
| - | static CURLcode once(char *URL, bool oldstyle) |
| + | static CURLcode test_once(char *URL, bool oldstyle) |
| { | |
| CURL *curl; | |
| CURLcode res = CURLE_OK; | |
| @@ -67,9 +67,9 @@ static CURLcode once(char *URL, bool oldstyle) | |
| struct WriteThis pooh2; | |
| curl_off_t datasize = -1; | |
| - | pooh.readptr = data; |
| + | pooh.readptr = testdata; |
| #ifndef LIB645 | |
| - | datasize = (curl_off_t)strlen(data); |
| + | datasize = (curl_off_t)strlen(testdata); |
| #endif | |
| pooh.sizeleft = datasize; | |
| @@ -122,9 +122,9 @@ static CURLcode once(char *URL, bool oldstyle) | |
| /* Now add the same data with another name and make it not look like | |
| a file upload but still using the callback */ | |
| - | pooh2.readptr = data; |
| + | pooh2.readptr = testdata; |
| #ifndef LIB645 | |
| - | datasize = (curl_off_t)strlen(data); |
| + | datasize = (curl_off_t)strlen(testdata); |
| #endif | |
| pooh2.sizeleft = datasize; | |
| @@ -256,9 +256,9 @@ CURLcode test(char *URL) | |
| return TEST_ERR_MAJOR_BAD; | |
| } | |
| - | res = once(URL, TRUE); /* old */ |
| + | res = test_once(URL, TRUE); /* old */ |
| if(!res) | |
| - | res = once(URL, FALSE); /* new */ |
| + | res = test_once(URL, FALSE); /* new */ |
| if(!res) | |
| res = cyclic_add(); | |
| @@ -25,10 +25,10 @@ | |
| #include "memdebug.h" | |
| - | static char data[] = |
| + | static char testdata[] = |
| "this is what we post to the silly web server"; | |
| - | static const char name[] = "fieldname"; |
| + | static const char testname[] = "fieldname"; |
| /* This test attempts to use all form API features that are not | |
| @@ -81,8 +81,8 @@ CURLcode test(char *URL) | |
| headers = headers2; | |
| CURL_IGNORE_DEPRECATION( | |
| formrc = curl_formadd(&formpost, &lastptr, | |
| - | CURLFORM_COPYNAME, &name, |
| - | CURLFORM_COPYCONTENTS, &data, |
| + | CURLFORM_COPYNAME, &testname, |
| + | CURLFORM_COPYCONTENTS, &testdata, |
| CURLFORM_CONTENTHEADER, headers, | |
| CURLFORM_END); | |
| ) | |
| @@ -91,20 +91,20 @@ CURLcode test(char *URL) | |
| goto test_cleanup; | |
| } | |
| - | contentlength = (long)(strlen(data) - 1); |
| + | contentlength = (long)(strlen(testdata) - 1); |
| CURL_IGNORE_DEPRECATION( | |
| /* Use a form array for the non-copy test. */ | |
| formarray[0].option = CURLFORM_PTRCONTENTS; | |
| - | formarray[0].value = data; |
| + | formarray[0].value = testdata; |
| formarray[1].option = CURLFORM_CONTENTSLENGTH; | |
| formarray[1].value = (char *)(size_t)contentlength; | |
| formarray[2].option = CURLFORM_END; | |
| formarray[2].value = NULL; | |
| formrc = curl_formadd(&formpost, | |
| &lastptr, | |
| - | CURLFORM_PTRNAME, name, |
| - | CURLFORM_NAMELENGTH, strlen(name) - 1, |
| + | CURLFORM_PTRNAME, testname, |
| + | CURLFORM_NAMELENGTH, strlen(testname) - 1, |
| CURLFORM_ARRAY, formarray, | |
| CURLFORM_FILENAME, "remotefile.txt", | |
| CURLFORM_END); | |
| @@ -117,7 +117,7 @@ CURLcode test(char *URL) | |
| /* Now change in-memory data to affect CURLOPT_PTRCONTENTS value. | |
| Copied values (first field) must not be affected. | |
| CURLOPT_PTRNAME actually copies the name thus we do not test this here. */ | |
| - | data[0]++; |
| + | testdata[0]++; |
| CURL_IGNORE_DEPRECATION( | |
| /* Check multi-files and content type propagation. */ | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char buffer[17000]; /* more than 16K */ |
| + | static char testbuf[17000]; /* more than 16K */ |
| CURLcode test(char *URL) | |
| { | |
| @@ -37,12 +37,12 @@ CURLcode test(char *URL) | |
| /* create a buffer with AAAA...BBBBB...CCCC...etc */ | |
| int i; | |
| - | int size = (int)sizeof(buffer)/1000; |
| + | int size = (int)sizeof(testbuf)/1000; |
| for(i = 0; i < size ; i++) | |
| - | memset(&buffer[i * 1000], 65 + i, 1000); |
| + | memset(&testbuf[i * 1000], 65 + i, 1000); |
| - | buffer[ sizeof(buffer)-1] = 0; /* null-terminate */ |
| + | testbuf[sizeof(testbuf)-1] = 0; /* null-terminate */ |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| fprintf(stderr, "curl_global_init() failed\n"); | |
| @@ -53,7 +53,7 @@ CURLcode test(char *URL) | |
| /* Check proper name and data copying. */ | |
| formrc = curl_formadd(&formpost, &lastptr, | |
| CURLFORM_COPYNAME, "hello", | |
| - | CURLFORM_COPYCONTENTS, buffer, |
| + | CURLFORM_COPYCONTENTS, testbuf, |
| CURLFORM_END); | |
| ) | |
| if(formrc) | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char buffer[17000]; /* more than 16K */ |
| + | static char testbuf[17000]; /* more than 16K */ |
| CURLcode test(char *URL) | |
| { | |
| @@ -35,12 +35,12 @@ CURLcode test(char *URL) | |
| curl_mimepart *part; | |
| struct curl_slist *recipients = NULL; | |
| - | /* create a buffer with AAAA...BBBBB...CCCC...etc */ |
| + | /* create a testbuf with AAAA...BBBBB...CCCC...etc */ |
| int i; | |
| - | int size = (int)sizeof(buffer) / 10; |
| + | int size = (int)sizeof(testbuf) / 10; |
| for(i = 0; i < size ; i++) | |
| - | memset(&buffer[i * 10], 65 + (i % 26), 10); |
| + | memset(&testbuf[i * 10], 65 + (i % 26), 10); |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| fprintf(stderr, "curl_global_init() failed\n"); | |
| @@ -77,7 +77,7 @@ CURLcode test(char *URL) | |
| fprintf(stderr, "curl_mime_type() failed\n"); | |
| goto test_cleanup; | |
| } | |
| - | res = curl_mime_data(part, buffer, sizeof(buffer)); |
| + | res = curl_mime_data(part, testbuf, sizeof(testbuf)); |
| if(res) { | |
| fprintf(stderr, "curl_mime_data() failed\n"); | |
| goto test_cleanup; | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]= |
| + | static char testdata[]= |
| "dummy\n"; | |
| struct WriteThis { | |
| @@ -94,8 +94,8 @@ CURLcode test(char *URL) | |
| test_setopt(easy, CURLOPT_HEADER, 1L); | |
| /* Prepare the callback structure. */ | |
| - | pooh.readptr = data; |
| - | pooh.sizeleft = (curl_off_t) strlen(data); |
| + | pooh.readptr = testdata; |
| + | pooh.sizeleft = (curl_off_t) strlen(testdata); |
| pooh.freecount = 0; | |
| /* Build the mime tree. */ | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char buffer[17000]; /* more than 16K */ |
| + | static char testbuf[17000]; /* more than 16K */ |
| CURLcode test(char *URL) | |
| { | |
| @@ -37,12 +37,12 @@ CURLcode test(char *URL) | |
| /* Checks huge binary-encoded mime post. */ | |
| - | /* Create a buffer with pseudo-binary data. */ |
| - | for(i = 0; i < sizeof(buffer); i++) |
| + | /* Create a testbuf with pseudo-binary data. */ |
| + | for(i = 0; i < sizeof(testbuf); i++) |
| if(i % 77 == 76) | |
| - | buffer[i] = '\n'; |
| + | testbuf[i] = '\n'; |
| else | |
| - | buffer[i] = (char) (0x41 + i % 26); /* A...Z */ |
| + | testbuf[i] = (char) (0x41 + i % 26); /* A...Z */ |
| if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) { | |
| fprintf(stderr, "curl_global_init() failed\n"); | |
| @@ -79,7 +79,7 @@ CURLcode test(char *URL) | |
| fprintf(stderr, "curl_mime_filename() failed\n"); | |
| goto test_cleanup; | |
| } | |
| - | res = curl_mime_data(part, buffer, sizeof(buffer)); |
| + | res = curl_mime_data(part, testbuf, sizeof(testbuf)); |
| if(res) { | |
| fprintf(stderr, "curl_mime_data() failed\n"); | |
| goto test_cleanup; | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]= |
| + | static char testdata[]= |
| "dummy"; | |
| struct WriteThis { | |
| @@ -84,8 +84,8 @@ CURLcode test(char *URL) | |
| test_setopt(easy, CURLOPT_HEADER, 1L); | |
| /* Prepare the callback structure. */ | |
| - | pooh.readptr = data; |
| - | pooh.sizeleft = (curl_off_t) strlen(data); |
| + | pooh.readptr = testdata; |
| + | pooh.sizeleft = (curl_off_t) strlen(testdata); |
| /* Build the mime tree. */ | |
| mime = curl_mime_init(easy); | |
| @@ -25,7 +25,7 @@ | |
| #include "memdebug.h" | |
| - | static char data[]= "dummy"; |
| + | static char testdata[]= "dummy"; |
| struct WriteThis { | |
| char *readptr; | |
| @@ -77,8 +77,8 @@ CURLcode test(char *URL) | |
| test_setopt(easy, CURLOPT_HEADER, 1L); | |
| /* Prepare the callback structures. */ | |
| - | pooh1.readptr = data; |
| - | pooh1.sizeleft = (curl_off_t) strlen(data); |
| + | pooh1.readptr = testdata; |
| + | pooh1.sizeleft = (curl_off_t) strlen(testdata); |
| pooh2 = pooh1; | |
| /* Build the mime tree. */ | |
| @@ -86,7 +86,7 @@ CURLcode test(char *URL) | |
| part = curl_mime_addpart(mime); | |
| curl_mime_name(part, "field1"); | |
| /* Early end of data detection can be done because the data size is known. */ | |
| - | curl_mime_data_cb(part, (curl_off_t) strlen(data), |
| + | curl_mime_data_cb(part, (curl_off_t) strlen(testdata), |
| read_callback, NULL, NULL, &pooh1); | |
| part = curl_mime_addpart(mime); | |
| curl_mime_name(part, "field2"); | |
| @@ -30,7 +30,7 @@ | |
| #define PAUSE_TIME 5 | |
| - | static const char name[] = "field"; |
| + | static const char testname[] = "field"; |
| struct ReadThis { | |
| CURL *easy; | |
| @@ -139,7 +139,7 @@ CURLcode test(char *URL) | |
| /* Build the mime tree. */ | |
| mime = curl_mime_init(pooh.easy); | |
| part = curl_mime_addpart(mime); | |
| - | res = curl_mime_name(part, name); |
| + | res = curl_mime_name(part, testname); |
| if(res != CURLE_OK) { | |
| fprintf(stderr, | |
| "Something went wrong when building the mime structure: %d\n", | |
| @@ -157,7 +157,7 @@ CURLcode test(char *URL) | |
| CURL_IGNORE_DEPRECATION( | |
| /* Build the form. */ | |
| formrc = curl_formadd(&formpost, &lastptr, | |
| - | CURLFORM_COPYNAME, name, |
| + | CURLFORM_COPYNAME, testname, |
| CURLFORM_STREAM, &pooh, | |
| CURLFORM_CONTENTLEN, (curl_off_t) 2, | |
| CURLFORM_END); | |
| @@ -27,7 +27,7 @@ | |
| #include "warnless.h" | |
| #include "memdebug.h" | |
| - | static const char cmd[] = "A1 IDLE\r\n"; |
| + | static const char testcmd[] = "A1 IDLE\r\n"; |
| static char testbuf[1024]; | |
| CURLcode test(char *URL) | |
| @@ -82,7 +82,8 @@ CURLcode test(char *URL) | |
| if(!state) { | |
| CURLcode ec; | |
| - | ec = curl_easy_send(curl, cmd + pos, sizeof(cmd) - 1 - pos, &len); |
| + | ec = curl_easy_send(curl, testcmd + pos, |
| + | sizeof(testcmd) - 1 - pos, &len); |
| if(ec == CURLE_AGAIN) { | |
| continue; | |
| } | |
| @@ -96,7 +97,7 @@ CURLcode test(char *URL) | |
| pos += len; | |
| else | |
| pos = 0; | |
| - | if(pos == sizeof(cmd) - 1) { |
| + | if(pos == sizeof(testcmd) - 1) { |
| state++; | |
| pos = 0; | |
| } | |
| @@ -33,31 +33,31 @@ | |
| #define TEST_HANG_TIMEOUT 60 * 1000 | |
| #define MAX_EASY_HANDLES 3 | |
| - | static int counter[MAX_EASY_HANDLES]; |
| - | static CURL *easy[MAX_EASY_HANDLES]; |
| - | static curl_socket_t sockets[MAX_EASY_HANDLES]; |
| - | static CURLcode res = CURLE_OK; |
| + | static int ntlm_counter[MAX_EASY_HANDLES]; |
| + | static CURL *ntlm_easy[MAX_EASY_HANDLES]; |
| + | static curl_socket_t ntlm_sockets[MAX_EASY_HANDLES]; |
| + | static CURLcode ntlmcb_res = CURLE_OK; |
| static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) | |
| { | |
| - | ssize_t idx = ((CURL **) data) - easy; |
| + | ssize_t idx = ((CURL **) data) - ntlm_easy; |
| curl_socket_t sock; | |
| long longdata; | |
| CURLcode code; | |
| const size_t failure = (size && nmemb) ? 0 : 1; | |
| (void)ptr; | |
| - | counter[idx] += (int)(size * nmemb); |
| + | ntlm_counter[idx] += (int)(size * nmemb); |
| /* Get socket being used for this easy handle, otherwise CURL_SOCKET_BAD */ | |
| CURL_IGNORE_DEPRECATION( | |
| - | code = curl_easy_getinfo(easy[idx], CURLINFO_LASTSOCKET, &longdata); |
| + | code = curl_easy_getinfo(ntlm_easy[idx], CURLINFO_LASTSOCKET, &longdata); |
| ) | |
| if(CURLE_OK != code) { | |
| fprintf(stderr, "%s:%d curl_easy_getinfo() failed, " | |
| "with code %d (%s)\n", | |
| __FILE__, __LINE__, (int)code, curl_easy_strerror(code)); | |
| - | res = TEST_ERR_MAJOR_BAD; |
| + | ntlmcb_res = TEST_ERR_MAJOR_BAD; |
| return failure; | |
| } | |
| if(longdata == -1L) | |
| @@ -67,16 +67,16 @@ static size_t callback(char *ptr, size_t size, size_t nmemb, void *data) | |
| if(sock != CURL_SOCKET_BAD) { | |
| /* Track relationship between this easy handle and the socket. */ | |
| - | if(sockets[idx] == CURL_SOCKET_BAD) { |
| + | if(ntlm_sockets[idx] == CURL_SOCKET_BAD) { |
| /* An easy handle without previous socket, record the socket. */ | |
| - | sockets[idx] = sock; |
| + | ntlm_sockets[idx] = sock; |
| } | |
| - | else if(sock != sockets[idx]) { |
| + | else if(sock != ntlm_sockets[idx]) { |
| /* An easy handle with a socket different to previously | |
| tracked one, log and fail right away. Known bug #37. */ | |
| fprintf(stderr, "Handle %d started on socket %d and moved to %d\n", | |
| - | curlx_sztosi(idx), (int)sockets[idx], (int)sock); |
| - | res = TEST_ERR_MAJOR_BAD; |
| + | curlx_sztosi(idx), (int)ntlm_sockets[idx], (int)sock); |
| + | ntlmcb_res = TEST_ERR_MAJOR_BAD; |
| return failure; | |
| } | |
| } | |
| @@ -91,6 +91,7 @@ enum HandleState { | |
| CURLcode test(char *url) | |
| { | |
| + | CURLcode res = CURLE_OK; |
| CURLM *multi = NULL; | |
| int running; | |
| int i; | |
| @@ -107,8 +108,8 @@ CURLcode test(char *url) | |
| } | |
| for(i = 0; i < MAX_EASY_HANDLES; ++i) { | |
| - | easy[i] = NULL; |
| - | sockets[i] = CURL_SOCKET_BAD; |
| + | ntlm_easy[i] = NULL; |
| + | ntlm_sockets[i] = CURL_SOCKET_BAD; |
| } | |
| res_global_init(CURL_GLOBAL_ALL); | |
| @@ -130,28 +131,31 @@ CURLcode test(char *url) | |
| /* Start a new handle if we aren't at the max */ | |
| if(state == ReadyForNewHandle) { | |
| - | easy_init(easy[num_handles]); |
| + | easy_init(ntlm_easy[num_handles]); |
| if(num_handles % 3 == 2) { | |
| msnprintf(full_url, urllen, "%s0200", url); | |
| - | easy_setopt(easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_NTLM); |
| } | |
| else { | |
| msnprintf(full_url, urllen, "%s0100", url); | |
| - | easy_setopt(easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPAUTH, CURLAUTH_BASIC); |
| } | |
| - | easy_setopt(easy[num_handles], CURLOPT_FRESH_CONNECT, 1L); |
| - | easy_setopt(easy[num_handles], CURLOPT_URL, full_url); |
| - | easy_setopt(easy[num_handles], CURLOPT_VERBOSE, 1L); |
| - | easy_setopt(easy[num_handles], CURLOPT_HTTPGET, 1L); |
| - | easy_setopt(easy[num_handles], CURLOPT_USERPWD, "testuser:testpass"); |
| - | easy_setopt(easy[num_handles], CURLOPT_WRITEFUNCTION, callback); |
| - | easy_setopt(easy[num_handles], CURLOPT_WRITEDATA, easy + num_handles); |
| - | easy_setopt(easy[num_handles], CURLOPT_HEADER, 1L); |
| - | |
| - | multi_add_handle(multi, easy[num_handles]); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_FRESH_CONNECT, 1L); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_URL, full_url); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_VERBOSE, 1L); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_HTTPGET, 1L); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_USERPWD, |
| + | "testuser:testpass"); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_WRITEFUNCTION, callback); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_WRITEDATA, |
| + | ntlm_easy + num_handles); |
| + | easy_setopt(ntlm_easy[num_handles], CURLOPT_HEADER, 1L); |
| + | |
| + | multi_add_handle(multi, ntlm_easy[num_handles]); |
| num_handles += 1; | |
| state = NeedSocketForNewHandle; | |
| + | res = ntlmcb_res; |
| } | |
| multi_perform(multi, &running); | |
| @@ -223,9 +227,9 @@ test_cleanup: | |
| /* proper cleanup sequence - type PB */ | |
| for(i = 0; i < MAX_EASY_HANDLES; i++) { | |
| - | printf("Data connection %d: %d\n", i, counter[i]); |
| - | curl_multi_remove_handle(multi, easy[i]); |
| - | curl_easy_cleanup(easy[i]); |
| + | printf("Data connection %d: %d\n", i, ntlm_counter[i]); |
| + | curl_multi_remove_handle(multi, ntlm_easy[i]); |
| + | curl_easy_cleanup(ntlm_easy[i]); |
| } | |
| curl_multi_cleanup(multi); | |
| @@ -201,7 +201,7 @@ print <<HEADER | |
| /* This source code is generated by mk-lib1521.pl ! */ | |
| - | struct data { |
| + | struct testdata { |
| char *blaha; | |
| }; | |
| @@ -332,7 +332,7 @@ CURLcode test(char *URL) | |
| struct curl_httppost *httppost = NULL; | |
| curl_mime *mimepost = NULL; | |
| FILE *stream = stderr; | |
| - | struct data object; |
| + | struct testdata object; |
| char *charp; | |
| long val; | |
| curl_off_t oval; | |
| @@ -70,8 +70,10 @@ extern int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc, | |
| extern void wait_ms(int ms); /* wait this many milliseconds */ | |
| + | #ifndef CURLTESTS_BUNDLED_TEST_H |
| extern CURLcode test(char *URL); /* the actual test function provided by each | |
| individual libXXX.c file */ | |
| + | #endif |
| extern char *hexdump(const unsigned char *buffer, size_t len); | |
| @@ -491,6 +493,7 @@ extern int unitfail; | |
| #define global_init(A) \ | |
| chk_global_init((A), (__FILE__), (__LINE__)) | |
| + | #ifndef CURLTESTS_BUNDLED_TEST_H |
| #define NO_SUPPORT_BUILT_IN \ | |
| CURLcode test(char *URL) \ | |
| { \ | |
| @@ -498,7 +501,22 @@ extern int unitfail; | |
| fprintf(stderr, "Missing support\n"); \ | |
| return (CURLcode)1; \ | |
| } | |
| + | #endif |
| /* ---------------------------------------------------------------- */ | |
| #endif /* HEADER_CURL_TEST_H */ | |
| + | |
| + | #ifdef CURLTESTS_BUNDLED_TEST_H |
| + | extern CURLcode test(char *URL); /* the actual test function provided by each |
| + | individual libXXX.c file */ |
| + | |
| + | #undef NO_SUPPORT_BUILT_IN |
| + | #define NO_SUPPORT_BUILT_IN \ |
| + | CURLcode test(char *URL) \ |
| + | { \ |
| + | (void)URL; \ |
| + | fprintf(stderr, "Missing support\n"); \ |
| + | return (CURLcode)1; \ |
| + | } |
| + | #endif |
| @@ -0,0 +1,74 @@ | |
| + | #!/usr/bin/env bash |
| + | #*************************************************************************** |
| + | # _ _ ____ _ |
| + | # Project ___| | | | _ \| | |
| + | # / __| | | | |_) | | |
| + | # | (__| |_| | _ <| |___ |
| + | # \___|\___/|_| \_\_____| |
| + | # |
| + | # Copyright (C) Viktor Szakats |
| + | # |
| + | # This software is licensed as described in the file COPYING, which |
| + | # you should have received as part of this distribution. The terms |
| + | # are also available at https://curl.se/docs/copyright.html. |
| + | # |
| + | # You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| + | # copies of the Software, and permit persons to whom the Software is |
| + | # furnished to do so, under the terms of the COPYING file. |
| + | # |
| + | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| + | # KIND, either express or implied. |
| + | # |
| + | # SPDX-License-Identifier: curl |
| + | # |
| + | ########################################################################### |
| + | |
| + | detect_in_reused_sources=1 |
| + | |
| + | if [ "$detect_in_reused_sources" = '1' ]; then |
| + | # Make symlinks for all re-used sources |
| + | grep -E '^(lib|unit)[0-9]+_SOURCES = ' libtest/Makefile.inc unit/Makefile.inc \ |
| + | | sed -E 's@^([a-z]+)/[a-zA-Z.]+:(lib|unit)([0-9]+)_SOURCES = (lib|unit)([0-9]+).+@\1 \2 \3 \5@g' | \ |
| + | while read -r l; do |
| + | if [[ "${l}" =~ ([a-z]+)\ ([a-z]+)\ ([0-9]+)\ ([0-9]+) ]]; then |
| + | trg="${BASH_REMATCH[3]}" |
| + | src="${BASH_REMATCH[4]}" |
| + | if [ "${trg}" != "${src}" ]; then |
| + | dir="${BASH_REMATCH[1]}" |
| + | pfx="${BASH_REMATCH[2]}" |
| + | ln -s "${pfx}${src}.c" "${dir}/${pfx}${trg}.c" |
| + | fi |
| + | fi |
| + | done |
| + | fi |
| + | |
| + | # Look for symbols possibly re-used in multiple sources. |
| + | # |
| + | # Falsely picks ups symbols in re-used sources, but guarded for a single use. |
| + | # Misses shadowed variables. |
| + | # shellcheck disable=SC2046 |
| + | grep -E '^ *(static|struct) +' $(find libtest unit -maxdepth 1 -name 'lib*.c' -o -name 'unit*.c' -o -name 'mk-*.pl') \ |
| + | | grep -E '^(libtest|unit)/' \ |
| + | | grep -E '\.(c|pl):(static|struct)( +[a-zA-Z_* ]+)? +[a-zA-Z_][a-zA-Z0-9_]+ *' | sort -u \ |
| + | | grep -o -E '[a-zA-Z_][a-zA-Z0-9_]+ *[=;[({]' | tr -d '=;[({ ' \ |
| + | | grep -v -E '^(NULL$|sizeof$|CURLE_)' \ |
| + | | sort | uniq -c | sort -k 2 | grep -v -E '^ +1 ' \ |
| + | | awk '{print " \"" $2 "\","}' |
| + | |
| + | echo '---' |
| + | |
| + | # Extract list of macros that may be re-used by multiple tests. |
| + | # |
| + | # Picks up false-positive when the macro is defined to the same value everywhere. |
| + | # shellcheck disable=SC2046 |
| + | grep -E '^ *# *define +' $(find libtest unit -maxdepth 1 -name 'lib*.c' -o -name 'unit*.c' -o -name 'mk-*.pl') \ |
| + | | grep -E '^(libtest|unit)/' \ |
| + | | grep -o -E '.+\.(c|pl): *# *define +[A-Z_][A-Z0-9_]+' | sort -u \ |
| + | | grep -o -E '[A-Z_][A-Z0-9_]+' \ |
| + | | sort | uniq -c | sort -k 2 | grep -v -E '^ +1 ' \ |
| + | | awk '{print " \"" $2 "\","}' |
| + | |
| + | if [ "$detect_in_reused_sources" = '1' ]; then |
| + | # Delete symlinks for all re-used sources |
| + | find libtest unit -type l -delete |
| + | fi |
| @@ -0,0 +1,162 @@ | |
| + | #!/usr/bin/env perl |
| + | #*************************************************************************** |
| + | # _ _ ____ _ |
| + | # Project ___| | | | _ \| | |
| + | # / __| | | | |_) | | |
| + | # | (__| |_| | _ <| |___ |
| + | # \___|\___/|_| \_\_____| |
| + | # |
| + | # Copyright (C) Viktor Szakats |
| + | # |
| + | # This software is licensed as described in the file COPYING, which |
| + | # you should have received as part of this distribution. The terms |
| + | # are also available at https://curl.se/docs/copyright.html. |
| + | # |
| + | # You may opt to use, copy, modify, merge, publish, distribute and/or sell |
| + | # copies of the Software, and permit persons to whom the Software is |
| + | # furnished to do so, under the terms of the COPYING file. |
| + | # |
| + | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| + | # KIND, either express or implied. |
| + | # |
| + | # SPDX-License-Identifier: curl |
| + | # |
| + | ########################################################################### |
| + | |
| + | # Bundle up individual tests into a single binary. The resulting binary can run |
| + | # individual tests by passing their name (without '.c') as the first argument. |
| + | # |
| + | # Usage: mk-bundle.pl [<directory>] |
| + | |
| + | use strict; |
| + | use warnings; |
| + | |
| + | my $src_dir = @ARGV ? $ARGV[0] : "."; |
| + | |
| + | # Read list of tests |
| + | open my $fh, "<", "$src_dir/Makefile.inc" or die "Cannot open '$src_dir/Makefile.inc': $!"; |
| + | |
| + | print <<HEADER |
| + | /* !checksrc! disable COPYRIGHT all */ |
| + | /* !checksrc! disable INCLUDEDUP all */ |
| + | |
| + | #define CURLTESTS_BUNDLED |
| + | #define CURLTESTS_BUNDLED_TEST_H |
| + | #include "first.h" |
| + | HEADER |
| + | ; |
| + | |
| + | # TODO: Some of these might be subject for de-duplication or sync. |
| + | my @reused_symbols = ( |
| + | "ReadThis", |
| + | "ReadWriteSockets", |
| + | "Sockets", |
| + | "Tdata", |
| + | "WriteThis", |
| + | "addFd", |
| + | "checkFdSet", |
| + | "checkForCompletion", |
| + | "close_file_descriptors", |
| + | "curl", # shadow |
| + | "curlSocketCallback", |
| + | "curlTimerCallback", |
| + | "cyclic_add", |
| + | "easy", # unit |
| + | "fopen_works", |
| + | "getMicroSecondTimeout", |
| + | "geterr", |
| + | "hash_static", # unit |
| + | "header_callback", |
| + | "ioctlcallback", |
| + | "msgbuff", |
| + | "mydtor", # unit |
| + | "num_open", |
| + | "progress_callback", |
| + | "read_callback", |
| + | "readcallback", |
| + | "recv_pong", |
| + | "removeFd", |
| + | "rlim2str", |
| + | "run_thread", |
| + | "send_ping", |
| + | "showem", |
| + | "store_errmsg", |
| + | "suburl", |
| + | "test_failure", # shadow |
| + | "test_fire", |
| + | "test_lock", |
| + | "test_once", |
| + | "test_parse", # unit |
| + | "test_rlimit", |
| + | "test_unlock", |
| + | "testbuf", |
| + | "testcase", # unit |
| + | "testdata", |
| + | "testfd", |
| + | "testname", |
| + | "testpost", |
| + | "tests", # unit |
| + | "teststring", |
| + | "trailers_callback", |
| + | "transfer_status", |
| + | "unit_setup", # unit |
| + | "unit_stop", # unit |
| + | "updateFdSet", |
| + | "userdata", |
| + | "websocket", |
| + | "websocket_close", |
| + | "write_callback", |
| + | "write_cb", |
| + | "writecb", |
| + | "xferinfo", |
| + | ); |
| + | |
| + | # TODO: Some of these may be #undef-ed manually at the end of each source |
| + | my @reused_macros = ( |
| + | "HEADER_REQUEST", |
| + | "NUM_HANDLES", |
| + | "SAFETY_MARGIN", |
| + | "TEST_HANG_TIMEOUT", |
| + | ); |
| + | |
| + | my $tlist = ""; |
| + | |
| + | while(my $line = <$fh>) { |
| + | chomp $line; |
| + | if($line =~ /([a-z0-9]+)_SOURCES\ =\ ([a-z0-9]+)\.c/) { |
| + | my $name = $1; |
| + | my $namu = uc($name); |
| + | my $src = "$2.c"; |
| + | |
| + | # Make common symbols unique across test sources |
| + | foreach my $symb ("test", @reused_symbols) { |
| + | print "#undef $symb\n"; |
| + | print "#define $symb ${symb}_$name\n"; |
| + | } |
| + | |
| + | print "#define $namu\n"; |
| + | print "#include \"$src\"\n"; |
| + | print "#undef $namu\n"; |
| + | |
| + | # Reset macros re-used by multiple tests |
| + | foreach my $undef ("test", @reused_macros) { |
| + | print "#undef $undef\n"; |
| + | } |
| + | |
| + | print "\n"; |
| + | |
| + | $tlist .= " {\"$name\", test_$name},\n"; |
| + | } |
| + | } |
| + | |
| + | close $fh; |
| + | |
| + | print <<FOOTER |
| + | static const struct onetest s_tests[] = { |
| + | $tlist}; |
| + | |
| + | #undef CURLTESTS_BUNDLED_TEST_H |
| + | |
| + | #include "first.c" |
| + | FOOTER |
| + | ; |
| @@ -848,10 +848,11 @@ sub singletest_run { | |
| my @codepieces = getpart("client", "tool"); | |
| my $tool=""; | |
| + | my $tool_name=""; # without exe extension |
| if(@codepieces) { | |
| - | $tool = $codepieces[0]; |
| - | chomp $tool; |
| - | $tool .= exe_ext('TOOL'); |
| + | $tool_name = $codepieces[0]; |
| + | chomp $tool_name; |
| + | $tool = $tool_name . exe_ext('TOOL'); |
| } | |
| my $disablevalgrind; | |
| @@ -904,20 +905,36 @@ sub singletest_run { | |
| # Default the tool to a unit test with the same name as the test spec | |
| if($keywords{"unittest"} && !$tool) { | |
| - | $tool="unit$testnum"; |
| + | $tool_name="unit$testnum"; |
| + | $tool = $tool_name; |
| } | |
| if($tool =~ /^lib/) { | |
| - | $CMDLINE="$LIBDIR/$tool"; |
| + | if($bundle) { |
| + | $CMDLINE="$LIBDIR/libtests"; |
| + | } |
| + | else { |
| + | $CMDLINE="$LIBDIR/$tool"; |
| + | } |
| } | |
| elsif($tool =~ /^unit/) { | |
| - | $CMDLINE="$UNITDIR/$tool"; |
| + | if($bundle) { |
| + | $CMDLINE="$UNITDIR/units"; |
| + | } |
| + | else { |
| + | $CMDLINE="$UNITDIR/$tool"; |
| + | } |
| } | |
| if(! -f $CMDLINE) { | |
| logmsg " $testnum: IGNORED: The tool set in the test case for this: '$tool' does not exist\n"; | |
| return (-1, 0, 0, "", "", 0); | |
| } | |
| + | |
| + | if($bundle) { |
| + | $CMDLINE.=" $tool_name"; |
| + | } |
| + | |
| $DBGCURL=$CMDLINE; | |
| } | |
| @@ -91,6 +91,11 @@ Provide a path to a curl binary to talk to APIs (currently only CI test APIs). | |
| Display test results in automake style output (`PASS/FAIL: [number] [name]`). | |
| + | ## `-bundle` |
| + | |
| + | Run tests via bundled test binaries. Bundled test binaries contain all tests, |
| + | and the test name passed as the first argument selects which test run. |
| + | |
| ## `-c\<curl\>` | |
| Provide a path to a custom curl binary to run the tests with. Default is the | |
| @@ -869,8 +869,9 @@ sub checksystemfeatures { | |
| "*\n"); | |
| } | |
| - | logmsg sprintf("* Env: %s%s%s", $valgrind?"Valgrind ":"", |
| + | logmsg sprintf("* Env: %s%s%s%s", $valgrind?"Valgrind ":"", |
| $run_event_based?"event-based ":"", | |
| + | $bundle?"bundle ":"", |
| $nghttpx_h3); | |
| logmsg sprintf("%s\n", $libtool?"Libtool ":""); | |
| logmsg ("* Seed: $randseed\n"); | |
| @@ -2240,6 +2241,10 @@ while(@ARGV) { | |
| $ACURL=shell_quote($ARGV[1]); | |
| shift @ARGV; | |
| } | |
| + | elsif ($ARGV[0] eq "-bundle") { |
| + | # use test bundles |
| + | $bundle=1; |
| + | } |
| elsif ($ARGV[0] eq "-d") { | |
| # have the servers display protocol output | |
| $debugprotocol=1; | |
| @@ -2417,6 +2422,7 @@ Usage: runtests.pl [options] [test selection(s)] | |
| -a continue even if a test fails | |
| -ac path use this curl only to talk to APIs (currently only CI test APIs) | |
| -am automake style output PASS/FAIL: [number] [name] | |
| + | -bundle use test bundles |
| -c path use this curl executable | |
| -d display server debug info | |
| -e event-based execution | |
| @@ -3,3 +3,4 @@ | |
| # SPDX-License-Identifier: curl | |
| /unit[0-9][0-9][0-9][0-9] | |
| + | units.c |
| @@ -22,13 +22,26 @@ | |
| # | |
| ########################################################################### | |
| - | # Get 'UNITPROGS', 'UNITFILES' variables |
| + | # Get 'UNITPROGS', '*_SOURCES', 'FIRSTFILES' variables |
| transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") | |
| + | if(CURL_TEST_BUNDLES) |
| + | add_custom_command( |
| + | OUTPUT "unit_bundle.c" |
| + | COMMAND ${PERL_EXECUTABLE} "${CURL_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "unit_bundle.c" |
| + | DEPENDS |
| + | "${CURL_SOURCE_DIR}/tests/mk-bundle.pl" ${FIRSTFILES} |
| + | "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" |
| + | VERBATIM) |
| + | |
| + | set(UNITPROGS "units") |
| + | set(units_SOURCES "unit_bundle.c") |
| + | endif() |
| + | |
| foreach(_target IN LISTS UNITPROGS) | |
| set(_target_name "${_target}") | |
| - | add_executable(${_target_name} EXCLUDE_FROM_ALL "${_target}.c" ${UNITFILES}) |
| + | add_executable(${_target_name} EXCLUDE_FROM_ALL ${${_target}_SOURCES}) |
| add_dependencies(testdeps ${_target_name}) | |
| target_link_libraries(${_target_name} curltool curlu) | |
| target_include_directories(${_target_name} PRIVATE | |
| @@ -37,6 +50,9 @@ foreach(_target IN LISTS UNITPROGS) | |
| "${CURL_SOURCE_DIR}/src" | |
| "${CURL_SOURCE_DIR}/tests/libtest" | |
| ) | |
| + | if(CURL_TEST_BUNDLES) |
| + | target_include_directories(${_target_name} PRIVATE "${CURL_SOURCE_DIR}/tests/unit") |
| + | endif() |
| set_target_properties(${_target_name} PROPERTIES | |
| OUTPUT_NAME "${_target}" | |
| PROJECT_LABEL "Test unit ${_target}") | |
| @@ -36,7 +36,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ | |
| -I$(top_builddir)/lib \ | |
| -I$(top_srcdir)/lib \ | |
| -I$(top_srcdir)/src \ | |
| - | -I$(top_srcdir)/tests/libtest |
| + | -I$(top_srcdir)/tests/libtest \ |
| + | -I$(top_srcdir)/tests/unit |
| EXTRA_DIST = CMakeLists.txt README.md | |
| @@ -51,19 +52,27 @@ LDADD = $(top_builddir)/src/libcurltool.la \ | |
| AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS | |
| - | CHECKSRC = $(CS_$(V)) |
| - | CS_0 = @echo " RUN " $@; |
| - | CS_1 = |
| - | CS_ = $(CS_0) |
| - | |
| - | checksrc: |
| - | $(CHECKSRC)@PERL@ $(top_srcdir)/scripts/checksrc.pl $(srcdir)/*.[ch] |
| + | if BUILD_UNITTESTS |
| + | if USE_TEST_BUNDLES |
| + | unit_bundle.c: $(top_srcdir)/tests/mk-bundle.pl |
| + | @PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > unit_bundle.c |
| + | noinst_PROGRAMS = units |
| + | nodist_units_SOURCES = unit_bundle.c |
| + | CLEANFILES = unit_bundle.c |
| + | else |
| # Makefile.inc provides neat definitions | |
| include Makefile.inc | |
| - | |
| - | if BUILD_UNITTESTS |
| noinst_PROGRAMS = $(UNITPROGS) | |
| + | endif |
| else | |
| noinst_PROGRAMS = | |
| endif | |
| + | |
| + | CHECKSRC = $(CS_$(V)) |
| + | CS_0 = @echo " RUN " $@; |
| + | CS_1 = |
| + | CS_ = $(CS_0) |
| + | |
| + | checksrc: |
| + | $(CHECKSRC)@PERL@ $(top_srcdir)/scripts/checksrc.pl $(srcdir)/*.[ch] |
| @@ -24,9 +24,11 @@ | |
| # these files are used in every single unit test program | |
| - | UNITFILES = curlcheck.h \ |
| - | ../libtest/test.h \ |
| - | ../libtest/first.c |
| + | FIRSTFILES = \ |
| + | ../libtest/first.c \ |
| + | ../libtest/first.h |
| + | |
| + | UNITFILES = curlcheck.h $(FIRSTFILES) |
| # These are all unit test programs | |
| UNITPROGS = unit1300 unit1302 unit1303 unit1304 unit1305 unit1307 \ | |
| @@ -28,15 +28,15 @@ | |
| #include "curl_base64.h" | |
| #include "memdebug.h" /* LAST include file */ | |
| - | static struct Curl_easy *data; |
| + | static struct Curl_easy *testdata; |
| static CURLcode unit_setup(void) | |
| { | |
| CURLcode res = CURLE_OK; | |
| global_init(CURL_GLOBAL_ALL); | |
| - | data = curl_easy_init(); |
| - | if(!data) { |
| + | testdata = curl_easy_init(); |
| + | if(!testdata) { |
| curl_global_cleanup(); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -45,7 +45,7 @@ static CURLcode unit_setup(void) | |
| static void unit_stop(void) | |
| { | |
| - | curl_easy_cleanup(data); |
| + | curl_easy_cleanup(testdata); |
| curl_global_cleanup(); | |
| } | |
| @@ -27,15 +27,15 @@ | |
| #include "connect.h" | |
| #include "memdebug.h" /* LAST include file */ | |
| - | static struct Curl_easy *data; |
| + | static struct Curl_easy *testdata; |
| static CURLcode unit_setup(void) | |
| { | |
| CURLcode res = CURLE_OK; | |
| global_init(CURL_GLOBAL_ALL); | |
| - | data = curl_easy_init(); |
| - | if(!data) { |
| + | testdata = curl_easy_init(); |
| + | if(!testdata) { |
| curl_global_cleanup(); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -44,7 +44,7 @@ static CURLcode unit_setup(void) | |
| static void unit_stop(void) | |
| { | |
| - | curl_easy_cleanup(data); |
| + | curl_easy_cleanup(testdata); |
| curl_global_cleanup(); | |
| } | |
| @@ -55,7 +55,8 @@ static void unit_stop(void) | |
| /* macro to set the pretended current time */ | |
| #define NOW(x,y) now.tv_sec = x; now.tv_usec = y | |
| /* macro to set the millisecond based timeouts to use */ | |
| - | #define TIMEOUTS(x,y) data->set.timeout = x; data->set.connecttimeout = y |
| + | #define TIMEOUTS(x,y) testdata->set.timeout = x; \ |
| + | testdata->set.connecttimeout = y |
| /* | |
| * To test: | |
| @@ -136,16 +137,16 @@ UNITTEST_START | |
| }; | |
| /* this is the pretended start time of the transfer */ | |
| - | data->progress.t_startsingle.tv_sec = BASE; |
| - | data->progress.t_startsingle.tv_usec = 0; |
| - | data->progress.t_startop.tv_sec = BASE; |
| - | data->progress.t_startop.tv_usec = 0; |
| + | testdata->progress.t_startsingle.tv_sec = BASE; |
| + | testdata->progress.t_startsingle.tv_usec = 0; |
| + | testdata->progress.t_startop.tv_sec = BASE; |
| + | testdata->progress.t_startop.tv_usec = 0; |
| for(i = 0; i < sizeof(run)/sizeof(run[0]); i++) { | |
| timediff_t timeout; | |
| NOW(run[i].now_s, run[i].now_us); | |
| TIMEOUTS(run[i].timeout_ms, run[i].connecttimeout_ms); | |
| - | timeout = Curl_timeleft(data, &now, run[i].connecting); |
| + | timeout = Curl_timeleft(testdata, &now, run[i].connecting); |
| if(timeout != run[i].result) | |
| fail(run[i].comment); | |
| } | |
| @@ -27,16 +27,16 @@ | |
| #ifndef CURL_DISABLE_NETRC | |
| - | static char *login; |
| - | static char *password; |
| + | static char *s_login; |
| + | static char *s_password; |
| static CURLcode unit_setup(void) | |
| { | |
| - | password = strdup(""); |
| - | login = strdup(""); |
| - | if(!password || !login) { |
| - | Curl_safefree(password); |
| - | Curl_safefree(login); |
| + | s_password = strdup(""); |
| + | s_login = strdup(""); |
| + | if(!s_password || !s_login) { |
| + | Curl_safefree(s_password); |
| + | Curl_safefree(s_login); |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| return CURLE_OK; | |
| @@ -44,8 +44,8 @@ static CURLcode unit_setup(void) | |
| static void unit_stop(void) | |
| { | |
| - | Curl_safefree(password); |
| - | Curl_safefree(login); |
| + | Curl_safefree(s_password); |
| + | Curl_safefree(s_login); |
| } | |
| UNITTEST_START | |
| @@ -54,133 +54,133 @@ UNITTEST_START | |
| /* | |
| * Test a non existent host in our netrc file. | |
| */ | |
| - | result = Curl_parsenetrc("test.example.com", &login, &password, arg); |
| + | result = Curl_parsenetrc("test.example.com", &s_login, &s_password, arg); |
| fail_unless(result == 1, "Host not found should return 1"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(password[0] == 0, "password should not have been changed"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(login[0] == 0, "login should not have been changed"); |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(s_password[0] == 0, "password should not have been changed"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(s_login[0] == 0, "login should not have been changed"); |
| /* | |
| * Test a non existent login in our netrc file. | |
| */ | |
| - | free(login); |
| - | login = strdup("me"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("example.com", &login, &password, arg); |
| + | free(s_login); |
| + | s_login = strdup("me"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(password[0] == 0, "password should not have been changed"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "me", 2) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(s_password[0] == 0, "password should not have been changed"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "me", 2) == 0, |
| "login should not have been changed"); | |
| /* | |
| * Test a non existent login and host in our netrc file. | |
| */ | |
| - | free(login); |
| - | login = strdup("me"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("test.example.com", &login, &password, arg); |
| + | free(s_login); |
| + | s_login = strdup("me"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("test.example.com", &s_login, &s_password, arg); |
| fail_unless(result == 1, "Host not found should return 1"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(password[0] == 0, "password should not have been changed"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "me", 2) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(s_password[0] == 0, "password should not have been changed"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "me", 2) == 0, |
| "login should not have been changed"); | |
| /* | |
| * Test a non existent login (substring of an existing one) in our | |
| * netrc file. | |
| */ | |
| - | free(login); |
| - | login = strdup("admi"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("example.com", &login, &password, arg); |
| + | free(s_login); |
| + | s_login = strdup("admi"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(password[0] == 0, "password should not have been changed"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "admi", 4) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(s_password[0] == 0, "password should not have been changed"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "admi", 4) == 0, |
| "login should not have been changed"); | |
| /* | |
| * Test a non existent login (superstring of an existing one) | |
| * in our netrc file. | |
| */ | |
| - | free(login); |
| - | login = strdup("adminn"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("example.com", &login, &password, arg); |
| + | free(s_login); |
| + | s_login = strdup("adminn"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(password[0] == 0, "password should not have been changed"); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "adminn", 6) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(s_password[0] == 0, "password should not have been changed"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "adminn", 6) == 0, |
| "login should not have been changed"); | |
| /* | |
| * Test for the first existing host in our netrc file | |
| - | * with login[0] = 0. |
| + | * with s_login[0] = 0. |
| */ | |
| - | free(login); |
| - | login = strdup(""); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("example.com", &login, &password, arg); |
| + | free(s_login); |
| + | s_login = strdup(""); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(password, "passwd", 6) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_password, "passwd", 6) == 0, |
| "password should be 'passwd'"); | |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "admin", 5) == 0, "login should be 'admin'"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "admin", 5) == 0, "login should be 'admin'"); |
| /* | |
| * Test for the first existing host in our netrc file | |
| - | * with login[0] != 0. |
| + | * with s_login[0] != 0. |
| */ | |
| - | free(password); |
| - | password = strdup(""); |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("example.com", &login, &password, arg); |
| + | free(s_password); |
| + | s_password = strdup(""); |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(password, "passwd", 6) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_password, "passwd", 6) == 0, |
| "password should be 'passwd'"); | |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "admin", 5) == 0, "login should be 'admin'"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "admin", 5) == 0, "login should be 'admin'"); |
| /* | |
| * Test for the second existing host in our netrc file | |
| - | * with login[0] = 0. |
| + | * with s_login[0] = 0. |
| */ | |
| - | free(password); |
| - | password = strdup(""); |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | free(login); |
| - | login = strdup(""); |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("curl.example.com", &login, &password, arg); |
| + | free(s_password); |
| + | s_password = strdup(""); |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | free(s_login); |
| + | s_login = strdup(""); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("curl.example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(password, "none", 4) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_password, "none", 4) == 0, |
| "password should be 'none'"); | |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "none", 4) == 0, "login should be 'none'"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "none", 4) == 0, "login should be 'none'"); |
| /* | |
| * Test for the second existing host in our netrc file | |
| - | * with login[0] != 0. |
| + | * with s_login[0] != 0. |
| */ | |
| - | free(password); |
| - | password = strdup(""); |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | result = Curl_parsenetrc("curl.example.com", &login, &password, arg); |
| + | free(s_password); |
| + | s_password = strdup(""); |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | result = Curl_parsenetrc("curl.example.com", &s_login, &s_password, arg); |
| fail_unless(result == 0, "Host should have been found"); | |
| - | abort_unless(password != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(password, "none", 4) == 0, |
| + | abort_unless(s_password != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_password, "none", 4) == 0, |
| "password should be 'none'"); | |
| - | abort_unless(login != NULL, "returned NULL!"); |
| - | fail_unless(strncmp(login, "none", 4) == 0, "login should be 'none'"); |
| + | abort_unless(s_login != NULL, "returned NULL!"); |
| + | fail_unless(strncmp(s_login, "none", 4) == 0, "login should be 'none'"); |
| UNITTEST_STOP | |
| @@ -40,15 +40,15 @@ | |
| #include "memdebug.h" /* LAST include file */ | |
| - | static struct Curl_easy *data; |
| + | static struct Curl_easy *testdata; |
| static struct Curl_hash hp; | |
| static char *data_key; | |
| static struct Curl_dns_entry *data_node; | |
| static CURLcode unit_setup(void) | |
| { | |
| - | data = curl_easy_init(); |
| - | if(!data) { |
| + | testdata = curl_easy_init(); |
| + | if(!testdata) { |
| curl_global_cleanup(); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| @@ -66,7 +66,7 @@ static void unit_stop(void) | |
| free(data_key); | |
| Curl_hash_destroy(&hp); | |
| - | curl_easy_cleanup(data); |
| + | curl_easy_cleanup(testdata); |
| curl_global_cleanup(); | |
| } | |
| @@ -21,10 +21,13 @@ | |
| * SPDX-License-Identifier: curl | |
| * | |
| ***************************************************************************/ | |
| - | #define CURL_NO_FMT_CHECKS |
| - | |
| #include "curlcheck.h" | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic push |
| + | #pragma GCC diagnostic ignored "-Wformat" |
| + | #endif |
| + | |
| static CURLcode unit_setup(void) {return CURLE_OK;} | |
| static void unit_stop(void) {} | |
| @@ -182,3 +185,7 @@ rc = curl_msnprintf(output, 129, | |
| fail_unless(rc == 128, "return code should be 128"); | |
| UNITTEST_STOP | |
| + | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic pop |
| + | #endif |
| @@ -26,7 +26,7 @@ | |
| #include "speedcheck.h" | |
| #include "urldata.h" | |
| - | static CURL *easy; |
| + | static struct Curl_easy *easy; |
| static CURLcode unit_setup(void) | |
| { | |
| @@ -21,20 +21,24 @@ | |
| * SPDX-License-Identifier: curl | |
| * | |
| ***************************************************************************/ | |
| - | #define CURL_NO_FMT_CHECKS |
| - | |
| #include "curlcheck.h" | |
| #include "urldata.h" | |
| #include "sendf.h" | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic push |
| + | #pragma GCC diagnostic ignored "-Wformat" |
| + | #pragma GCC diagnostic ignored "-Wformat-zero-length" |
| + | #endif |
| + | |
| /* | |
| * This test hardcodes the knowledge of the buffer size which is internal to | |
| * Curl_infof(). If that buffer is changed in size, this tests needs to be | |
| * updated to still be valid. | |
| */ | |
| - | static struct Curl_easy *data; |
| + | static struct Curl_easy *testdata; |
| static char input[4096]; | |
| static char output[4096]; | |
| @@ -66,20 +70,20 @@ unit_setup(void) | |
| CURLcode res = CURLE_OK; | |
| global_init(CURL_GLOBAL_ALL); | |
| - | data = curl_easy_init(); |
| - | if(!data) { |
| + | testdata = curl_easy_init(); |
| + | if(!testdata) { |
| curl_global_cleanup(); | |
| return CURLE_OUT_OF_MEMORY; | |
| } | |
| - | curl_easy_setopt(data, CURLOPT_DEBUGFUNCTION, debugf_cb); |
| - | curl_easy_setopt(data, CURLOPT_VERBOSE, 1L); |
| + | curl_easy_setopt(testdata, CURLOPT_DEBUGFUNCTION, debugf_cb); |
| + | curl_easy_setopt(testdata, CURLOPT_VERBOSE, 1L); |
| return res; | |
| } | |
| static void | |
| unit_stop(void) | |
| { | |
| - | curl_easy_cleanup(data); |
| + | curl_easy_cleanup(testdata); |
| curl_global_cleanup(); | |
| } | |
| @@ -96,24 +100,24 @@ UNITTEST_START | |
| /* Injecting a simple short string via a format */ | |
| msnprintf(input, sizeof(input), "Simple Test"); | |
| - | Curl_infof(data, "%s", input); |
| + | Curl_infof(testdata, "%s", input); |
| fail_unless(verify(output, input) == 0, "Simple string test"); | |
| /* Injecting a few different variables with a format */ | |
| - | Curl_infof(data, "%s %u testing %lu", input, 42, 43L); |
| + | Curl_infof(testdata, "%s %u testing %lu", input, 42, 43L); |
| fail_unless(verify(output, "Simple Test 42 testing 43\n") == 0, | |
| "Format string"); | |
| /* Variations of empty strings */ | |
| - | Curl_infof(data, ""); |
| + | Curl_infof(testdata, ""); |
| fail_unless(strlen(output) == 1, "Empty string"); | |
| - | Curl_infof(data, "%s", (char *)NULL); |
| + | Curl_infof(testdata, "%s", (char *)NULL); |
| fail_unless(verify(output, "(nil)") == 0, "Passing NULL as string"); | |
| /* A string just long enough to not be truncated */ | |
| memset(input, '\0', sizeof(input)); | |
| memset(input, 'A', 2047); | |
| - | Curl_infof(data, "%s", input); |
| + | Curl_infof(testdata, "%s", input); |
| fail_unless(strlen(output) == 2048, "No truncation of infof input"); | |
| fail_unless(verify(output, input) == 0, "No truncation of infof input"); | |
| fail_unless(output[sizeof(output) - 1] == '\0', | |
| @@ -121,22 +125,26 @@ fail_unless(output[sizeof(output) - 1] == '\0', | |
| /* Just over the limit without newline for truncation via '...' */ | |
| memset(input + 2047, 'A', 4); | |
| - | Curl_infof(data, "%s", input); |
| + | Curl_infof(testdata, "%s", input); |
| fail_unless(strlen(output) == 2051, "Truncation of infof input 1"); | |
| fail_unless(output[sizeof(output) - 1] == '\0', "Truncation of infof input 1"); | |
| /* Just over the limit with newline for truncation via '...' */ | |
| memset(input + 2047, 'A', 4); | |
| memset(input + 2047 + 4, '\n', 1); | |
| - | Curl_infof(data, "%s", input); |
| + | Curl_infof(testdata, "%s", input); |
| fail_unless(strlen(output) == 2051, "Truncation of infof input 2"); | |
| fail_unless(output[sizeof(output) - 1] == '\0', "Truncation of infof input 2"); | |
| /* Way over the limit for truncation via '...' */ | |
| memset(input, '\0', sizeof(input)); | |
| memset(input, 'A', sizeof(input) - 1); | |
| - | Curl_infof(data, "%s", input); |
| + | Curl_infof(testdata, "%s", input); |
| fail_unless(strlen(output) == 2051, "Truncation of infof input 3"); | |
| fail_unless(output[sizeof(output) - 1] == '\0', "Truncation of infof input 3"); | |
| UNITTEST_STOP | |
| + | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic pop |
| + | #endif |
| @@ -44,6 +44,7 @@ static CURLcode unit_setup(void) | |
| static void unit_stop(void) | |
| { | |
| + | Curl_bufref_free(&bufref); |
| } | |
| UNITTEST_START | |
| @@ -49,7 +49,7 @@ static void unit_stop(void) | |
| } | |
| static void test_parse( | |
| - | const char *input, |
| + | const char *input_data, |
| const char *exp_dev, | |
| const char *exp_iface, | |
| const char *exp_host, | |
| @@ -58,7 +58,7 @@ static void test_parse( | |
| char *dev = NULL; | |
| char *iface = NULL; | |
| char *host = NULL; | |
| - | CURLcode rc = Curl_parse_interface(input, &dev, &iface, &host); |
| + | CURLcode rc = Curl_parse_interface(input_data, &dev, &iface, &host); |
| fail_unless(rc == exp_rc, "Curl_parse_interface() failed"); | |
| fail_unless(!!exp_dev == !!dev, "dev expectation failed."); | |