From 648763c36e9f6493b13a77da35eb33ef0652b4e2 Mon Sep 17 00:00:00 2001 From: Björn Svensson Date: Mon, 25 Oct 2021 10:13:48 +0200 Subject: Add build options for enabling async tests Asynchronous testcases that requires the event library `libevent` can be built and enabled by using the added build flags: - ENABLE_ASYNC_TESTS when using CMake - TEST_ASYNC when using Make The async tests are disabled by default to avoid adding new requirements, but the testcases are built and run in CI. --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 34c7909..f30c2ac 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,9 @@ USE_SSL?=0 ifeq ($(USE_SSL),1) export CFLAGS+=-DHIREDIS_TEST_SSL endif +ifeq ($(TEST_ASYNC),1) + export CFLAGS+=-DHIREDIS_TEST_ASYNC +endif ifeq ($(uname_S),Linux) ifdef OPENSSL_PREFIX @@ -211,6 +214,9 @@ ifeq ($(USE_SSL),1) TEST_LIBS += $(SSL_STLIBNAME) TEST_LDFLAGS = $(SSL_LDFLAGS) -lssl -lcrypto -lpthread endif +ifeq ($(TEST_ASYNC),1) + TEST_LDFLAGS += -levent +endif hiredis-test: test.o $(TEST_LIBS) $(CC) -o $@ $(REAL_CFLAGS) -I. $^ $(REAL_LDFLAGS) $(TEST_LDFLAGS) -- cgit v1.2.3