aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-08-24 17:43:42 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-08-25 18:12:58 +0200
commitaedf4ffd7d16721b522df2d20b1f41f8574c3940 (patch)
tree330412cfe3f46847c9b9751c087d5fd2489e962f
parent157dd3f1c90fd928c21403113e0e7ab82b9be7c8 (diff)
downloadhardware_replicant_libsamsung-ipc-aedf4ffd7d16721b522df2d20b1f41f8574c3940.tar.gz
hardware_replicant_libsamsung-ipc-aedf4ffd7d16721b522df2d20b1f41f8574c3940.tar.bz2
hardware_replicant_libsamsung-ipc-aedf4ffd7d16721b522df2d20b1f41f8574c3940.zip
Add tests for builds using tarballs
This enables to spot issues that prevents build or tests from working when using tarballs, like when required files not tracked by automake are added to git but not to EXTRA_DIST. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--Makefile.am31
-rw-r--r--configure.ac4
2 files changed, 35 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 957a649..f5dcb1d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -28,3 +28,34 @@ MAINTAINERCLEANFILES = \
Makefile.in missing config.h.in \
mkinstalldirs *~ \
$(NULL)
+
+# With the next release of libsamsung-ipc, we will also release
+# tarballs.
+#
+# Until now, no automatic testing was done with the libsamsung-ipc
+# tarballs (all tests were done with the libsamsung-ipc git
+# repository).
+#
+# We also need to verify that everything also builds and that the
+# tests also work with tarballs. This can spot mistakes where people
+# add new files that are not automatically picked up by automake and
+# forget to add these files to EXTRA_DIST.
+#
+# This test runs only from git because it is not necessary with a
+# tarball build. If we wanted to run it anyway we would end up in an
+# infinite recursion as a given test from a tarball would then spawn
+# another build and test from a tarball which would then spawn again
+# another build and test.
+check-local: dist
+ if [ -d $(srcdir)/.git ] ; then \
+ BUILD_TMPDIR=`mktemp -d` && \
+ echo $$BUILD_TMPDIR && \
+ mkdir $$BUILD_TMPDIR/build $$BUILD_TMPDIR/destdir && \
+ tar xf $(srcdir)/libsamsung-ipc-$(VERSION).tar.xz \
+ -C $$BUILD_TMPDIR && \
+ cd $$BUILD_TMPDIR/build && \
+ ../libsamsung-ipc-$(VERSION)/configure $(CONFIGURE_ARGUMENTS) && \
+ make check && \
+ make install DESTDIR=`realpath $$BUILD_TMPDIR/destdir` && \
+ rm -rf $$BUILD_TMPDIR ; \
+ fi
diff --git a/configure.ac b/configure.ac
index 4027a47..8dd7400 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,8 @@
AC_INIT([libsamsung-ipc], [0.7.0], [replicant@osuosl.org], [libsamsung-ipc])
+
+AC_SUBST(CONFIGURE_ARGUMENTS)
+: ${CONFIGURE_ARGUMENTS="$@"}
+
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([dist-bzip2 dist-xz subdir-objects])