mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-29 04:09:31 +03:00
Use number of CPUs in tests and examples
This commit is contained in:
1 parent
a9e36d3720
commit
20699d328b
25 files changed
+188
-24
No files matched your search
@@ -4,6 +4,8 @@ if USE_COVERAGE
|
||||
AM_CFLAGS = --coverage
|
||||
endif
|
||||
|
||||
CPU_COUNT_DEF = -DCPU_COUNT=$(CPU_COUNT)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/include \
|
||||
-I$(top_srcdir)/src/microhttpd \
|
||||
@@ -59,6 +61,8 @@ test_tls_options_LDADD = \
|
||||
test_https_get_parallel_SOURCES = \
|
||||
test_https_get_parallel.c \
|
||||
tls_test_common.c
|
||||
test_https_get_parallel_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) $(CPU_COUNT_DEF)
|
||||
test_https_get_parallel_CFLAGS = \
|
||||
$(PTHREAD_CFLAGS) $(AM_CFLAGS)
|
||||
test_https_get_parallel_LDADD = \
|
||||
@@ -77,6 +81,8 @@ test_empty_response_LDADD = \
|
||||
test_https_get_parallel_threads_SOURCES = \
|
||||
test_https_get_parallel_threads.c \
|
||||
tls_test_common.c
|
||||
test_https_get_parallel_threads_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) $(CPU_COUNT_DEF)
|
||||
test_https_get_parallel_threads_CFLAGS = \
|
||||
$(PTHREAD_CFLAGS) $(AM_CFLAGS)
|
||||
test_https_get_parallel_threads_LDADD = \
|
||||
|
||||
@@ -33,6 +33,13 @@
|
||||
#include <gcrypt.h>
|
||||
#include "tls_test_common.h"
|
||||
|
||||
#if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
|
||||
#undef CPU_COUNT
|
||||
#endif
|
||||
#if !defined(CPU_COUNT)
|
||||
#define CPU_COUNT 4
|
||||
#endif
|
||||
|
||||
extern const char srv_key_pem[];
|
||||
extern const char srv_self_signed_cert_pem[];
|
||||
|
||||
@@ -94,7 +101,7 @@ test_parallel_clients (void * cls, const char *cipher_suite,
|
||||
int curl_proto_version)
|
||||
{
|
||||
int i;
|
||||
int client_count = 3;
|
||||
int client_count = (CPU_COUNT - 1);
|
||||
void *client_thread_ret;
|
||||
pthread_t client_arr[client_count];
|
||||
struct https_test_data client_args =
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
#include <gcrypt.h>
|
||||
#include "tls_test_common.h"
|
||||
|
||||
#if defined(CPU_COUNT) && (CPU_COUNT+0) < 4
|
||||
#undef CPU_COUNT
|
||||
#endif
|
||||
#if !defined(CPU_COUNT)
|
||||
#define CPU_COUNT 4
|
||||
#endif
|
||||
|
||||
extern const char srv_key_pem[];
|
||||
extern const char srv_self_signed_cert_pem[];
|
||||
|
||||
@@ -94,7 +101,7 @@ test_parallel_clients (void *cls, const char *cipher_suite,
|
||||
int curl_proto_version)
|
||||
{
|
||||
int i;
|
||||
int client_count = 3;
|
||||
int client_count = (CPU_COUNT - 1);
|
||||
void *client_thread_ret;
|
||||
pthread_t client_arr[client_count];
|
||||
struct https_test_data client_args =
|
||||
|
||||
Reference in new issue
Block a user