[gobject-introspection] tests: build tests only on make check



commit 3a308bb438246f7d6e87ebe2f6efeb1795fdcd1e
Author: Alexandre Rostovtsev <tetromino gmail com>
Date:   Mon Aug 22 02:49:51 2011 -0400

    tests: build tests only on make check
    
    Use automake's check_ prefix and avoid putting anything nontrivial in
    BUILT_SOURCES so that tests are build only on make check.
    
    The dummy -rpath in AM_LDFLAGS in tests/scanner/Makefile.am is needed to
    force libtool to build shared libraries for check_LTLIBRARIESS targets
    (automake builds check_LTLIBRARIES as static by default); see
    http://lists.gnu.org/archive/html/automake/2005-10/msg00107.html
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657066

 tests/Makefile.am            |    6 ++----
 tests/repository/Makefile.am |    2 +-
 tests/scanner/Makefile.am    |   16 ++++++----------
 3 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 20ecc17..2d395a3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,16 +16,14 @@ tests_DATA =		    \
     gimarshallingtests.c    \
     gimarshallingtests.h
 
-testlib_LTLIBRARIES = libeverything-1.0.la libgimarshallingtests-1.0.la
-testlibdir=$(prefix)/unused
-install-testlibLTLIBRARIES: # prevent it from being installed
+check_LTLIBRARIES = libeverything-1.0.la libgimarshallingtests-1.0.la
 
 libeverything_1_0_la_SOURCES = everything.c
 libgimarshallingtests_1_0_la_SOURCES = gimarshallingtests.c
 
 EXTRA_DIST += gimarshallingtests.h
 
-BUILT_SOURCES += everything.c everything.h Everything-1.0.gir GIMarshallingTests-1.0.gir
+BUILT_SOURCES += everything.c everything.h
 
 CLEANFILES += \
     $(BUILT_SOURCES) \
diff --git a/tests/repository/Makefile.am b/tests/repository/Makefile.am
index 268d9f9..ffc635f 100644
--- a/tests/repository/Makefile.am
+++ b/tests/repository/Makefile.am
@@ -2,7 +2,7 @@ AM_CFLAGS = $(GOBJECT_CFLAGS)
 AM_LDFLAGS = -module -avoid-version
 LIBS = $(GOBJECT_LIBS)
 
-noinst_PROGRAMS = gitestrepo gitestthrows gitypelibtest
+check_PROGRAMS = gitestrepo gitestthrows gitypelibtest
 
 gitestrepo_SOURCES = $(srcdir)/gitestrepo.c
 gitestrepo_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository
diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am
index 6b78ee7..fc2e260 100644
--- a/tests/scanner/Makefile.am
+++ b/tests/scanner/Makefile.am
@@ -3,24 +3,21 @@ include $(top_srcdir)/Makefile.introspection
 
 INTROSPECTION_SCANNER_ARGS += --warn-all --warn-error -I.
 
-# We need to build a shared library, which can be dlopened
-# it does not work with noinst_LTLIBRARIES
-testlib_LTLIBRARIES = \
+check_LTLIBRARIES = \
 	libannotation.la \
 	libtestinherit.la \
 	libfoo.la \
 	libutility.la \
 	libgtkfrob.la
 if HAVE_CAIRO
-testlib_LTLIBRARIES += libregress.la
+check_LTLIBRARIES += libregress.la
 endif
 
-testlibdir = $(prefix)/unused
-install-testlibLTLIBRARIES: # prevent it from being installed
-
 AM_CPPFLAGS = -I$(top_srcdir)/girepository
 AM_CFLAGS = $(GIO_CFLAGS) $(GOBJECT_CFLAGS) $(GTHREAD_CFLAGS)
-AM_LDFLAGS = -avoid-version
+# -rpath needed to force libtool to build a shared library for a check_LTLIBRARIES
+# target. See http://lists.gnu.org/archive/html/automake/2005-10/msg00107.html
+AM_LDFLAGS = -rpath /unused -avoid-version
 LIBS = $(GOBJECT_LIBS) $(GTHREAD_LIBS)
 
 libannotation_la_SOURCES = $(srcdir)/annotation.c $(srcdir)/annotation.h
@@ -49,7 +46,6 @@ CHECKGIRS = $(GIRS:.gir=.gir.check)
 EXPECTEDGIRS = $(GIRS:.gir=-expected.gir)
 INTROSPECTION_GIRS = $(GIRS)
 CLEANFILES = $(TYPELIBS) $(GIRS)
-BUILT_SOURCES = $(TYPELIBS) $(GIRS)
 EXTRA_DIST = $(EXPECTEDGIRS)
 
 Regress-1.0.gir: $(top_builddir)/Gio-2.0.gir libregress.la
@@ -102,7 +98,7 @@ GtkFrob_1_0_gir_FILES = $(libgtkfrob_la_SOURCES)
 GtkFrob_1_0_gir_SCANNERFLAGS = --identifier-prefix=Gtk --symbol-prefix=gtk_frob
 GIRS += GtkFrob-1.0.gir
 
-noinst_PROGRAMS = barapp
+check_PROGRAMS = barapp
 
 barapp_SOURCES = $(srcdir)/barapp.c $(srcdir)/barapp.h
 barapp_LDADD = $(top_builddir)/libgirepository-1.0.la



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]