From 28cc98d33ae0116f399131974d6d5ad88dcd1a01 Mon Sep 17 00:00:00 2001 From: Timofey Turenko Date: Thu, 14 Aug 2014 23:22:21 +0300 Subject: [PATCH] add gcov patch file --- gcov.diff | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 gcov.diff diff --git a/gcov.diff b/gcov.diff new file mode 100644 index 000000000..c310d1b08 --- /dev/null +++ b/gcov.diff @@ -0,0 +1,138 @@ +diff --git a/makefile.inc b/makefile.inc +index f2d93bf..c7dbffa 100644 +--- a/makefile.inc ++++ b/makefile.inc +@@ -24,8 +24,8 @@ endif + + # -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC + +-CFLAGS := $(CFLAGS) -Wall +-LDLIBS := $(LDLIBS) -pthread ++CFLAGS := $(CFLAGS) -Wall -fprofile-arcs -ftest-coverage ++LDLIBS := $(LDLIBS) -pthread -lgcov + LDMYSQL := -lmysqld + CPP_LDLIBS := -lstdc++ + +diff --git a/server/core/Makefile b/server/core/Makefile +index 9bf650c..9df75a7 100644 +--- a/server/core/Makefile ++++ b/server/core/Makefile +@@ -75,7 +75,7 @@ POBJS=maxpasswd.o secrets.o utils.o + LIBS=-L$(EMBEDDED_LIB) \ + -lmysqld \ + -lz -lm -lcrypt -lcrypto -ldl -laio -lrt -pthread -llog_manager \ +- -L../inih/extra -linih -lssl -lstdc++ ++ -L../inih/extra -linih -lssl -lstdc++ -lgcov + + all: maxscale maxkeys maxpasswd + +diff --git a/server/modules/filter/Makefile b/server/modules/filter/Makefile +index 931c35a..d5dcca9 100644 +--- a/server/modules/filter/Makefile ++++ b/server/modules/filter/Makefile +@@ -25,7 +25,7 @@ UTILSPATH := $(ROOT_PATH)/utils + + CC=cc + CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) \ +- -I$(UTILSPATH) -Wall -g ++ -I$(UTILSPATH) -Wall -g -fprofile-arcs -ftest-coverage + + include ../../../makefile.inc + +@@ -44,7 +44,7 @@ TEESRCS=tee.c + TEEOBJ=$(TEESRCS:.c=.o) + SRCS=$(TESTSRCS) $(QLASRCS) $(REGEXSRCS) $(TOPNSRCS) $(TEESRCS) + OBJ=$(SRCS:.c=.o) +-LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager ++LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager -lgcov + MODULES= libtestfilter.so libqlafilter.so libregexfilter.so libtopfilter.so libtee.so + + +diff --git a/server/modules/monitor/Makefile b/server/modules/monitor/Makefile +index 7fdbc58..bca01de 100644 +--- a/server/modules/monitor/Makefile ++++ b/server/modules/monitor/Makefile +@@ -28,7 +28,7 @@ CFLAGS=-c -fPIC -I. -I/usr/include -I../include -I../../include -I$(LOGPATH) \ + + LDFLAGS=-shared -L$(LOGPATH) -Wl,-rpath,$(DEST)/lib \ + -Wl,-rpath,$(LOGPATH) -Wl,-rpath,$(UTILSPATH) \ +- -Wl,-rpath,$(EMBEDDED_LIB) ++ -Wl,-rpath,$(EMBEDDED_LIB) -fprofile-arcs -ftest-coverage + + + +@@ -39,7 +39,7 @@ GALERAOBJ=$(GALERASRCS:.c=.o) + SRCS=$(MYSQLSRCS) + OBJ=$(SRCS:.c=.o) + LIBS=$(UTILSPATH)/skygw_utils.o -llog_manager \ +- -L$(EMBEDDED_LIB) -lmysqld ++ -L$(EMBEDDED_LIB) -lmysqld -lgcov + MODULES=libmysqlmon.so libgaleramon.so + + +diff --git a/server/modules/protocol/Makefile b/server/modules/protocol/Makefile +index 54a8f8c..c8913ab 100644 +--- a/server/modules/protocol/Makefile ++++ b/server/modules/protocol/Makefile +@@ -31,7 +31,7 @@ UTILSPATH := $(ROOT_PATH)/utils + + CC=cc + CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) \ +- -I$(UTILSPATH) -Wall -g ++ -I$(UTILSPATH) -Wall -g -fprofile-arcs -ftest-coverage + + include ../../../makefile.inc + +@@ -51,7 +51,7 @@ MAXSCALEDOBJ=$(MAXSCALEDSRCS:.c=.o) + SRCS=$(MYSQLCLIENTSRCS) $(MYSQLBACKENDSRCS) $(TELNETDSRCS) $(HTTPDSRCS) \ + $(MAXSCALEDSRCS) + OBJ=$(SRCS:.c=.o) +-LIBS=$(UTILSPATH)/skygw_utils.o ++LIBS=$(UTILSPATH)/skygw_utils.o -lgcov + MODULES=libMySQLClient.so libMySQLBackend.so libtelnetd.so libHTTPD.so \ + libmaxscaled.so + +diff --git a/server/modules/routing/Makefile b/server/modules/routing/Makefile +index 4feac68..afd1da7 100644 +--- a/server/modules/routing/Makefile ++++ b/server/modules/routing/Makefile +@@ -29,7 +29,7 @@ UTILSPATH := $(ROOT_PATH)/utils + + CC=cc + CFLAGS=-c -fPIC -I/usr/include -I../include -I../../include -I$(LOGPATH) \ +- -I$(UTILSPATH) -Wall -g ++ -I$(UTILSPATH) -Wall -g -fprofile-arcs -ftest-coverage + + include ../../../makefile.inc + +@@ -46,7 +46,7 @@ CLISRCS=cli.c debugcmd.c + CLIOBJ=$(CLISRCS:.c=.o) + SRCS=$(TESTSRCS) $(READCONSRCS) $(DEBUGCLISRCS) cli.c + OBJ=$(SRCS:.c=.o) +-LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager ++LIBS=$(UTILSPATH)/skygw_utils.o -lssl -llog_manager -lgcov + MODULES= libdebugcli.so libreadconnroute.so libtestroute.so libcli.so + + +diff --git a/server/modules/routing/readwritesplit/Makefile b/server/modules/routing/readwritesplit/Makefile +index c60f2ff..a3a643e 100644 +--- a/server/modules/routing/readwritesplit/Makefile ++++ b/server/modules/routing/readwritesplit/Makefile +@@ -27,7 +27,7 @@ QCLASSPATH := $(ROOT_PATH)/query_classifier + CC=cc + CFLAGS=-c -fPIC -I/usr/include -I../../include -I../../../include \ + -I$(LOGPATH) -I$(UTILSPATH) -I$(QCLASSPATH) \ +- $(MYSQL_HEADERS) -Wall -g ++ $(MYSQL_HEADERS) -Wall -g -fprofile-arcs -ftest-coverage + + include ../../../../makefile.inc + +@@ -38,7 +38,7 @@ LDFLAGS=-shared -L$(LOGPATH) -L$(QCLASSPATH) -L$(EMBEDDED_LIB) \ + + SRCS=readwritesplit.c + OBJ=$(SRCS:.c=.o) +-LIBS=-lssl -pthread -llog_manager -lquery_classifier -lmysqld ++LIBS=-lssl -pthread -llog_manager -lquery_classifier -lmysqld -lgcov + MODULES=libreadwritesplit.so + + all: $(MODULES)