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
fde85202
Commit
fde85202
authored
Jun 08, 2012
by
Pieter Noordhuis
Browse files
Adapt tests to new source layout
parent
e4df5892
Changes
9
Hide whitespace changes
Inline
Side-by-side
test/Makefile
View file @
fde85202
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
test/net-helper.h
View file @
fde85202
#ifndef TEST_NET_HELPER
#define TEST_NET_HELPER 1
#include "
../
handle.h"
#include "handle.h"
typedef
struct
run_server_args_s
run_server_args
;
...
...
test/test-context.c
View file @
fde85202
#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"
...
...
test/test-format.c
View file @
fde85202
#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() \
...
...
test/test-handle.c
View file @
fde85202
#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
)
{
...
...
test/test-helper.h
View file @
fde85202
...
...
@@ -15,7 +15,7 @@
/* local */
#include "spawn.h"
#include "
../
handle.h"
#include "handle.h"
#ifdef __GNUC__
#define UNUSED __attribute__ ((unused))
...
...
test/test-object.c
View file @
fde85202
#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\n
hello
\r\n
"
;
...
...
test/test-parser.c
View file @
fde85202
#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
;
...
...
test/test-request.c
View file @
fde85202
#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
{
...
...
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