AC_SUBST(CHECK_MINOR_VERSION)
AC_SUBST(CHECK_MICRO_VERSION)
+AC_ARG_ENABLE(gcov,
+AC_HELP_STRING([--enable-gcov],[turn on code coverage analysis tools]),
+[case "${enableval}" in
+ yes) enable_gcov=true ;;
+ no) enable_gcov=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-gcov) ;;
+esac], [enable_gcov=false ])
+
+AM_CONDITIONAL(ENABLE_GCOV, test x"$enable_gcov" = "xtrue")
+
AC_ARG_ENABLE(plain_docdir,
[ --enable-plain-docdir don't append version information to docdir],
[case "${enableval}" in
if test -n "$GCC"; then
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings"
fi
+AC_CHECK_PROGS(GCOV, gcov, false)
+AC_CHECK_PROGS(LCOV, lcov, false)
+AC_CHECK_PROGS(GENHTML, genhtml, false)
AC_CHECK_PROG(have_docbook2html,docbook2html,yes)
if test x"$have_docbook2html" != "xyes" ; then
AC_MSG_WARN([required tools not found, not building docs])
fi
AM_CONDITIONAL(MAKE_DOC, test x"$have_docbook2html" = "xyes")
+
dnl Checks for libraries.
dnl Checks for header files.
include_HEADERS=check.h
+if ENABLE_GCOV
+libcheck_a_CFLAGS=-fprofile-arcs -ftest-coverage
+endif
+
libcheck_a_SOURCES=\
check_impl.h \
check.h \
check_str.c
EXTRA_DIST=check.h.in
+
+CLEANFILES=*~ *.bb *.bbg *.da
+
+LCOV_OUTPUT = lcov.info
+LCOV_HTML = lcov_html
+LCOV_LCOV = @LCOV@
+LCOV_GENHTML = @GENHTML@
+TEST_PROG = ../tests/check_check
+
+lcov: $(LCOV_HTML)
+
+$(TEST_PROG): force
+ @$(MAKE) -C ../tests
+
+$(LCOV_OUTPUT): $(TEST_PROG)
+ $(TEST_PROG)
+ $(LCOV_LCOV) --capture --directory . --output-file $(LCOV_OUTPUT)
+
+$(LCOV_HTML): $(LCOV_OUTPUT)
+ -$(RM) -r $(LCOV_HTML)
+ LANG=C $(LCOV_GENHTML) --output-directory $(LCOV_HTML) --title "Check Code Coverage" --show-details $(LCOV_OUTPUT)
+ @echo "Point a web browser at $(LCOV_HTML)/index.html to see results."
+
+clean-local: lcov-clean
+
+.PHONY: lcov-clean
+lcov-clean:
+ -$(RM) -r $(LCOV_HTML) $(LCOV_OUTPUT)
+
+.PHONY: force
+force:
ex_xml_output_SOURCES = ex_xml_output.c
-
+LIBCHECK_A=../src/libcheck.a
INCLUDES = -I$(srcdir)/../src
-LDADD = ../src/libcheck.a
+LDADD = $(LIBCHECK_A)
CLEANFILES = *~ *.log test_logfile
+
+$(LIBCHECK_A):
+ $(MAKE) -C ../src