diff --git a/.travis.yml b/.travis.yml index 7833809..b0e26c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,9 +6,9 @@ compiler: matrix: include: - compiler: gcc - env: CONFIGURE_OPTION='--enable-debug --with-malloc=jemalloc' COVERALLS=yes VALGRIND=no DEBUG=yes + env: CONFIGURE_OPTION='--enable-debug --enable-gcov --with-malloc=jemalloc' COVERALLS=yes VALGRIND=no DEBUG=yes - compiler: gcc - env: CONFIGURE_OPTION='--enable-debug' COVERALLS=yes VALGRIND=yes DEBUG=yes LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ + env: CONFIGURE_OPTION='--enable-debug --enable-gcov' COVERALLS=yes VALGRIND=yes DEBUG=yes LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ - compiler: clang env: ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=/usr/local/clang-3.4/bin/llvm-symbolizer CFLAGS='-fsanitize=address -g -O1' diff --git a/Makefile.am b/Makefile.am index be1f03c..b7ff7d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS=3rdparty src tests lib_LTLIBRARIES = libr3.la libr3_la_SOURCES = libr3_la_LIBADD = 3rdparty/libr3ext.la src/libr3core.la -libr3_la_LDFLAGS = -static +libr3_la_LDFLAGS = AM_CFLAGS=$(DEPS_CFLAGS) $(GVC_DEPS_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/3rdparty -Wall -std=c99 AM_LDFLAGS=$(DEPS_LIBS) $(GVC_DEPS_LIBS) diff --git a/configure.ac b/configure.ac index 5d4c10b..f1a6627 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.64]) AC_USE_SYSTEM_EXTENSIONS AC_CONFIG_HEADERS(config.h) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([foreign subdir-objects]) +AM_INIT_AUTOMAKE([foreign subdir-objects color-tests]) LT_INIT AC_PROG_CC AC_PROG_CC_STDC @@ -23,6 +23,13 @@ PKG_PROG_PKG_CONFIG +AC_ARG_ENABLE([gcov], + [AS_HELP_STRING([--enable-gcov], + [use Gcov to test the test suite])], + [], + [enable_gcov=no]) +AM_CONDITIONAL([COND_GCOV],[test '!' "$enable_gcov" = no]) + AC_ARG_WITH([malloc], diff --git a/src/Makefile.am b/src/Makefile.am index d43514d..31a3aed 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,6 @@ AM_CFLAGS=$(DEPS_CFLAGS) $(GVC_DEPS_CFLAGS) $(JSONC_CFLAGS) -I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/3rdparty -Wall -std=c99 AM_LDFLAGS=$(DEPS_LIBS) $(GVC_DEPS_LIBS) $(JSONC_LIBS) +MAYBE_COVERAGE=--coverage noinst_LTLIBRARIES = libr3core.la # lib_LIBRARIES = libr3.a @@ -9,6 +10,13 @@ if ENABLE_JSON libr3core_la_SOURCES += json.c endif +if COND_GCOV +# MAYBE_COVERAGE=--coverage --no-inline +AM_CFLAGS += $(MAYBE_COVERAGE) +endif + +MOSTLYCLEANFILES = *.gcov *.gcda *.gcno + # libr3_la_LDFLAGS = -export-symbols-regex '^r3_|^match_'