]> git.draconx.ca Git - cdecl99.git/blobdiff - Makefile.am
tests: Use TAP helpers in rng-test.
[cdecl99.git] / Makefile.am
index 336e4439ba82f760cb776d09d7ef32fb8894cafd..ee4f7799cb56a250695e637ce2f3888f098f200e 100644 (file)
@@ -81,7 +81,7 @@ $(libmain_a_OBJECTS): src/options.h
 
 check_PROGRAMS = t/crossparse t/normalize t/randomdecl t/rng-test
 check_LIBRARIES = libtest.a
-libtest_a_SOURCES = t/testlib.c t/rng.c common/src/help.c
+libtest_a_SOURCES = t/testlib.c t/rng.c common/src/help.c common/src/tap.c
 $(libtest_a_OBJECTS): $(gnulib_headers)
 
 TEST_LIBS = libtest.a libcdecl.la libgnu.a $(LDEXP_LIBM)
@@ -335,6 +335,24 @@ atlocal: config.status
 check_DATA = atlocal
 CLEANFILES += atlocal
 
+# Note: to reliably test linking against the installed library we directly
+# refer to the just-installed .la file, rather than more typical library flags
+# (-Lfoo -lfoo).  Otherwise libtool can pick up libcdecl.la from the current
+# working directory which defeats the point of an install check.
+EXTRA_PROGRAMS = t/installcheck
+t_installcheck_CPPFLAGS = -I$(DESTDIR)$(includedir)
+t_installcheck_LDADD = $(DESTDIR)$(libdir)/libcdecl.la
+t_installcheck_CFLAGS =
+t_installcheck_SHORTNAME = x
+
+installcheck-local:
+       rm -f t/installcheck$(EXEEXT)
+       $(MAKE) $(AM_MAKEFLAGS) t/installcheck$(EXEEXT)
+       t/installcheck$(EXEEXT) | diff - $(srcdir)/t/installcheck.exp
+.PHONY: installcheck-local
+EXTRA_DIST += t/installcheck.c t/installcheck.exp
+CLEANFILES += t/installcheck$(EXEEXT)
+
 include $(top_srcdir)/lib/gnulib.mk
 include $(top_srcdir)/common/snippet/glconfig.mk
 include $(top_srcdir)/common/snippet/autotest.mk