diff options
author | Yossi Gottlieb <yossigo@gmail.com> | 2019-09-16 17:27:43 +0300 |
---|---|---|
committer | Yossi Gottlieb <yossigo@gmail.com> | 2019-09-16 17:30:35 +0300 |
commit | d952ed877ab1e515fcf5d16ec69576b87be61796 (patch) | |
tree | a08c1906dd00a409e0cd85f3b9827d4b9e943d13 /Makefile | |
parent | a1e538092d79425232588c249f636c4c9d810ec4 (diff) | |
download | hiredict-d952ed877ab1e515fcf5d16ec69576b87be61796.tar.xz |
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-- | Makefile | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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) $< |