Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
58d0e283
Commit
58d0e283
authored
Jan 21, 2019
by
Justin Brewer
Committed by
Mark Nunberg
Feb 20, 2019
Browse files
Enable make test
Signed-off-by:
Justin Brewer
<
jzb0012@auburn.edu
>
parent
9ea7ddec
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
58d0e283
...
@@ -46,12 +46,12 @@ INSTALL(FILES hiredis.h read.h sds.h async.h
...
@@ -46,12 +46,12 @@ INSTALL(FILES hiredis.h read.h sds.h async.h
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/hiredis.pc
INSTALL
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/hiredis.pc
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
/pkgconfig
)
# Add tests: Currently, I don't know how to make the tests actually run
# without hanging!
ENABLE_TESTING
()
ENABLE_TESTING
()
ADD_EXECUTABLE
(
hiredis-test
ADD_EXECUTABLE
(
hiredis-test
test.c
)
test.c
)
TARGET_LINK_LIBRARIES
(
hiredis-test hiredis
)
TARGET_LINK_LIBRARIES
(
hiredis-test hiredis
)
ADD_TEST
(
NAME hiredis-test
COMMAND
${
CMAKE_CURRENT_SOURCE_DIR
}
/test.sh
)
# Add examples
# Add examples
IF
(
ENABLE_EXAMPLES
)
IF
(
ENABLE_EXAMPLES
)
...
...
test.sh
0 → 100755
View file @
58d0e283
#!/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
./hiredis-test
-h
127.0.0.1
-p
${
REDIS_PORT
}
-s
${
SOCK_FILE
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment