Some small changes (#2782)

* Add some imports that make it easier to build with Bazel
* Use "/tmp" paths for sockets in tests
* Move `asio_test` into `run_gcs_tests.sh` instead of starting and stopping Redis within the test fixture with a `system` call.
This commit is contained in:
Ryan Sepassi
2018-08-30 22:42:49 -07:00
committed by Robert Nishihara
parent 0347e6418b
commit b6260003cb
7 changed files with 10 additions and 20 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ SUITE(io_tests);
TEST ipc_socket_test(void) {
#ifndef _WIN32
const char *socket_pathname = "test-socket";
const char *socket_pathname = "/tmp/test-socket";
int socket_fd = bind_ipc_sock(socket_pathname, true);
ASSERT(socket_fd >= 0);
@@ -55,7 +55,7 @@ TEST ipc_socket_test(void) {
TEST long_ipc_socket_test(void) {
#ifndef _WIN32
const char *socket_pathname = "long-test-socket";
const char *socket_pathname = "/tmp/long-test-socket";
int socket_fd = bind_ipc_sock(socket_pathname, true);
ASSERT(socket_fd >= 0);
+3 -3
View File
@@ -56,7 +56,7 @@ void async_redis_socket_test_callback(redisAsyncContext *ac,
}
TEST redis_socket_test(void) {
const char *socket_pathname = "redis-test-socket";
const char *socket_pathname = "/tmp/redis-test-socket";
redisContext *context = redisConnect("127.0.0.1", 6379);
ASSERT(context != NULL);
int socket_fd = bind_ipc_sock(socket_pathname, true);
@@ -112,7 +112,7 @@ TEST async_redis_socket_test(void) {
event_loop *loop = event_loop_create();
/* Start IPC channel. */
const char *socket_pathname = "async-redis-test-socket";
const char *socket_pathname = "/tmp/async-redis-test-socket";
int socket_fd = bind_ipc_sock(socket_pathname, true);
ASSERT(socket_fd >= 0);
connections.push_back(socket_fd);
@@ -186,7 +186,7 @@ TEST logging_test(void) {
event_loop *loop = event_loop_create();
/* Start IPC channel. */
const char *socket_pathname = "logging-test-socket";
const char *socket_pathname = "/tmp/logging-test-socket";
int socket_fd = bind_ipc_sock(socket_pathname, true);
ASSERT(socket_fd >= 0);
connections.push_back(socket_fd);