build: Remove gcov from the build
We want to switch to lcov, so let's start with a clean slate.
This commit is contained in:
parent
b850696b31
commit
c4acae7752
@ -37,10 +37,6 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-maintainer-flags --enable-
|
||||
include $(top_srcdir)/build/autotools/Makefile.am.changelog
|
||||
include $(top_srcdir)/build/autotools/Makefile.am.release
|
||||
|
||||
# proxy rule for gcov
|
||||
gcov:
|
||||
@( cd clutter && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $$?
|
||||
|
||||
# proxy rules for tests
|
||||
test-report full-report:
|
||||
$(MAKE) -C tests/conform $(@)
|
||||
@ -48,4 +44,4 @@ test-report full-report:
|
||||
perf-report:
|
||||
$(MAKE) -C tests/performance $(@)
|
||||
|
||||
.PHONY: gcov test-report full-report perf-report
|
||||
.PHONY: test-report full-report perf-report
|
||||
|
@ -1,3 +1 @@
|
||||
SUBDIRS = autotools mingw win32
|
||||
|
||||
EXTRA_DIST = gen-gcov.pl
|
||||
|
@ -5,7 +5,6 @@ EXTRA_DIST = \
|
||||
Makefile.am.marshal \
|
||||
Makefile.am.enums \
|
||||
Makefile.am.changelog \
|
||||
Makefile.am.gcov \
|
||||
Makefile.am.gitignore \
|
||||
Makefile.am.release \
|
||||
introspection.m4 \
|
||||
|
@ -1,33 +0,0 @@
|
||||
if GCOV_ENABLED
|
||||
gcov-report.txt: gcov-clean
|
||||
$(QUIET_GEN)(rm -f $@; \
|
||||
echo -e "Test coverage for Clutter:\n" >> $@; \
|
||||
total_covered=0; total_actual=0; \
|
||||
for file in $(filter %.c,$(gcov_sources)); do \
|
||||
gcov -o .libs/$${file/.c/.gcda} $$file > /dev/null; \
|
||||
if test -f $$file.gcov; then \
|
||||
actual=`grep -v ' -:' $$file.gcov | wc -l`; \
|
||||
uncovered=`grep '#####:' $$file.gcov | wc -l`; \
|
||||
covered=$$((actual - uncovered)); \
|
||||
total_covered=$$((total_covered + covered)); \
|
||||
total_actual=$$((total_actual + actual)); \
|
||||
perl $(top_builddir)/build/gen-gcov.pl $$file.gcov; \
|
||||
fi \
|
||||
done >> $@; \
|
||||
cd $(abs_srcdir); \
|
||||
echo -e "\nSource lines: $$total_actual\nCovered statements: $$total_covered\nTotal coverage: $$((($$total_covered * 100) / $$total_actual))%" >> $@)
|
||||
|
||||
gcov: gcov-report.txt
|
||||
@echo ""; cat gcov-report.txt
|
||||
gcov-clean:
|
||||
@find . -name "*.gcda" -o -name "*.gcov" -delete
|
||||
else
|
||||
gcov-report.txt:
|
||||
@true
|
||||
gcov-clean:
|
||||
@true
|
||||
gcov:
|
||||
@echo "Need to reconfigure with --enable-gcov"
|
||||
endif # GCOV_ENABLED
|
||||
|
||||
.PHONY: gcov gcov-clean gcov-report.txt
|
@ -1,44 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
our $gcov_file = $ARGV[0] or undef;
|
||||
|
||||
open my $g, '<', $gcov_file
|
||||
or die("Unable to open '$gcov_file': $!");
|
||||
|
||||
my ($actual, $covered, $uncovered, $percent) = (0, 0, 0, 0);
|
||||
|
||||
while (<$g>) {
|
||||
my $report_line = $_;
|
||||
|
||||
chomp($report_line);
|
||||
|
||||
$actual += 1;
|
||||
$actual -= 1 if $report_line =~ / -:/;
|
||||
|
||||
$uncovered += 1 if $report_line =~ /#####:/;
|
||||
}
|
||||
|
||||
close($g);
|
||||
|
||||
$covered = $actual - $uncovered;
|
||||
$percent = int(($covered * 100) / $actual);
|
||||
|
||||
$gcov_file =~ s/^\.\///g;
|
||||
$gcov_file =~ s/\.gcov$//g;
|
||||
|
||||
my $cover_file = "$gcov_file:";
|
||||
my $cover_literal = "$covered / $actual";
|
||||
my $cover_percent = "$percent%";
|
||||
|
||||
format ReportLine =
|
||||
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>>>>>>>> @>>>>>
|
||||
$cover_file, $cover_literal, $cover_percent
|
||||
.
|
||||
|
||||
$~ = 'ReportLine';
|
||||
write;
|
||||
|
||||
0;
|
@ -34,7 +34,7 @@ AM_CPPFLAGS = \
|
||||
$(CLUTTER_PROFILE_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS) $(GCOV_CFLAGS)
|
||||
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
|
||||
# these are the gir files we generate using g-ir-scanner
|
||||
INTROSPECTION_GIRS =
|
||||
@ -831,7 +831,6 @@ nodist_libclutter_@CLUTTER_API_VERSION@_la_SOURCES = \
|
||||
libclutter_@CLUTTER_API_VERSION@_la_LDFLAGS = \
|
||||
$(CLUTTER_LINK_FLAGS) \
|
||||
$(CLUTTER_LT_LDFLAGS) \
|
||||
$(GCOV_LDFLAGS) \
|
||||
-export-dynamic \
|
||||
-export-symbols-regex "^(clutter|cally).*" \
|
||||
-rpath $(libdir) \
|
||||
@ -1042,7 +1041,3 @@ TESTS = abicheck.sh
|
||||
endif
|
||||
|
||||
EXTRA_DIST += abicheck.sh
|
||||
|
||||
# GCov rules
|
||||
gcov_sources = $(source_c) $(backend_source_c)
|
||||
include $(top_srcdir)/build/autotools/Makefile.am.gcov
|
||||
|
30
configure.ac
30
configure.ac
@ -909,36 +909,6 @@ AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
|
||||
AC_SUBST(CLUTTER_PROFILE_CFLAGS)
|
||||
AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
|
||||
|
||||
dnl === Coverage report =======================================================
|
||||
|
||||
AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
|
||||
|
||||
AC_MSG_CHECKING([whether to build with gcov testing])
|
||||
|
||||
AC_ARG_ENABLE([gcov],
|
||||
[AS_HELP_STRING([--enable-gcov],
|
||||
[Whether to enable coverage testing (requires gcc
|
||||
and gcov)])],
|
||||
[],
|
||||
[enable_gcov=no])
|
||||
|
||||
AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
|
||||
[
|
||||
AS_IF([test "x$enable_conformance" = "xno"],
|
||||
[AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
|
||||
[AC_MSG_RESULT([yes])]
|
||||
)
|
||||
|
||||
GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
|
||||
GCOV_LDFLAGS="-lgcov"
|
||||
],
|
||||
[AC_MSG_RESULT([no])]
|
||||
)
|
||||
|
||||
AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
|
||||
AC_SUBST([GCOV_CFLAGS])
|
||||
AC_SUBST([GCOV_LDFLAGS])
|
||||
|
||||
dnl === Enable strict compiler flags ==========================================
|
||||
|
||||
# use strict compiler flags only when building from git; the rules for
|
||||
|
Loading…
Reference in New Issue
Block a user