Commit fde85202 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Adapt tests to new source layout

parent e4df5892
include ../Makefile.common
include ../src/Makefile.common
STD= -std=c99 -pedantic
OPT= -O0
WARN= -Wall -W
HIREDIS_CFLAGS+= -I../src
TESTS=test-format test-parser test-object test-handle test-context test-request
OBJ=spawn.o net-helper.o
all: $(TESTS)
../$(STLIBNAME):
../src/$(STLIBNAME):
cd .. && $(MAKE) $(STLIBNAME)
test-%: test-%.o $(OBJ) ../$(STLIBNAME)
$(CC) -o $@ $(REAL_LDFLAGS) $^
test-%: test-%.o $(OBJ) ../src/$(STLIBNAME)
$(HIREDIS_LD) -o $@ $^ $(FINAL_LIBS)
.c.o:
$(CC) -std=c99 -pedantic -c -O0 $(REAL_CFLAGS) $<
$(HIREDIS_CC) -c $<
clean:
rm -f *.o $(TESTS)
......@@ -20,6 +25,6 @@ clean:
-include ./Makefile.dep
dep:
$(CC) -MM *.c > Makefile.dep
$(HIREDIS_CC) -MM *.c > Makefile.dep
.PHONY: all clean dep
#ifndef TEST_NET_HELPER
#define TEST_NET_HELPER 1
#include "../handle.h"
#include "handle.h"
typedef struct run_server_args_s run_server_args;
......
#include "../fmacros.h"
#include "fmacros.h"
/* misc */
#include <stdlib.h>
......@@ -19,8 +19,8 @@
#include <unistd.h>
/* local */
#include "../context.h"
#include "../object.h"
#include "context.h"
#include "object.h"
#include "test-helper.h"
#include "net-helper.h"
......
#include "../fmacros.h"
#include "fmacros.h"
/* misc */
#include <stdlib.h>
......@@ -7,7 +7,7 @@
#include <assert.h>
/* local */
#include "../format.h"
#include "format.h"
#include "test-helper.h"
#define SETUP() \
......
#include "../fmacros.h"
#include "fmacros.h"
/* misc */
#include <stdlib.h>
......@@ -16,7 +16,7 @@
#include <netdb.h>
/* local */
#include "../handle.h"
#include "handle.h"
#include "test-helper.h"
TEST(connect_in_refused) {
......
......@@ -15,7 +15,7 @@
/* local */
#include "spawn.h"
#include "../handle.h"
#include "handle.h"
#ifdef __GNUC__
#define UNUSED __attribute__ ((unused))
......
#include "../fmacros.h"
#include "fmacros.h"
/* misc */
#include <stdlib.h>
......@@ -7,8 +7,8 @@
/* local */
#include "test-helper.h"
#include "../parser.h"
#include "../object.h"
#include "parser.h"
#include "object.h"
void test_string(redis_parser *parser) {
const char *buf = "$5\r\nhello\r\n";
......
#include "../fmacros.h"
#include "fmacros.h"
/* misc */
#include <stdlib.h>
......@@ -8,8 +8,8 @@
/* local */
#include "test-helper.h"
#include "../parser.h"
#include "../sds.h"
#include "parser.h"
#include "sds.h"
typedef struct log_entry_s log_entry_t;
......
#include "../fmacros.h"
#include "fmacros.h"
/* misc */
#include <stdlib.h>
......@@ -8,7 +8,7 @@
#include <errno.h>
/* local */
#include "../request.h"
#include "request.h"
#include "test-helper.h"
static struct request_to_write_cb_s {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment