diff options
-rw-r--r-- | .bzrignore | 4 | ||||
-rw-r--r-- | Makefile | 7 | ||||
-rwxr-xr-x | configure | 7 | ||||
-rw-r--r-- | protocols/Makefile | 3 | ||||
-rw-r--r-- | protocols/jabber/Makefile | 1 | ||||
-rw-r--r-- | protocols/msn/Makefile | 3 | ||||
-rw-r--r-- | protocols/oscar/Makefile | 3 | ||||
-rw-r--r-- | protocols/yahoo/Makefile | 3 | ||||
-rw-r--r-- | tests/Makefile | 9 | ||||
-rw-r--r-- | tests/check_nick.c | 2 |
10 files changed, 38 insertions, 4 deletions
@@ -12,3 +12,7 @@ encode bitlbee.pc .gdb_history tests/check +*.gcda +*.gcov +*.gcno +*.o @@ -39,14 +39,19 @@ Makefile.settings: clean: $(subdirs) rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode + $(MAKE) -C tests clean distclean: clean $(subdirs) rm -f Makefile.settings config.h bitlbee.pc find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \; + $(MAKE) -C test distclean -check: +check: all $(MAKE) -C tests +gcov: check + gcov *.c + install-doc: $(MAKE) -C doc install @@ -27,6 +27,7 @@ yahoo=1 debug=0 strip=1 +gcov=0 ipv6=1 events=glib @@ -66,6 +67,7 @@ Option Description Default --debug=0/1 Disable/enable debugging $debug --strip=0/1 Disable/enable binary stripping $strip +--gcov=0/1 Disable/enable test coverage reporting $gcov --ipv6=0/1 IPv6 socket support $ipv6 @@ -365,6 +367,11 @@ else fi; fi +if [ "$gcov" = "1" ]; then + echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings + echo "EFLAGS+=-lgcov" >> Makefile.settings +fi + echo if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then nick=`bzr nick` diff --git a/protocols/Makefile b/protocols/Makefile index cc45fb09..7f793bc4 100644 --- a/protocols/Makefile +++ b/protocols/Makefile @@ -25,6 +25,9 @@ LFLAGS += -r # [SH] Phony targets all: protocols.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean $(subdirs) diff --git a/protocols/jabber/Makefile b/protocols/jabber/Makefile index 9b414dc8..abfc7478 100644 --- a/protocols/jabber/Makefile +++ b/protocols/jabber/Makefile @@ -16,6 +16,7 @@ LFLAGS += -r # [SH] Phony targets all: jabber_mod.o +check: all .PHONY: all clean distclean diff --git a/protocols/msn/Makefile b/protocols/msn/Makefile index 873c831c..f53b34ba 100644 --- a/protocols/msn/Makefile +++ b/protocols/msn/Makefile @@ -16,6 +16,9 @@ LFLAGS += -r # [SH] Phony targets all: msn_mod.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean diff --git a/protocols/oscar/Makefile b/protocols/oscar/Makefile index 97a27299..ed2d7f83 100644 --- a/protocols/oscar/Makefile +++ b/protocols/oscar/Makefile @@ -16,6 +16,9 @@ LFLAGS += -r # [SH] Phony targets all: oscar_mod.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean diff --git a/protocols/yahoo/Makefile b/protocols/yahoo/Makefile index b4014f8a..34c3551a 100644 --- a/protocols/yahoo/Makefile +++ b/protocols/yahoo/Makefile @@ -16,6 +16,9 @@ LFLAGS += -r # [SH] Phony targets all: yahoo_mod.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean diff --git a/tests/Makefile b/tests/Makefile index ce8ed690..206331f4 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2,12 +2,17 @@ include ../Makefile.settings LFLAGS +=-lcheck -all: check +all: check ./check +clean: + rm -f check *.o + main_objs = account.o bitlbee.o conf.o crypting.o help.o ini.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o url.o user.o util.o -check: check.o check_util.o check_nick.o $(addprefix ../, $(main_objs)) ../protocols/protocols.o +test_objs = check.o check_util.o check_nick.o + +check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o @echo '*' Linking $@ @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS) diff --git a/tests/check_nick.c b/tests/check_nick.c index 5858e512..b235d260 100644 --- a/tests/check_nick.c +++ b/tests/check_nick.c @@ -22,7 +22,7 @@ START_TEST(test_nick_strip) NULL }; for (i = 0; get[i]; i++) { - char copy[30]; + char copy[60]; strcpy(copy, get[i]); nick_strip(copy); fail_unless (strcmp(copy, expected[i]) == 0, |