summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorMark Nunberg <mnunberg@users.noreply.github.com>2019-08-09 04:02:53 -0400
committerGitHub <noreply@github.com>2019-08-09 04:02:53 -0400
commitf9bccfb7baa0bd0c9fdbaee602398590ea364f67 (patch)
treee94e828e31b9f71166436c2a560f33f650ffb13e /test.sh
parent300fc013c1559ece991abcbf886c86e807c36ba4 (diff)
parent5d013039a95402ff555ab51a7340d4af91b6f72b (diff)
Merge branch 'master' into createArray-size_t
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..9a507ae
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,25 @@
+#!/bin/sh -ue
+
+REDIS_SERVER=${REDIS_SERVER:-redis-server}
+REDIS_PORT=${REDIS_PORT:-56379}
+
+tmpdir=$(mktemp -d)
+PID_FILE=${tmpdir}/hiredis-test-redis.pid
+SOCK_FILE=${tmpdir}/hiredis-test-redis.sock
+
+cleanup() {
+ set +e
+ kill $(cat ${PID_FILE})
+ rm -rf ${tmpdir}
+}
+trap cleanup INT TERM EXIT
+
+${REDIS_SERVER} - <<EOF
+daemonize yes
+pidfile ${PID_FILE}
+port ${REDIS_PORT}
+bind 127.0.0.1
+unixsocket ${SOCK_FILE}
+EOF
+
+${TEST_PREFIX:-} ./hiredis-test -h 127.0.0.1 -p ${REDIS_PORT} -s ${SOCK_FILE}