[gtk+] testsuite: clean up build machinery a bit
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testsuite: clean up build machinery a bit
- Date: Sat, 15 Jun 2013 20:03:48 +0000 (UTC)
commit e4af0e9bedda0afdf8ba1f25ab08195a0860bcf2
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 15 14:23:22 2013 -0400
testsuite: clean up build machinery a bit
No point in setting LDADD for every single binary,
when we can do it just once. Also, generate test.in files.
testsuite/gdk/Makefile.am | 57 ++-----
testsuite/gdk/display.test.in | 3 -
testsuite/gdk/encoding.test.in | 3 -
testsuite/gdk/keysyms.test.in | 3 -
testsuite/gdk/rgba.test.in | 3 -
testsuite/gtk/Makefile.am | 273 ++++++++++--------------------
testsuite/gtk/accel.test.in | 3 -
testsuite/gtk/accessible.test.in | 3 -
testsuite/gtk/action.test.in | 3 -
testsuite/gtk/bitmask.test.in | 3 -
testsuite/gtk/builder.test.in | 3 -
testsuite/gtk/cellarea.test.in | 3 -
testsuite/gtk/crossingevents.test.in | 3 -
testsuite/gtk/defaultvalue.test.in | 3 -
testsuite/gtk/entry.test.in | 3 -
testsuite/gtk/expander.test.in | 3 -
testsuite/gtk/filechooser.test.in | 3 -
testsuite/gtk/floating.test.in | 3 -
testsuite/gtk/grid.test.in | 3 -
testsuite/gtk/gtkmenu.test.in | 3 -
testsuite/gtk/keyhash.test.in | 3 -
testsuite/gtk/object.test.in | 3 -
testsuite/gtk/objects-finalize.test.in | 3 -
testsuite/gtk/papersize.test.in | 3 -
testsuite/gtk/rbtree.test.in | 3 -
testsuite/gtk/recentmanager.test.in | 3 -
testsuite/gtk/regression-tests.test.in | 3 -
testsuite/gtk/stylecontext.test.in | 3 -
testsuite/gtk/templates.test.in | 3 -
testsuite/gtk/testing.test.in | 3 -
testsuite/gtk/textbuffer.test.in | 3 -
testsuite/gtk/textiter.test.in | 3 -
testsuite/gtk/treemodel.test.in | 3 -
testsuite/gtk/treepath.test.in | 3 -
testsuite/gtk/treeview-scrolling.test.in | 3 -
testsuite/gtk/treeview.test.in | 3 -
testsuite/gtk/window.test.in | 3 -
37 files changed, 104 insertions(+), 331 deletions(-)
---
diff --git a/testsuite/gdk/Makefile.am b/testsuite/gdk/Makefile.am
index a8fd35d..e8c5fa5 100644
--- a/testsuite/gdk/Makefile.am
+++ b/testsuite/gdk/Makefile.am
@@ -4,63 +4,42 @@ NULL=
noinst_PROGRAMS = $(TEST_PROGS)
-AM_CPPFLAGS = \
- $(GDK_DEP_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_builddir)/gdk \
+AM_CPPFLAGS = \
+ $(GDK_DEP_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_builddir)/gdk \
$(NULL)
-progs_ldadd = \
- $(GDK_DEP_LIBS) \
+LDADD = \
+ $(GDK_DEP_LIBS) \
$(top_builddir)/gdk/libgdk-3.la \
$(NULL)
#TEST_PROGS += check-gdk-cairo
-#check_gdk_cairo_SOURCES = check-gdk-cairo.c
-#check_gdk_cairo_LDADD = $(progs_ldadd)
-TEST_PROGS += rgba
-rgba_SOURCES = rgba.c
-rgba_LDADD = $(progs_ldadd)
-
-TEST_PROGS += encoding
-encoding_SOURCES = encoding.c
-encoding_LDADD = $(progs_ldadd)
-
-TEST_PROGS += display
-display_SOURCES = display.c
-display_LDADD = $(progs_ldadd)
-
-TEST_PROGS += keysyms
-keysyms_SOURCES = keysyms.c
-keysyms_LDADD = $(progs_ldadd)
+TEST_PROGS += \
+ rgba \
+ encoding \
+ display \
+ keysyms \
+ $(NULL)
CLEANFILES = \
cairosurface.png \
gdksurface.png \
$(NULL)
-test_in_files = \
- rgba.test.in \
- encoding.test.in \
- display.test.in \
- keysyms.test.in \
- $(NULL)
-
-EXTRA_DIST += $(test_in_files)
-
if BUILDOPT_INSTALL_TESTS
insttestdir=$(pkglibexecdir)/installed-tests
insttest_PROGRAMS = $(TEST_PROGS)
-substitutions = \
- -e s,@pkglibexecdir\@,$(pkglibexecdir),g \
- $(NULL)
-
-test_files = $(test_in_files:.test.in=.test)
+%.test: %$(EXEEXT) Makefile
+ $(AM_V_GEN) (echo '[Test]' > $ tmp; \
+ echo 'Type=session' >> $ tmp; \
+ echo 'Exec=$(insttestdir)/$<' >> $ tmp; \
+ mv $ tmp $@)
-$(test_files): %.test: %.test.in
- $(AM_V_GEN) sed $(substitutions) $< > $ tmp && mv $ tmp $@
+test_files = $(TEST_PROGRS:=.test)
testmetadir = $(datadir)/installed-tests/$(PACKAGE)
testmeta_DATA = $(test_files)
diff --git a/testsuite/gtk/Makefile.am b/testsuite/gtk/Makefile.am
index 66a3537..ee0022a 100644
--- a/testsuite/gtk/Makefile.am
+++ b/testsuite/gtk/Makefile.am
@@ -18,223 +18,122 @@ endif
DEPS = \
$(top_builddir)/gtk/libgtk-3.la
-progs_ldadd = \
+LDADD = \
$(top_builddir)/gtk/libgtk-3.la \
$(top_builddir)/gdk/libgdk-3.la \
$(GTK_DEP_LIBS)
-test_in_files =
-
noinst_PROGRAMS = $(TEST_PROGS)
+TEST_PROGS += \
+ accel \
+ accessible \
+ action \
+ bitmask \
+ builder \
+ cellarea \
+ entry \
+ expander \
+ floating \
+ grid \
+ gtkmenu \
+ keyhash \
+ objects-finalize \
+ papersize \
+ rbtree \
+ recentmanager \
+ regression-tests \
+ stylecontext \
+ templates \
+ textbuffer \
+ textiter \
+ treemodel \
+ treepath \
+ treeview \
+ window \
+ $(NULL)
-#TEST_PROGS += testing
-#test_in_files += testing.test.in
-testing_SOURCES = testing.c
-testing_LDADD = $(progs_ldadd)
-
-TEST_PROGS += treemodel
-test_in_files += treemodel.test.in
-treemodel_SOURCES = \
- treemodel.h \
- treemodel.c \
- liststore.c \
- treestore.c \
- filtermodel.c \
- sortmodel.c \
- modelrefcount.c \
- gtktreemodelrefcount.h \
- gtktreemodelrefcount.c
-treemodel_LDADD = $(progs_ldadd)
-
-TEST_PROGS += treeview
-test_in_files += treeview.test.in
-treeview_SOURCES = treeview.c
-treeview_LDADD = $(progs_ldadd)
+if OS_UNIX
+#TEST_PROGS += defaultvalue
+endif
+#TEST_PROGS += testing
#TEST_PROGS += treeview-scrolling
-#test_in_files += treeview-scrolling.test.in
-treeview_scrolling_SOURCES = treeview-scrolling.c
-treeview_scrolling_LDADD = $(progs_ldadd) -lm
-
-TEST_PROGS += recentmanager
-test_in_files += recentmanager.test.in
-recentmanager_SOURCES = recentmanager.c
-recentmanager_LDADD = $(progs_ldadd)
-
-TEST_PROGS += floating
-test_in_files += floating.test.in
-floating_SOURCES = floating.c
-floating_LDADD = $(progs_ldadd)
-
-TEST_PROGS += accel
-test_in_files += accel.test.in
-accel_SOURCES = accel.c
-accel_LDADD = $(progs_ldadd)
-
#TEST_PROGS += object
-#test_in_files += object.test.in
-#object_SOURCES = object.c
-#object_LDADD = $(progs_ldadd)
+#TEST_PROGS += filechooser
# this doesn't work in make distcheck, since running
# on a naked X server creates slightly different event
# sequences than running on a normal desktop
# TEST_PROGS += crossingevents
-#test_in_files += crossingevents.test.in
-#crossingevents_SOURCES = crossingevents.c
-#crossingevents_LDADD = $(progs_ldadd)
-#TEST_PROGS += filechooser
-#test_in_files += filechooser.test.in
-filechooser_SOURCES = filechooser.c
-filechooser_LDADD = $(progs_ldadd)
+treemodel_SOURCES = \
+ treemodel.h \
+ treemodel.c \
+ liststore.c \
+ treestore.c \
+ filtermodel.c \
+ sortmodel.c \
+ modelrefcount.c \
+ gtktreemodelrefcount.h \
+ gtktreemodelrefcount.c \
+ $(NULL)
-TEST_PROGS += builder
-test_in_files += builder.test.in
-builder_SOURCES = builder.c
-builder_LDADD = $(progs_ldadd)
-builder_LDFLAGS = -export-dynamic
+builder_LDFLAGS = -export-dynamic
-TEST_PROGS += templates
-test_in_files += templates.test.in
-templates_SOURCES = templates.c
-templates_LDADD = $(progs_ldadd)
+rbtree_CFLAGS = -DGTK_COMPILATION -UG_ENABLE_DEBUG
+rbtree_LDADD = $(GTK_DEP_LIBS)
+rbtree_SOURCES = \
+ rbtree.c \
+ $(top_srcdir)/gtk/gtkrbtree.h \
+ $(top_srcdir)/gtk/gtkrbtree.c \
+ $(NULL)
+
+bitmask_CFLAGS = -DGTK_COMPILATION -UG_ENABLE_DEBUG
+bitmask_LDADD = $(GTK_DEP_LIBS)
+bitmask_SOURCES = \
+ bitmask.c \
+ $(top_srcdir)/gtk/gtkbitmaskprivate.h \
+ $(top_srcdir)/gtk/gtkallocatedbitmaskprivate.h \
+ $(top_srcdir)/gtk/gtkallocatedbitmask.c \
+ $(NULL)
+
+keyhash_CFLAGS = \
+ -DGTK_COMPILATION \
+ -DGTK_LIBDIR=\"$(libdir)\" \
+ -DGTK_DATADIR=\"$(datadir)\" \
+ -DGTK_DATA_PREFIX=\"$(prefix)\" \
+ -DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
+ $(NULL)
+
+keyhash_SOURCES = \
+ keyhash.c \
+ $(top_srcdir)/gtk/gtkkeyhash.c \
+ $(top_srcdir)/gtk/gtkkeyhash.h \
+ $(top_builddir)/gtk/gtkresources.c \
+ $(top_builddir)/gtk/gtkresources.h \
+ $(top_srcdir)/gtk/gtkprivate.c \
+ $(top_srcdir)/gtk/gtkprivate.h \
+ $(NULL)
-if OS_UNIX
-#TEST_PROGS += defaultvalue
-#test_in_files += defaultvalue.test.in
-#defaultvalue_SOURCES = defaultvalue.c
-#defaultvalue_LDADD = $(progs_ldadd)
-endif
-TEST_PROGS += textbuffer
-test_in_files += textbuffer.test.in
-textbuffer_SOURCES = textbuffer.c
-textbuffer_LDADD = $(progs_ldadd)
-
-TEST_PROGS += textiter
-test_in_files += textiter.test.in
-textiter_SOURCES = textiter.c
-textiter_LDADD = $(progs_ldadd)
-
-TEST_PROGS += expander
-test_in_files += expander.test.in
-expander_SOURCES = expander.c
-expander_LDADD = $(progs_ldadd)
-
-TEST_PROGS += action
-test_in_files += action.test.in
-action_SOURCES = action.c
-action_LDADD = $(progs_ldadd)
-
-TEST_PROGS += stylecontext
-test_in_files += stylecontext.test.in
-stylecontext_SOURCES = stylecontext.c
-stylecontext_LDADD = $(progs_ldadd)
-
-TEST_PROGS += papersize
-test_in_files += papersize.test.in
-papersize_SOURCES = papersize.c
-papersize_LDADD = $(progs_ldadd)
-
-TEST_PROGS += cellarea
-test_in_files += cellarea.test.in
-cellarea_SOURCES = cellarea.c
-cellarea_LDADD = $(progs_ldadd)
-
-TEST_PROGS += treepath
-test_in_files += treepath.test.in
-treepath_SOURCES = treepath.c
-treepath_LDADD = $(progs_ldadd)
-
-TEST_PROGS += accessible
-test_in_files += accessible.test.in
-accessible_SOURCES = accessible.c
-accessible_LDADD = $(progs_ldadd)
-
-TEST_PROGS += entry
-test_in_files += entry.test.in
-entry_SOURCES = entry.c
-entry_LDADD = $(progs_ldadd)
-
-TEST_PROGS += grid
-test_in_files += grid.test.in
-grid_SOURCES = grid.c
-grid_LDADD = $(progs_ldadd)
-
-TEST_PROGS += rbtree
-test_in_files += rbtree.test.in
-rbtree_CFLAGS = -DGTK_COMPILATION -UG_ENABLE_DEBUG
-rbtree_SOURCES = rbtree.c \
- $(top_srcdir)/gtk/gtkrbtree.h \
- $(top_srcdir)/gtk/gtkrbtree.c
-rbtree_LDADD = $(GTK_DEP_LIBS)
-
-TEST_PROGS += bitmask
-test_in_files += bitmask.test.in
-bitmask_CFLAGS = -DGTK_COMPILATION -UG_ENABLE_DEBUG
-bitmask_SOURCES = bitmask.c \
- $(top_srcdir)/gtk/gtkbitmaskprivate.h \
- $(top_srcdir)/gtk/gtkallocatedbitmaskprivate.h \
- $(top_srcdir)/gtk/gtkallocatedbitmask.c
-bitmask_LDADD = $(GTK_DEP_LIBS)
-
-TEST_PROGS += regression-tests
-test_in_files += regression-tests.test.in
-regression_tests_SOURCES = regression-tests.c
-regression_tests_LDADD = $(progs_ldadd)
-
-TEST_PROGS += keyhash
-test_in_files += keyhash.test.in
-keyhash_SOURCES = keyhash.c \
- $(top_srcdir)/gtk/gtkkeyhash.c \
- $(top_srcdir)/gtk/gtkkeyhash.h \
- $(top_builddir)/gtk/gtkresources.c \
- $(top_builddir)/gtk/gtkresources.h \
- $(top_srcdir)/gtk/gtkprivate.c \
- $(top_srcdir)/gtk/gtkprivate.h
-keyhash_LDADD = $(progs_ldadd)
-keyhash_CFLAGS = -DGTK_COMPILATION \
- -DGTK_LIBDIR=\"$(libdir)\" \
- -DGTK_DATADIR=\"$(datadir)\" \
- -DGTK_DATA_PREFIX=\"$(prefix)\" \
- -DGTK_SYSCONFDIR=\"$(sysconfdir)\"
-
-TEST_PROGS += gtkmenu
-test_in_files += gtkmenu.test.in
-gtkmenu_SOURCES = gtkmenu.c
-gtkmenu_LDADD = $(progs_ldadd)
-
-
-TEST_PROGS += objects-finalize
-test_in_files += objects-finalize.test.in
-objects_finalize_SOURCES = objects-finalize.c
-objects_finalize_LDADD = $(progs_ldadd)
-
-TEST_PROGS += window
-test_in_files += window.test.in
-window_SOURCES = window.c
-window_LDADD = $(progs_ldadd)
EXTRA_DIST += \
- $(test_in_files) \
file-chooser-test-dir/empty \
file-chooser-test-dir/text.txt \
$(NULL)
if BUILDOPT_INSTALL_TESTS
-insttestdir=$(pkglibexecdir)/installed-tests
+insttestdir = $(pkglibexecdir)/installed-tests
insttest_PROGRAMS = $(TEST_PROGS)
-substitutions = \
- -e s,@pkglibexecdir\@,$(pkglibexecdir),g \
- $(NULL)
-
-test_files = $(test_in_files:.test.in=.test)
+%.test: %$(EXEEXT) Makefile
+ $(AM_V_GEN) (echo '[Test]' > $ tmp; \
+ echo 'Type=session' >> $ tmp; \
+ echo 'Exec=$(insttestdir)/$<' >> $ tmp; \
+ mv $ tmp $@)
-$(test_files): %.test: %.test.in
- $(AM_V_GEN) sed $(substitutions) $< > $ tmp && mv $ tmp $@
+test_files = $(TEST_PROGS:=.test)
testmetadir = $(datadir)/installed-tests/$(PACKAGE)
testmeta_DATA = $(test_files)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]