Commit b71a5201 authored by Sébastien Wilmet's avatar Sébastien Wilmet

Add code coverage support for unit tests

Having green colors should be a good motivation to write more unit
tests. Let's see if it works.
parent 87c33268
......@@ -23,6 +23,7 @@ MAINTAINERCLEANFILES = \
m4/ax_append_link_flags.m4 \
m4/ax_check_compile_flag.m4 \
m4/ax_check_link_flag.m4 \
m4/ax_code_coverage.m4 \
m4/ax_compiler_flags_cflags.m4 \
m4/ax_compiler_flags_gir.m4 \
m4/ax_compiler_flags_ldflags.m4 \
......@@ -76,4 +77,6 @@ MAINTAINERCLEANFILES = \
DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
@CODE_COVERAGE_RULES@
-include $(top_srcdir)/git.mk
......@@ -127,6 +127,10 @@ GOBJECT_INTROSPECTION_CHECK([1.42.0])
AX_REQUIRE_DEFINED([VAPIGEN_CHECK])
VAPIGEN_CHECK
# Code coverage for unit tests
AX_REQUIRE_DEFINED([AX_CODE_COVERAGE])
AX_CODE_COVERAGE()
# check for osx platform
AC_MSG_CHECKING([for Mac OS X platform])
case "$host" in
......@@ -199,4 +203,5 @@ Configuration:
Compiler: ${CC}
GObject introspection: ${found_introspection}
Vala: ${enable_vala}
Code coverage: ${enable_code_coverage}
"
SUBDIRS = resources
@CODE_COVERAGE_RULES@
AM_CPPFLAGS = \
-DDATADIR=\""$(datadir)"\" \
-DG_LOG_DOMAIN=\"gspell\" \
......@@ -7,11 +9,10 @@ AM_CPPFLAGS = \
-I$(top_builddir) \
-I$(top_srcdir) \
$(WARN_CFLAGS) \
$(CODE_COVERAGE_CPPFLAGS) \
$(DEP_CFLAGS) \
$(GTK_MAC_CFLAGS)
AM_LDFLAGS = $(WARN_LDFLAGS)
BUILT_SOURCES = \
gspell-resources.c
......@@ -70,8 +71,13 @@ libgspell_core_la_SOURCES = \
nodist_libgspell_core_la_SOURCES = \
$(BUILT_SOURCES)
libgspell_core_la_LDFLAGS = \
-no-undefined
libgspell_core_la_CFLAGS = \
$(CODE_COVERAGE_CFLAGS)
libgspell_core_la_LDFLAGS = \
-no-undefined \
$(WARN_LDFLAGS) \
$(CODE_COVERAGE_LDFLAGS)
# The real library.
lib_LTLIBRARIES = libgspell-1.la
......@@ -83,10 +89,15 @@ libgspell_1_la_LIBADD = \
$(DEP_LIBS) \
$(GTK_MAC_LIBS)
libgspell_1_la_CFLAGS = \
$(CODE_COVERAGE_CFLAGS)
libgspell_1_la_LDFLAGS = \
-version-info $(GSPELL_LT_VERSION) \
-no-undefined \
-export-symbols-regex "^gspell_.*"
-export-symbols-regex "^gspell_.*" \
$(WARN_LDFLAGS) \
$(CODE_COVERAGE_LDFLAGS)
libgspell_1_includedir = $(includedir)/gspell-1/gspell
libgspell_1_include_HEADERS = $(gspell_public_headers)
......@@ -101,7 +112,7 @@ if OS_OSX
libgspell_1_la_LDFLAGS += \
-framework Cocoa
libgspell_1_la_CFLAGS = \
libgspell_1_la_CFLAGS += \
-xobjective-c
gspell_private_headers += \
......
@CODE_COVERAGE_RULES@
AM_CPPFLAGS = \
-I$(top_srcdir) \
$(WARN_CFLAGS) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment