diff --git a/ChangeLog b/ChangeLog index 73736e3e..d140547f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat Apr 23 20:12:01 CET 2016 + Tests perf_get_concurrent and test_concurrent_stop ported to use + pthread instead of fork(). Added more error detections. -EG + Sat Apr 23 16:06:30 CET 2016 Improved test_quiesce test. -EG diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am index 510516c3..47ebda5a 100644 --- a/src/testcurl/Makefile.am +++ b/src/testcurl/Makefile.am @@ -17,7 +17,6 @@ AM_CPPFLAGS = \ $(LIBCURL_CPPFLAGS) if !HAVE_W32 -TEST_CONCURRENT_STOP=test_concurrent_stop if HAVE_CURL_BINARY CURL_FORK_TEST = test_get_response_cleanup endif @@ -30,7 +29,6 @@ check_PROGRAMS = \ test_get_sendfile \ test_urlparse \ test_put \ - $(TEST_CONCURRENT_STOP) \ test_process_headers \ test_process_arguments \ test_parse_cookies \ @@ -53,6 +51,7 @@ check_PROGRAMS = \ if HAVE_POSIX_THREADS check_PROGRAMS += \ test_quiesce \ + test_concurrent_stop \ perf_get_concurrent endif @@ -89,9 +88,11 @@ test_start_stop_LDADD = \ test_concurrent_stop_SOURCES = \ test_concurrent_stop.c +test_concurrent_stop_CFLAGS = \ + $(PTHREAD_CFLAGS) $(AM_CFLAGS) test_concurrent_stop_LDADD = \ $(top_builddir)/src/microhttpd/libmicrohttpd.la \ - @LIBCURL@ + $(PTHREAD_LIBS) @LIBCURL@ test_options_SOURCES = \ test_options.c diff --git a/src/testcurl/test_concurrent_stop.c b/src/testcurl/test_concurrent_stop.c index 88839ffd..1420b7c8 100644 --- a/src/testcurl/test_concurrent_stop.c +++ b/src/testcurl/test_concurrent_stop.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "gauger.h" #ifdef CPU_COUNT @@ -100,74 +101,85 @@ ahc_echo (void *cls, } -static pid_t -do_gets (int port) +static void * +thread_gets (void *param) { - pid_t ret; CURL *c; CURLcode errornum; unsigned int i; + char * const url = (char*) param; + + for (i=0;i= 0; j--) + pthread_join(par[j], NULL); + + fprintf(stderr, "pthread_create failed.\n"); + _exit(99); + } } - sleep (1); for (j=0;j