File tree 5 files changed +27
-15
lines changed
5 files changed +27
-15
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ OBJ = $(call src_to_o,$(SRC))
192
192
193
193
STUFF_TO_CLEAN += $(OBJ )
194
194
195
- TEST_SRC = $(call get_src_from_dir_list, $(TEST_SRC_DIRS ) )
195
+ TEST_SRC = $(call get_src_from_dir_list, $(TEST_SRC_DIRS ) ) $( TEST_SRC_FILES )
196
196
TEST_OBJS = $(call src_to_o,$(TEST_SRC ) )
197
197
STUFF_TO_CLEAN += $(TEST_OBJS )
198
198
@@ -287,10 +287,10 @@ $(TARGET_LIB): $(OBJ)
287
287
$(SILENCE )$(AR ) $(ARFLAGS ) $@ $^
288
288
$(SILENCE ) ranlib $@
289
289
290
- test : $(TEST_TARGET )
290
+ test_platform : $(TEST_TARGET )
291
291
$(RUN_TEST_TARGET )
292
292
293
- vtest : $(TEST_TARGET )
293
+ vtest_platform : $(TEST_TARGET )
294
294
$(RUN_TEST_TARGET ) -v
295
295
296
296
$(CPPUTEST_OBJS_DIR ) /% .o : % .cpp
Original file line number Diff line number Diff line change 3
3
# Set this to @ to keep the makefile quiet
4
4
SILENCE = @
5
5
6
+ ifdef PLATFORM
7
+ COMPONENT_NAME = "$(PLATFORM)_"
8
+ SRC_FILES = src/tempodb/platform/$(PLATFORM).c
9
+ TEST_SRC_FILES = tests/TempoDb/platform/$(PLATFORM)_test.c
10
+ MOCKS_SRC_DIRS = mocks/$(PLATFORM)
11
+ endif
12
+
6
13
# ---- Outputs ----#
7
14
COMPONENT_NAME = tempodb
8
15
@@ -11,25 +18,23 @@ CPPUTEST_HOME = CppUTest
11
18
CPP_PLATFORM = Gcc
12
19
PROJECT_HOME_DIR = .
13
20
14
- SRC_DIRS = \
15
- src/tempodb\
16
- src/tempodb/platform
21
+ SRC_DIRS += \
22
+ src/tempodb
17
23
18
- TEST_SRC_DIRS = \
24
+ TEST_SRC_DIRS + = \
19
25
.\
20
26
mocks\
21
27
tests/TempoDb\
22
- tests\
23
-
28
+ tests
24
29
25
30
INCLUDE_DIRS =\
26
31
.\
27
32
$(CPPUTEST_HOME ) /include\
28
33
mocks\
29
34
include/tempodb
30
35
31
- MOCKS_SRC_DIRS = \
32
- mocks\
36
+ MOCKS_SRC_DIRS + = \
37
+ mocks
33
38
34
39
CPPUTEST_WARNINGFLAGS = -Wall -Wswitch-default -Werror
35
40
# CPPUTEST_CFLAGS = -std=c89
@@ -59,4 +64,11 @@ objs/platform/posix.o:
59
64
CppUTest/lib/libCppUTest.a :
60
65
cd CppUTest && make lib/libCppUTest.a
61
66
67
+ vtest_posix :
68
+ $(SILENCE ) echo " >>> Running Posix Tests"
69
+ $(SILENCE ) PLATFORM=" posix" make vtest_platform
70
+ $(SILENCE ) echo " <<< Finished Posix Tests"
71
+
72
+ vtest : vtest_posix
73
+
62
74
include $(CPPUTEST_HOME ) /build/MakefileWorker.mk
Original file line number Diff line number Diff line change 1
- #include "TCPSocketStub .h"
1
+ #include "posix_mock .h"
2
2
#include <stdio.h>
3
3
4
4
static struct hostent * hent ;
Original file line number Diff line number Diff line change 1
- #ifndef TCPSocketStub_H
2
- #define TCPSocketStub_H
1
+ #ifndef TEMPODB_PLATFORM_POSIX_MOCK_H
2
+ #define TEMPODB_PLATFORM_POSIX_MOCK_H
3
3
4
4
#include <arpa/inet.h>
5
5
#include <netdb.h>
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ extern "C" {
4
4
#include " tempodb.h"
5
5
#include < sys/socket.h>
6
6
#include < netinet/in.h>
7
- #include " TCPSocketStub .h"
7
+ #include " posix_mock .h"
8
8
#include < string.h>
9
9
}
10
10
You can’t perform that action at this time.
0 commit comments