summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2019-09-16 17:27:43 +0300
committerYossi Gottlieb <yossigo@gmail.com>2019-09-16 17:30:35 +0300
commitd952ed877ab1e515fcf5d16ec69576b87be61796 (patch)
treea08c1906dd00a409e0cd85f3b9827d4b9e943d13 /Makefile
parenta1e538092d79425232588c249f636c4c9d810ec4 (diff)
Add SSL mode tests.
This repeats all existing tests in SSL mode, but does not yet provide SSL-specific tests.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index f992639..25ac154 100644
--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,12 @@ STLIB_MAKE_CMD=$(AR) rcs
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
USE_SSL?=0
+
+# This is required for test.c only
+ifeq ($(USE_SSL),1)
+ CFLAGS+=-DHIREDIS_TEST_SSL
+endif
+
ifeq ($(uname_S),Linux)
SSL_LDFLAGS=-lssl -lcrypto
else
@@ -176,19 +182,20 @@ hiredis-example: examples/example.c $(STLIBNAME)
examples: $(EXAMPLES)
-hiredis-test: test.o $(STLIBNAME)
+TEST_LIBS = $(STLIBNAME)
+ifeq ($(USE_SSL),1)
+ TEST_LIBS += $(SSL_STLIBNAME) -lssl -lcrypto -lpthread
+endif
+hiredis-test: test.o $(TEST_LIBS)
hiredis-%: %.o $(STLIBNAME)
- $(CC) $(REAL_CFLAGS) -o $@ $< $(STLIBNAME) $(REAL_LDFLAGS)
+ $(CC) $(REAL_CFLAGS) -o $@ $< $(TEST_LIBS) $(REAL_LDFLAGS)
test: hiredis-test
./hiredis-test
check: hiredis-test
- @echo "$$REDIS_TEST_CONFIG" | $(REDIS_SERVER) -
- $(PRE) ./hiredis-test -h 127.0.0.1 -p $(REDIS_PORT) -s /tmp/hiredis-test-redis.sock || \
- ( kill `cat /tmp/hiredis-test-redis.pid` && false )
- kill `cat /tmp/hiredis-test-redis.pid`
+ TEST_SSL=$(USE_SSL) ./test.sh
.c.o:
$(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $<