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.
This commit is contained in:
Matthias Clasen 2013-06-15 14:23:22 -04:00
parent 3e70c283e2
commit e4af0e9bed
37 changed files with 101 additions and 328 deletions

View File

@ -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: %$(EXEEXT) Makefile
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
echo 'Type=session' >> $@.tmp; \
echo 'Exec=$(insttestdir)/$<' >> $@.tmp; \
mv $@.tmp $@)
test_files = $(test_in_files:.test.in=.test)
$(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)

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/display"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/encoding"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/keysyms"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/rgba"
Type=session

View File

@ -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)
if OS_UNIX
#TEST_PROGS += defaultvalue
endif
#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)
#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)
if OS_UNIX
#TEST_PROGS += defaultvalue
#test_in_files += defaultvalue.test.in
#defaultvalue_SOURCES = defaultvalue.c
#defaultvalue_LDADD = $(progs_ldadd)
endif
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)
TEST_PROGS += textbuffer
test_in_files += textbuffer.test.in
textbuffer_SOURCES = textbuffer.c
textbuffer_LDADD = $(progs_ldadd)
keyhash_CFLAGS = \
-DGTK_COMPILATION \
-DGTK_LIBDIR=\"$(libdir)\" \
-DGTK_DATADIR=\"$(datadir)\" \
-DGTK_DATA_PREFIX=\"$(prefix)\" \
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
$(NULL)
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)
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)
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: %$(EXEEXT) Makefile
$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
echo 'Type=session' >> $@.tmp; \
echo 'Exec=$(insttestdir)/$<' >> $@.tmp; \
mv $@.tmp $@)
test_files = $(test_in_files:.test.in=.test)
$(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)

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/accel"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/accessible"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/action"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/bitmask"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/builder"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/cellarea"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/crossingevents"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/defaultvalue"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/entry"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/expander"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/filechooser"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/floating"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/grid"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/gtkmenu"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/keyhash"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/object"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/objects-finalize"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/papersize"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/rbtree"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/recentmanager"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/regression-tests"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/stylecontext"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/templates"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/testing"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/textbuffer"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/textiter"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/treemodel"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/treepath"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/treeview-scrolling"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/treeview"
Type=session

View File

@ -1,3 +0,0 @@
[Test]
Exec=/bin/sh -c "@pkglibexecdir@/installed-tests/window"
Type=session