Skip to content

Commit

Permalink
Ship code coverage autoconf macros in dist tarball
Browse files Browse the repository at this point in the history
This will enable code coverage for releases as well (install
autoconf-archive into the release tarball build environment for that),
and avoids incompatibilities between the version installed on the target
system and release build system.

Provide a dummy fallback for the Alpine and CentOS CI containers.

Fixes #91
  • Loading branch information
martinpitt committed Jul 22, 2019
1 parent f8929e4 commit 9b9b31b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 6 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ else
echo 'EXTRA_DIST =' > docs/gtk-doc.make
fi

ax_coverage="$(aclocal --print)/ax_code_coverage.m4"
if ! cp --verbose "$ax_coverage" m4; then
echo "ax_code_coverage.m4 (from autoconf-archive) not available, using dummy"
echo 'AC_DEFUN([AX_CODE_COVERAGE],[[CODE_COVERAGE_RULES=''] AC_SUBST([CODE_COVERAGE_RULES])])' > m4/ax_code_coverage.m4
fi

if type lcov >/dev/null 2>&1; then
args="$args --enable-code-coverage"
else
Expand Down
10 changes: 1 addition & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,7 @@ AC_CHECK_PROGS(VALAC, [valac])
AM_PROG_VALAC([0.16.1])
# code coverage support
AC_MSG_CHECKING(for GNOME code coverage support)
m4_ifdef([AX_CODE_COVERAGE],
[AC_MSG_RESULT(yes)
AX_CODE_COVERAGE],
[AC_MSG_RESULT(no)
CODE_COVERAGE_RULES=''
AC_SUBST([CODE_COVERAGE_RULES])
enable_code_coverage="no"])
AX_CODE_COVERAGE
CPPFLAGS="$CPPFLAGS $CODE_COVERAGE_CPPFLAGS"
CFLAGS="$CFLAGS $CODE_COVERAGE_CFLAGS"
LDFLAGS="$LDFLAGS $CODE_COVERAGE_LIBS"
Expand Down
2 changes: 1 addition & 1 deletion tests/run-ubuntu-chroot
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [ -n "${PROPOSED:-}" ]; then
fi
apt-get update
$UPGRADE
apt-get install -y pkg-config dh-autoreconf valac libglib2.0-dev libudev-dev libgudev-1.0-dev python3-gi gobject-introspection libgirepository1.0-dev gir1.2-glib-2.0 gir1.2-gudev-1.0 gtk-doc-tools udev xserver-xorg-video-dummy xserver-xorg-input-evdev xserver-xorg-input-synaptics xinput usbutils gphoto2 valgrind
apt-get install -y pkg-config dh-autoreconf autoconf-archive valac libglib2.0-dev libudev-dev libgudev-1.0-dev python3-gi gobject-introspection libgirepository1.0-dev gir1.2-glib-2.0 gir1.2-gudev-1.0 gtk-doc-tools udev xserver-xorg-video-dummy xserver-xorg-input-evdev xserver-xorg-input-synaptics xinput usbutils gphoto2 valgrind
# run build and tests as user
chown -R buildd:buildd /build
Expand Down

0 comments on commit 9b9b31b

Please sign in to comment.