From: Stefan Eissing Date: Thu, 3 Oct 2024 11:09:17 +0000 (+0200) Subject: test1515: add tracing and more debug info X-Git-Tag: curl-8_11_0~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1f93beffe7080c457351c67336a32e1d4a5a481;p=thirdparty%2Fcurl.git test1515: add tracing and more debug info Test failed on some Windows CI and log files did not really tell why. Add more output. Closes #15140 --- diff --git a/tests/libtest/Makefile.inc b/tests/libtest/Makefile.inc index 056968c99f..c79ce622a4 100644 --- a/tests/libtest/Makefile.inc +++ b/tests/libtest/Makefile.inc @@ -402,7 +402,7 @@ lib1513_LDADD = $(TESTUTIL_LIBS) lib1514_SOURCES = lib1514.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) lib1514_LDADD = $(TESTUTIL_LIBS) -lib1515_SOURCES = lib1515.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) +lib1515_SOURCES = lib1515.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS) lib1515_LDADD = $(TESTUTIL_LIBS) lib1517_SOURCES = lib1517.c $(SUPPORTFILES) diff --git a/tests/libtest/lib1515.c b/tests/libtest/lib1515.c index 5d762513d5..f772d9e38b 100644 --- a/tests/libtest/lib1515.c +++ b/tests/libtest/lib1515.c @@ -29,6 +29,7 @@ */ #include "test.h" +#include "testtrace.h" #include "testutil.h" #include "warnless.h" #include "memdebug.h" @@ -37,18 +38,6 @@ #define DNS_TIMEOUT 1 -static int debug_callback(CURL *curl, curl_infotype info, char *msg, - size_t len, void *ptr) -{ - (void)curl; - (void)ptr; - - if(info == CURLINFO_TEXT) - fprintf(stderr, "debug: %.*s", (int) len, msg); - - return 0; -} - static CURLcode do_one_request(CURLM *m, char *URL, char *resolve) { CURL *curls; @@ -64,10 +53,14 @@ static CURLcode do_one_request(CURLM *m, char *URL, char *resolve) easy_setopt(curls, CURLOPT_URL, URL); easy_setopt(curls, CURLOPT_RESOLVE, resolve_list); - easy_setopt(curls, CURLOPT_DEBUGFUNCTION, debug_callback); - easy_setopt(curls, CURLOPT_VERBOSE, 1); easy_setopt(curls, CURLOPT_DNS_CACHE_TIMEOUT, DNS_TIMEOUT); + libtest_debug_config.nohex = 1; + libtest_debug_config.tracetime = 1; + easy_setopt(curls, CURLOPT_DEBUGDATA, &libtest_debug_config); + easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); + easy_setopt(curls, CURLOPT_VERBOSE, 1L); + multi_add_handle(m, curls); multi_perform(m, &still_running); @@ -127,6 +120,7 @@ CURLcode test(char *URL) start_test_timing(); global_init(CURL_GLOBAL_ALL); + curl_global_trace("all"); multi_init(multi); for(i = 1; i <= count; i++) { @@ -137,6 +131,7 @@ CURLcode test(char *URL) /* second request must succeed like the first one */ res = do_one_request(multi, target_url, dns_entry); if(res != CURLE_OK) { + fprintf(stderr, "request %s failed with %d\n", target_url, res); goto test_cleanup; }