aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl')
-rw-r--r--src/testcurl/Makefile.am68
-rw-r--r--src/testcurl/https/Makefile.am43
-rw-r--r--src/testcurl/https/tls_test_common.c4
-rw-r--r--src/testcurl/perf_get.c33
-rw-r--r--src/testcurl/test_delete.c9
-rw-r--r--src/testcurl/test_get.c51
-rw-r--r--src/testcurl/test_get_chunked.c9
-rw-r--r--src/testcurl/test_get_response_cleanup.c9
-rw-r--r--src/testcurl/test_get_sendfile.c11
-rw-r--r--src/testcurl/test_large_put.c63
-rw-r--r--src/testcurl/test_post.c11
-rw-r--r--src/testcurl/test_post_loop.c63
-rw-r--r--src/testcurl/test_postform.c9
-rw-r--r--src/testcurl/test_process_headers.c9
-rw-r--r--src/testcurl/test_put.c9
-rw-r--r--src/testcurl/test_put_chunked.c9
-rw-r--r--src/testcurl/test_quiesce.c33
17 files changed, 256 insertions, 187 deletions
diff --git a/src/testcurl/Makefile.am b/src/testcurl/Makefile.am
index 796ea9e2..3e703772 100644
--- a/src/testcurl/Makefile.am
+++ b/src/testcurl/Makefile.am
@@ -16,11 +16,39 @@ AM_CPPFLAGS = \
16-I$(top_srcdir)/src/include \ 16-I$(top_srcdir)/src/include \
17$(LIBCURL_CPPFLAGS) 17$(LIBCURL_CPPFLAGS)
18 18
19
20THREAD_ONLY_TESTS = \
21 test_urlparse \
22 test_long_header \
23 test_long_header11 \
24 test_iplimit11 \
25 test_termination \
26 test_timeout
27
28
29
30if HAVE_POSIX_THREADS
31THREAD_ONLY_TESTS += \
32 test_quiesce \
33 test_concurrent_stop \
34 perf_get_concurrent
35
36if HAVE_CURL_BINARY
37THREAD_ONLY_TESTS += \
38 test_quiesce_stream
39endif
40endif
41
42if ENABLE_DAUTH
43 THREAD_ONLY_TESTS += \
44 test_digestauth \
45 test_digestauth_with_arguments
46endif
47
19if HAVE_CURL 48if HAVE_CURL
20check_PROGRAMS = \ 49check_PROGRAMS = \
21 test_get \ 50 test_get \
22 test_get_sendfile \ 51 test_get_sendfile \
23 test_urlparse \
24 test_delete \ 52 test_delete \
25 test_put \ 53 test_put \
26 test_process_headers \ 54 test_process_headers \
@@ -32,33 +60,11 @@ check_PROGRAMS = \
32 test_put11 \ 60 test_put11 \
33 test_large_put11 \ 61 test_large_put11 \
34 test_large_put_inc11 \ 62 test_large_put_inc11 \
35 test_long_header \
36 test_long_header11 \
37 test_get_chunked \ 63 test_get_chunked \
38 test_put_chunked \ 64 test_put_chunked \
39 test_iplimit11 \
40 test_termination \
41 test_timeout \
42 test_callback \ 65 test_callback \
43 perf_get 66 perf_get
44 67
45if HAVE_FORK_WAITPID
46if HAVE_CURL_BINARY
47check_PROGRAMS += test_get_response_cleanup
48endif
49endif
50
51if HAVE_POSIX_THREADS
52check_PROGRAMS += \
53 test_quiesce \
54 test_concurrent_stop \
55 perf_get_concurrent
56
57if HAVE_CURL_BINARY
58check_PROGRAMS += test_quiesce_stream
59endif
60endif
61
62if HAVE_POSTPROCESSOR 68if HAVE_POSTPROCESSOR
63 check_PROGRAMS += \ 69 check_PROGRAMS += \
64 test_post \ 70 test_post \
@@ -69,9 +75,19 @@ if HAVE_POSTPROCESSOR
69 test_post_loop11 75 test_post_loop11
70endif 76endif
71 77
72if ENABLE_DAUTH 78if HAVE_FORK_WAITPID
73 check_PROGRAMS += \ 79if HAVE_CURL_BINARY
74 test_digestauth test_digestauth_with_arguments 80check_PROGRAMS += test_get_response_cleanup
81endif
82endif
83
84if USE_POSIX_THREADS
85check_PROGRAMS +=
86 $(THREAD_ONLY_TESTS)
87endif
88if USE_W32_THREADS
89check_PROGRAMS +=
90 $(THREAD_ONLY_TESTS)
75endif 91endif
76 92
77TESTS = $(check_PROGRAMS) 93TESTS = $(check_PROGRAMS)
diff --git a/src/testcurl/https/Makefile.am b/src/testcurl/https/Makefile.am
index 239ce2ca..7454ab06 100644
--- a/src/testcurl/https/Makefile.am
+++ b/src/testcurl/https/Makefile.am
@@ -10,8 +10,9 @@ if HAVE_GNUTLS_SNI
10endif 10endif
11 11
12if HAVE_POSIX_THREADS 12if HAVE_POSIX_THREADS
13 HTTPS_PARALLEL_TESTS = test_https_get_parallel \ 13 HTTPS_PARALLEL_TESTS = \
14 test_https_get_parallel_threads 14 test_https_get_parallel \
15 test_https_get_parallel_threads
15endif 16endif
16 17
17CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT) 18CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT)
@@ -22,32 +23,36 @@ AM_CPPFLAGS = \
22 -I$(top_srcdir)/src/platform \ 23 -I$(top_srcdir)/src/platform \
23 $(LIBCURL_CPPFLAGS) $(MHD_TLS_LIB_CPPFLAGS) 24 $(LIBCURL_CPPFLAGS) $(MHD_TLS_LIB_CPPFLAGS)
24 25
25check_PROGRAMS = \ 26THREAD_ONLY_TESTS = \
26 test_tls_options \ 27 test_tls_options \
27 test_tls_authentication \ 28 test_tls_authentication \
28 test_https_multi_daemon \
29 test_https_get \
30 $(TEST_HTTPS_SNI) \
31 test_https_get_select \
32 $(HTTPS_PARALLEL_TESTS) \ 29 $(HTTPS_PARALLEL_TESTS) \
30 $(TEST_HTTPS_SNI) \
33 test_https_session_info \ 31 test_https_session_info \
34 test_https_time_out \ 32 test_https_time_out \
33 test_https_multi_daemon \
34 test_https_get \
35 test_empty_response 35 test_empty_response
36 36
37EXTRA_DIST = cert.pem key.pem \ 37check_PROGRAMS = \
38 host1.crt host1.key host2.crt host2.key 38 test_https_get_select
39
40if USE_POSIX_THREADS
41check_PROGRAMS +=
42 $(THREAD_ONLY_TESTS)
43endif
44if USE_W32_THREADS
45check_PROGRAMS +=
46 $(THREAD_ONLY_TESTS)
47endif
48
49EXTRA_DIST = \
50 cert.pem key.pem \
51 host1.crt host1.key \
52 host2.crt host2.key
39 53
40TESTS = \ 54TESTS = \
41 test_tls_options \ 55 $(check_PROGRAMS)
42 test_https_multi_daemon \
43 test_https_get \
44 $(TEST_HTTPS_SNI) \
45 test_https_get_select \
46 $(HTTPS_PARALLEL_TESTS) \
47 test_https_session_info \
48 test_https_time_out \
49 test_tls_authentication \
50 test_empty_response
51 56
52 57
53test_https_time_out_SOURCES = \ 58test_https_time_out_SOURCES = \
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c
index a3a7df24..3641f098 100644
--- a/src/testcurl/https/tls_test_common.c
+++ b/src/testcurl/https/tls_test_common.c
@@ -526,7 +526,9 @@ test_wrap (const char *test_name, int
526 return ret; 526 return ret;
527} 527}
528 528
529int testsuite_curl_global_init (void) 529
530int
531testsuite_curl_global_init (void)
530{ 532{
531 CURLcode res; 533 CURLcode res;
532#if LIBCURL_VERSION_NUM >= 0x073800 534#if LIBCURL_VERSION_NUM >= 0x073800
diff --git a/src/testcurl/perf_get.c b/src/testcurl/perf_get.c
index ac6a23f3..b5d754a8 100644
--- a/src/testcurl/perf_get.c
+++ b/src/testcurl/perf_get.c
@@ -589,22 +589,25 @@ main (int argc, char *const *argv)
589 "/hello_world", 589 "/hello_world",
590 MHD_RESPMEM_MUST_COPY); 590 MHD_RESPMEM_MUST_COPY);
591 errorCount += testExternalGet (port++); 591 errorCount += testExternalGet (port++);
592 errorCount += testInternalGet (port++, MHD_USE_AUTO); 592 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
593 errorCount += testMultithreadedGet (port++, MHD_USE_AUTO);
594 errorCount += testMultithreadedPoolGet (port++, MHD_USE_AUTO);
595 errorCount += testInternalGet (port++, 0);
596 errorCount += testMultithreadedGet (port++, 0);
597 errorCount += testMultithreadedPoolGet (port++, 0);
598 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
599 { 593 {
600 errorCount += testInternalGet(port++, MHD_USE_POLL); 594 errorCount += testInternalGet (port++, MHD_USE_AUTO);
601 errorCount += testMultithreadedGet(port++, MHD_USE_POLL); 595 errorCount += testMultithreadedGet (port++, MHD_USE_AUTO);
602 errorCount += testMultithreadedPoolGet(port++, MHD_USE_POLL); 596 errorCount += testMultithreadedPoolGet (port++, MHD_USE_AUTO);
603 } 597 errorCount += testInternalGet (port++, 0);
604 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) 598 errorCount += testMultithreadedGet (port++, 0);
605 { 599 errorCount += testMultithreadedPoolGet (port++, 0);
606 errorCount += testInternalGet(port++, MHD_USE_EPOLL); 600 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
607 errorCount += testMultithreadedPoolGet(port++, MHD_USE_EPOLL); 601 {
602 errorCount += testInternalGet(port++, MHD_USE_POLL);
603 errorCount += testMultithreadedGet(port++, MHD_USE_POLL);
604 errorCount += testMultithreadedPoolGet(port++, MHD_USE_POLL);
605 }
606 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
607 {
608 errorCount += testInternalGet(port++, MHD_USE_EPOLL);
609 errorCount += testMultithreadedPoolGet(port++, MHD_USE_EPOLL);
610 }
608 } 611 }
609 MHD_destroy_response (response); 612 MHD_destroy_response (response);
610 if (errorCount != 0) 613 if (errorCount != 0)
diff --git a/src/testcurl/test_delete.c b/src/testcurl/test_delete.c
index 70f0f509..35f7f6a2 100644
--- a/src/testcurl/test_delete.c
+++ b/src/testcurl/test_delete.c
@@ -512,9 +512,12 @@ main (int argc, char *const *argv)
512 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 512 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
513 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 513 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
514 return 2; 514 return 2;
515 errorCount += testInternalDelete (); 515 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
516 errorCount += testMultithreadedDelete (); 516 {
517 errorCount += testMultithreadedPoolDelete (); 517 errorCount += testInternalDelete ();
518 errorCount += testMultithreadedDelete ();
519 errorCount += testMultithreadedPoolDelete ();
520 }
518 errorCount += testExternalDelete (); 521 errorCount += testExternalDelete ();
519 if (errorCount != 0) 522 if (errorCount != 0)
520 fprintf (stderr, "Error (code: %u)\n", errorCount); 523 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 1c9796f7..cb81283f 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -739,38 +739,43 @@ int
739main (int argc, char *const *argv) 739main (int argc, char *const *argv)
740{ 740{
741 unsigned int errorCount = 0; 741 unsigned int errorCount = 0;
742 (void)argc; /* Unused. Silent compiler warning. */ 742 (void) argc; /* Unused. Silence compiler warning. */
743 743
744 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 744 oneone = (NULL != strrchr (argv[0], (int) '/')) ?
745 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 745 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
746 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 746 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
747 return 2; 747 return 2;
748 global_port = 0; 748 global_port = 0;
749 errorCount += testInternalGet (0);
750 errorCount += testMultithreadedGet (0);
751 errorCount += testMultithreadedPoolGet (0);
752 errorCount += testUnknownPortGet (0);
753 errorCount += testStopRace (0);
754 errorCount += testExternalGet (); 749 errorCount += testExternalGet ();
755 errorCount += testEmptyGet (0); 750 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
756 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
757 { 751 {
758 errorCount += testInternalGet(MHD_USE_POLL); 752 errorCount += testInternalGet (0);
759 errorCount += testMultithreadedGet(MHD_USE_POLL); 753 errorCount += testMultithreadedGet (0);
760 errorCount += testMultithreadedPoolGet(MHD_USE_POLL); 754 errorCount += testMultithreadedPoolGet (0);
761 errorCount += testUnknownPortGet(MHD_USE_POLL); 755 errorCount += testUnknownPortGet (0);
762 errorCount += testStopRace(MHD_USE_POLL); 756 errorCount += testStopRace (0);
763 errorCount += testEmptyGet(MHD_USE_POLL); 757 errorCount += testEmptyGet (0);
758 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
759 {
760 errorCount += testInternalGet(MHD_USE_POLL);
761 errorCount += testMultithreadedGet(MHD_USE_POLL);
762 errorCount += testMultithreadedPoolGet(MHD_USE_POLL);
763 errorCount += testUnknownPortGet(MHD_USE_POLL);
764 errorCount += testStopRace(MHD_USE_POLL);
765 errorCount += testEmptyGet(MHD_USE_POLL);
766 }
767 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
768 {
769 errorCount += testInternalGet(MHD_USE_EPOLL);
770 errorCount += testMultithreadedPoolGet(MHD_USE_EPOLL);
771 errorCount += testUnknownPortGet(MHD_USE_EPOLL);
772 errorCount += testEmptyGet(MHD_USE_EPOLL);
773 }
764 } 774 }
765 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) 775 if (0 != errorCount)
766 { 776 fprintf (stderr,
767 errorCount += testInternalGet(MHD_USE_EPOLL); 777 "Error (code: %u)\n",
768 errorCount += testMultithreadedPoolGet(MHD_USE_EPOLL); 778 errorCount);
769 errorCount += testUnknownPortGet(MHD_USE_EPOLL);
770 errorCount += testEmptyGet(MHD_USE_EPOLL);
771 }
772 if (errorCount != 0)
773 fprintf (stderr, "Error (code: %u)\n", errorCount);
774 curl_global_cleanup (); 779 curl_global_cleanup ();
775 return errorCount != 0; /* 0 == pass */ 780 return errorCount != 0; /* 0 == pass */
776} 781}
diff --git a/src/testcurl/test_get_chunked.c b/src/testcurl/test_get_chunked.c
index d813566c..66a9fbde 100644
--- a/src/testcurl/test_get_chunked.c
+++ b/src/testcurl/test_get_chunked.c
@@ -506,9 +506,12 @@ main (int argc, char *const *argv)
506 506
507 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 507 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
508 return 2; 508 return 2;
509 errorCount += testInternalGet (); 509 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
510 errorCount += testMultithreadedGet (); 510 {
511 errorCount += testMultithreadedPoolGet (); 511 errorCount += testInternalGet ();
512 errorCount += testMultithreadedGet ();
513 errorCount += testMultithreadedPoolGet ();
514 }
512 errorCount += testExternalGet (); 515 errorCount += testExternalGet ();
513 if (errorCount != 0) 516 if (errorCount != 0)
514 fprintf (stderr, "Error (code: %u)\n", errorCount); 517 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_get_response_cleanup.c b/src/testcurl/test_get_response_cleanup.c
index d3d45d2f..457c646f 100644
--- a/src/testcurl/test_get_response_cleanup.c
+++ b/src/testcurl/test_get_response_cleanup.c
@@ -417,9 +417,12 @@ main (int argc, char *const *argv)
417 417
418 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 418 oneone = (NULL != strrchr (argv[0], (int) '/')) ?
419 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 419 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
420 errorCount += testInternalGet (); 420 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
421 errorCount += testMultithreadedGet (); 421 {
422 errorCount += testMultithreadedPoolGet (); 422 errorCount += testInternalGet ();
423 errorCount += testMultithreadedGet ();
424 errorCount += testMultithreadedPoolGet ();
425 }
423 errorCount += testExternalGet (); 426 errorCount += testExternalGet ();
424 if (errorCount != 0) 427 if (errorCount != 0)
425 fprintf (stderr, "Error (code: %u)\n", errorCount); 428 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index c7e94945..3d820fc8 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -603,11 +603,14 @@ main (int argc, char *const *argv)
603 fclose (f); 603 fclose (f);
604 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 604 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
605 return 2; 605 return 2;
606 errorCount += testInternalGet (); 606 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
607 errorCount += testMultithreadedGet (); 607 {
608 errorCount += testMultithreadedPoolGet (); 608 errorCount += testInternalGet ();
609 errorCount += testMultithreadedGet ();
610 errorCount += testMultithreadedPoolGet ();
611 errorCount += testUnknownPortGet ();
612 }
609 errorCount += testExternalGet (); 613 errorCount += testExternalGet ();
610 errorCount += testUnknownPortGet ();
611 if (errorCount != 0) 614 if (errorCount != 0)
612 fprintf (stderr, "Error (code: %u)\n", errorCount); 615 fprintf (stderr, "Error (code: %u)\n", errorCount);
613 curl_global_cleanup (); 616 curl_global_cleanup ();
diff --git a/src/testcurl/test_large_put.c b/src/testcurl/test_large_put.c
index b7a87c8f..f4c767cc 100644
--- a/src/testcurl/test_large_put.c
+++ b/src/testcurl/test_large_put.c
@@ -605,47 +605,50 @@ main (int argc, char *const *argv)
605 put_buffer = alloc_init (PUT_SIZE); 605 put_buffer = alloc_init (PUT_SIZE);
606 if (NULL == put_buffer) 606 if (NULL == put_buffer)
607 return 99; 607 return 99;
608 lastErr = testPutInternalThread (0);
609 if (verbose && 0 != lastErr)
610 fprintf (stderr, "Error during testing with internal thread with select().\n");
611 errorCount += lastErr;
612 lastErr = testPutThreadPerConn (0);
613 if (verbose && 0 != lastErr)
614 fprintf (stderr, "Error during testing with internal thread per connection with select().\n");
615 errorCount += lastErr;
616 lastErr = testPutThreadPool (0);
617 if (verbose && 0 != lastErr)
618 fprintf (stderr, "Error during testing with thread pool per connection with select().\n");
619 errorCount += lastErr;
620 lastErr = testPutExternal (); 608 lastErr = testPutExternal ();
621 if (verbose && 0 != lastErr) 609 if (verbose && 0 != lastErr)
622 fprintf (stderr, "Error during testing with external select().\n"); 610 fprintf (stderr, "Error during testing with external select().\n");
623 errorCount += lastErr; 611 errorCount += lastErr;
624 if (MHD_is_feature_supported(MHD_FEATURE_POLL)) 612 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
625 { 613 {
626 lastErr = testPutInternalThread (MHD_USE_POLL); 614 lastErr = testPutInternalThread (0);
627 if (verbose && 0 != lastErr) 615 if (verbose && 0 != lastErr)
628 fprintf (stderr, "Error during testing with internal thread with poll().\n"); 616 fprintf (stderr, "Error during testing with internal thread with select().\n");
629 errorCount += lastErr; 617 errorCount += lastErr;
630 lastErr = testPutThreadPerConn (MHD_USE_POLL); 618 lastErr = testPutThreadPerConn (0);
631 if (verbose && 0 != lastErr)
632 fprintf (stderr, "Error during testing with internal thread per connection with poll().\n");
633 errorCount += lastErr;
634 lastErr = testPutThreadPool (MHD_USE_POLL);
635 if (verbose && 0 != lastErr)
636 fprintf (stderr, "Error during testing with thread pool per connection with poll().\n");
637 errorCount += lastErr;
638 }
639 if (MHD_is_feature_supported(MHD_FEATURE_EPOLL))
640 {
641 lastErr = testPutInternalThread (MHD_USE_EPOLL);
642 if (verbose && 0 != lastErr) 619 if (verbose && 0 != lastErr)
643 fprintf (stderr, "Error during testing with internal thread with epoll.\n"); 620 fprintf (stderr, "Error during testing with internal thread per connection with select().\n");
644 errorCount += lastErr; 621 errorCount += lastErr;
645 lastErr = testPutThreadPool (MHD_USE_EPOLL); 622 lastErr = testPutThreadPool (0);
646 if (verbose && 0 != lastErr) 623 if (verbose && 0 != lastErr)
647 fprintf (stderr, "Error during testing with thread pool per connection with epoll.\n"); 624 fprintf (stderr, "Error during testing with thread pool per connection with select().\n");
648 errorCount += lastErr; 625 errorCount += lastErr;
626 if (MHD_is_feature_supported(MHD_FEATURE_POLL))
627 {
628 lastErr = testPutInternalThread (MHD_USE_POLL);
629 if (verbose && 0 != lastErr)
630 fprintf (stderr, "Error during testing with internal thread with poll().\n");
631 errorCount += lastErr;
632 lastErr = testPutThreadPerConn (MHD_USE_POLL);
633 if (verbose && 0 != lastErr)
634 fprintf (stderr, "Error during testing with internal thread per connection with poll().\n");
635 errorCount += lastErr;
636 lastErr = testPutThreadPool (MHD_USE_POLL);
637 if (verbose && 0 != lastErr)
638 fprintf (stderr, "Error during testing with thread pool per connection with poll().\n");
639 errorCount += lastErr;
640 }
641 if (MHD_is_feature_supported(MHD_FEATURE_EPOLL))
642 {
643 lastErr = testPutInternalThread (MHD_USE_EPOLL);
644 if (verbose && 0 != lastErr)
645 fprintf (stderr, "Error during testing with internal thread with epoll.\n");
646 errorCount += lastErr;
647 lastErr = testPutThreadPool (MHD_USE_EPOLL);
648 if (verbose && 0 != lastErr)
649 fprintf (stderr, "Error during testing with thread pool per connection with epoll.\n");
650 errorCount += lastErr;
651 }
649 } 652 }
650 free (put_buffer); 653 free (put_buffer);
651 if (errorCount != 0) 654 if (errorCount != 0)
diff --git a/src/testcurl/test_post.c b/src/testcurl/test_post.c
index 6b91b9cc..cfef2c46 100644
--- a/src/testcurl/test_post.c
+++ b/src/testcurl/test_post.c
@@ -774,10 +774,13 @@ main (int argc, char *const *argv)
774 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 774 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
775 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 775 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
776 return 2; 776 return 2;
777 errorCount += testMultithreadedPostCancel (); 777 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
778 errorCount += testInternalPost (); 778 {
779 errorCount += testMultithreadedPost (); 779 errorCount += testMultithreadedPostCancel ();
780 errorCount += testMultithreadedPoolPost (); 780 errorCount += testInternalPost ();
781 errorCount += testMultithreadedPost ();
782 errorCount += testMultithreadedPoolPost ();
783 }
781 errorCount += testExternalPost (); 784 errorCount += testExternalPost ();
782 if (errorCount != 0) 785 if (errorCount != 0)
783 fprintf (stderr, "Error (code: %u)\n", errorCount); 786 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_post_loop.c b/src/testcurl/test_post_loop.c
index 6da06b45..aae297d4 100644
--- a/src/testcurl/test_post_loop.c
+++ b/src/testcurl/test_post_loop.c
@@ -583,36 +583,39 @@ main (int argc, char *const *argv)
583 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 583 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
584 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 584 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
585 return 2; 585 return 2;
586 start_time = now(); 586 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
587 errorCount += testInternalPost (); 587 {
588 fprintf (stderr, 588 start_time = now();
589 oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential POSTs (http/1.0) %f/s\n", 589 errorCount += testInternalPost ();
590 "internal select", 590 fprintf (stderr,
591 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0)); 591 oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential POSTs (http/1.0) %f/s\n",
592 GAUGER ("internal select", 592 "internal select",
593 oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs (http/1.0)", 593 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
594 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0), 594 GAUGER ("internal select",
595 "requests/s"); 595 oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs (http/1.0)",
596 start_time = now(); 596 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
597 errorCount += testMultithreadedPost (); 597 "requests/s");
598 fprintf (stderr, 598 start_time = now();
599 oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential POSTs (http/1.0) %f/s\n", 599 errorCount += testMultithreadedPost ();
600 "multithreaded post", 600 fprintf (stderr,
601 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0)); 601 oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential POSTs (http/1.0) %f/s\n",
602 GAUGER ("Multithreaded select", 602 "multithreaded post",
603 oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs (http/1.0)", 603 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
604 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0), 604 GAUGER ("Multithreaded select",
605 "requests/s"); 605 oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs (http/1.0)",
606 start_time = now(); 606 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
607 errorCount += testMultithreadedPoolPost (); 607 "requests/s");
608 fprintf (stderr, 608 start_time = now();
609 oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential POSTs (http/1.0) %f/s\n", 609 errorCount += testMultithreadedPoolPost ();
610 "thread with pool", 610 fprintf (stderr,
611 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0)); 611 oneone ? "%s: Sequential POSTs (http/1.1) %f/s\n" : "%s: Sequential POSTs (http/1.0) %f/s\n",
612 GAUGER ("thread with pool", 612 "thread with pool",
613 oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs (http/1.0)", 613 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0));
614 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0), 614 GAUGER ("thread with pool",
615 "requests/s"); 615 oneone ? "Sequential POSTs (http/1.1)" : "Sequential POSTs (http/1.0)",
616 (double) 1000 * LOOPCOUNT / (now() - start_time + 1.0),
617 "requests/s");
618 }
616 start_time = now(); 619 start_time = now();
617 errorCount += testExternalPost (); 620 errorCount += testExternalPost ();
618 fprintf (stderr, 621 fprintf (stderr,
diff --git a/src/testcurl/test_postform.c b/src/testcurl/test_postform.c
index f94ed1f8..746d6baa 100644
--- a/src/testcurl/test_postform.c
+++ b/src/testcurl/test_postform.c
@@ -589,9 +589,12 @@ main (int argc, char *const *argv)
589 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 589 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
590 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 590 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
591 return 2; 591 return 2;
592 errorCount += testInternalPost (); 592 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
593 errorCount += testMultithreadedPost (); 593 {
594 errorCount += testMultithreadedPoolPost (); 594 errorCount += testInternalPost ();
595 errorCount += testMultithreadedPost ();
596 errorCount += testMultithreadedPoolPost ();
597 }
595 errorCount += testExternalPost (); 598 errorCount += testExternalPost ();
596 if (errorCount != 0) 599 if (errorCount != 0)
597 fprintf (stderr, "Error (code: %u)\n", errorCount); 600 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_process_headers.c b/src/testcurl/test_process_headers.c
index d123c441..f9c7cd03 100644
--- a/src/testcurl/test_process_headers.c
+++ b/src/testcurl/test_process_headers.c
@@ -520,9 +520,12 @@ main (int argc, char *const *argv)
520 520
521 oneone = (NULL != strrchr (argv[0], (int) '/')) ? 521 oneone = (NULL != strrchr (argv[0], (int) '/')) ?
522 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 522 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
523 errorCount += testInternalGet (); 523 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
524 errorCount += testMultithreadedGet (); 524 {
525 errorCount += testMultithreadedPoolGet (); 525 errorCount += testInternalGet ();
526 errorCount += testMultithreadedGet ();
527 errorCount += testMultithreadedPoolGet ();
528 }
526 errorCount += testExternalGet (); 529 errorCount += testExternalGet ();
527 if (errorCount != 0) 530 if (errorCount != 0)
528 fprintf (stderr, "Error (code: %u)\n", errorCount); 531 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_put.c b/src/testcurl/test_put.c
index eba7afa0..3df97526 100644
--- a/src/testcurl/test_put.c
+++ b/src/testcurl/test_put.c
@@ -525,9 +525,12 @@ main (int argc, char *const *argv)
525 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0; 525 (NULL != strstr (strrchr (argv[0], (int) '/'), "11")) : 0;
526 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 526 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
527 return 2; 527 return 2;
528 errorCount += testInternalPut (); 528 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
529 errorCount += testMultithreadedPut (); 529 {
530 errorCount += testMultithreadedPoolPut (); 530 errorCount += testInternalPut ();
531 errorCount += testMultithreadedPut ();
532 errorCount += testMultithreadedPoolPut ();
533 }
531 errorCount += testExternalPut (); 534 errorCount += testExternalPut ();
532 if (errorCount != 0) 535 if (errorCount != 0)
533 fprintf (stderr, "Error (code: %u)\n", errorCount); 536 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_put_chunked.c b/src/testcurl/test_put_chunked.c
index 71e10b77..017bff99 100644
--- a/src/testcurl/test_put_chunked.c
+++ b/src/testcurl/test_put_chunked.c
@@ -518,9 +518,12 @@ main (int argc, char *const *argv)
518 518
519 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 519 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
520 return 2; 520 return 2;
521 errorCount += testInternalPut (); 521 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
522 errorCount += testMultithreadedPut (); 522 {
523 errorCount += testMultithreadedPoolPut (); 523 errorCount += testInternalPut ();
524 errorCount += testMultithreadedPut ();
525 errorCount += testMultithreadedPoolPut ();
526 }
524 errorCount += testExternalPut (); 527 errorCount += testExternalPut ();
525 if (errorCount != 0) 528 if (errorCount != 0)
526 fprintf (stderr, "Error (code: %u)\n", errorCount); 529 fprintf (stderr, "Error (code: %u)\n", errorCount);
diff --git a/src/testcurl/test_quiesce.c b/src/testcurl/test_quiesce.c
index f9fd9690..5795898a 100644
--- a/src/testcurl/test_quiesce.c
+++ b/src/testcurl/test_quiesce.c
@@ -530,23 +530,28 @@ main (int argc, char *const *argv)
530 530
531 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 531 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
532 return 2; 532 return 2;
533 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
534 errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
535 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, 0);
536 errorCount += testExternalGet (); 533 errorCount += testExternalGet ();
537 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL)) 534 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_THREADS))
538 { 535 {
539 errorCount += testGet(MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_POLL); 536 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
540 errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_POLL); 537 errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD, 0, 0);
541 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, MHD_USE_POLL); 538 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, 0);
539 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_POLL))
540 {
541 errorCount += testGet(MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_POLL);
542 errorCount += testGet (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_POLL);
543 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, MHD_USE_POLL);
544 }
545 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL))
546 {
547 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_EPOLL);
548 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, MHD_USE_EPOLL);
549 }
542 } 550 }
543 if (MHD_YES == MHD_is_feature_supported(MHD_FEATURE_EPOLL)) 551 if (0 != errorCount)
544 { 552 fprintf (stderr,
545 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, 0, MHD_USE_EPOLL); 553 "Error (code: %u)\n",
546 errorCount += testGet (MHD_USE_INTERNAL_POLLING_THREAD, CPU_COUNT, MHD_USE_EPOLL); 554 errorCount);
547 }
548 if (errorCount != 0)
549 fprintf (stderr, "Error (code: %u)\n", errorCount);
550 curl_global_cleanup (); 555 curl_global_cleanup ();
551 return errorCount != 0; /* 0 == pass */ 556 return errorCount != 0; /* 0 == pass */
552} 557}