File tree Expand file tree Collapse file tree 5 files changed +27
-15
lines changed Expand file tree Collapse file tree 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))
192192
193193STUFF_TO_CLEAN += $(OBJ )
194194
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 )
196196TEST_OBJS = $(call src_to_o,$(TEST_SRC ) )
197197STUFF_TO_CLEAN += $(TEST_OBJS )
198198
@@ -287,10 +287,10 @@ $(TARGET_LIB): $(OBJ)
287287 $(SILENCE )$(AR ) $(ARFLAGS ) $@ $^
288288 $(SILENCE ) ranlib $@
289289
290- test : $(TEST_TARGET )
290+ test_platform : $(TEST_TARGET )
291291 $(RUN_TEST_TARGET )
292292
293- vtest : $(TEST_TARGET )
293+ vtest_platform : $(TEST_TARGET )
294294 $(RUN_TEST_TARGET ) -v
295295
296296$(CPPUTEST_OBJS_DIR ) /% .o : % .cpp
Original file line number Diff line number Diff line change 33# Set this to @ to keep the makefile quiet
44SILENCE = @
55
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+
613# ---- Outputs ----#
714COMPONENT_NAME = tempodb
815
@@ -11,25 +18,23 @@ CPPUTEST_HOME = CppUTest
1118CPP_PLATFORM = Gcc
1219PROJECT_HOME_DIR = .
1320
14- SRC_DIRS = \
15- src/tempodb\
16- src/tempodb/platform
21+ SRC_DIRS += \
22+ src/tempodb
1723
18- TEST_SRC_DIRS = \
24+ TEST_SRC_DIRS + = \
1925 .\
2026 mocks\
2127 tests/TempoDb\
22- tests\
23-
28+ tests
2429
2530INCLUDE_DIRS =\
2631 .\
2732 $(CPPUTEST_HOME ) /include\
2833 mocks\
2934 include/tempodb
3035
31- MOCKS_SRC_DIRS = \
32- mocks\
36+ MOCKS_SRC_DIRS + = \
37+ mocks
3338
3439CPPUTEST_WARNINGFLAGS = -Wall -Wswitch-default -Werror
3540# CPPUTEST_CFLAGS = -std=c89
@@ -59,4 +64,11 @@ objs/platform/posix.o:
5964CppUTest/lib/libCppUTest.a :
6065 cd CppUTest && make lib/libCppUTest.a
6166
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+
6274include $(CPPUTEST_HOME ) /build/MakefileWorker.mk
Original file line number Diff line number Diff line change 1- #include "TCPSocketStub .h"
1+ #include "posix_mock .h"
22#include <stdio.h>
33
44static 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
33
44#include <arpa/inet.h>
55#include <netdb.h>
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ extern "C" {
44#include " tempodb.h"
55#include < sys/socket.h>
66#include < netinet/in.h>
7- #include " TCPSocketStub .h"
7+ #include " posix_mock .h"
88#include < string.h>
99}
1010
You can’t perform that action at this time.
0 commit comments