Blame build-aux/glib-tap.mk

Packit Service ea0369
# GLIB - Library of useful C routines
Packit Service ea0369
Packit Service ea0369
TESTS_ENVIRONMENT= \
Packit Service ea0369
	G_TEST_SRCDIR="$(abs_srcdir)" 		\
Packit Service ea0369
	G_TEST_BUILDDIR="$(abs_builddir)" 	\
Packit Service ea0369
	G_DEBUG=gc-friendly 			\
Packit Service ea0369
	MALLOC_CHECK_=2 			\
Packit Service ea0369
	MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256))
Packit Service ea0369
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
Packit Service ea0369
LOG_COMPILER = $(top_srcdir)/tap-test
Packit Service ea0369
Packit Service ea0369
NULL =
Packit Service ea0369
Packit Service ea0369
# initialize variables for unconditional += appending
Packit Service ea0369
BUILT_SOURCES =
Packit Service ea0369
BUILT_EXTRA_DIST =
Packit Service ea0369
CLEANFILES = *.log *.trs
Packit Service ea0369
DISTCLEANFILES =
Packit Service ea0369
MAINTAINERCLEANFILES =
Packit Service ea0369
EXTRA_DIST =
Packit Service ea0369
TESTS =
Packit Service ea0369
Packit Service ea0369
installed_test_LTLIBRARIES =
Packit Service ea0369
installed_test_PROGRAMS =
Packit Service ea0369
installed_test_SCRIPTS =
Packit Service ea0369
nobase_installed_test_DATA =
Packit Service ea0369
Packit Service ea0369
noinst_LTLIBRARIES =
Packit Service ea0369
noinst_PROGRAMS =
Packit Service ea0369
noinst_SCRIPTS =
Packit Service ea0369
noinst_DATA =
Packit Service ea0369
Packit Service ea0369
check_LTLIBRARIES =
Packit Service ea0369
check_PROGRAMS =
Packit Service ea0369
check_SCRIPTS =
Packit Service ea0369
check_DATA =
Packit Service ea0369
Packit Service ea0369
# We support a fairly large range of possible variables.  It is expected that all types of files in a test suite
Packit Service ea0369
# will belong in exactly one of the following variables.
Packit Service ea0369
#
Packit Service ea0369
# First, we support the usual automake suffixes, but in lowercase, with the customary meaning:
Packit Service ea0369
#
Packit Service ea0369
#   test_programs, test_scripts, test_data, test_ltlibraries
Packit Service ea0369
#
Packit Service ea0369
# The above are used to list files that are involved in both uninstalled and installed testing.  The
Packit Service ea0369
# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite.
Packit Service ea0369
# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is
Packit Service ea0369
# installed in the same way as it appears in the package layout.
Packit Service ea0369
#
Packit Service ea0369
# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled',
Packit Service ea0369
# like so:
Packit Service ea0369
#
Packit Service ea0369
#   installed_test_programs, uninstalled_test_programs
Packit Service ea0369
#   installed_test_scripts, uninstalled_test_scripts
Packit Service ea0369
#   installed_test_data, uninstalled_test_data
Packit Service ea0369
#   installed_test_ltlibraries, uninstalled_test_ltlibraries
Packit Service ea0369
#
Packit Service ea0369
# Additionally, we support 'extra' infixes for programs and scripts.  This is used for support programs/scripts
Packit Service ea0369
# that should not themselves be run as testcases (but exist to be used from other testcases):
Packit Service ea0369
#
Packit Service ea0369
#   test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs
Packit Service ea0369
#   test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts
Packit Service ea0369
#
Packit Service ea0369
# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data
Packit Service ea0369
# file automatically end up in the tarball.
Packit Service ea0369
#
Packit Service ea0369
#   dist_test_scripts, dist_test_data, dist_test_extra_scripts
Packit Service ea0369
#   dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts
Packit Service ea0369
#   dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts
Packit Service ea0369
#
Packit Service ea0369
# Note that no file is automatically disted unless it appears in one of the dist_ variables.  This follows the
Packit Service ea0369
# standard automake convention of not disting programs scripts or data by default.
Packit Service ea0369
#
Packit Service ea0369
# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their disted
Packit Service ea0369
# variants) will be run as part of the in-tree 'make check'.  These are all assumed to be runnable under
Packit Service ea0369
# gtester.  That's a bit strange for scripts, but it's possible.
Packit Service ea0369
Packit Service ea0369
TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
Packit Service ea0369
         $(dist_test_scripts) $(dist_uninstalled_test_scripts)
Packit Service ea0369
Packit Service ea0369
# Note: build even the installed-only targets during 'make check' to ensure that they still work.
Packit Service ea0369
# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to
Packit Service ea0369
# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were
Packit Service ea0369
# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'.
Packit Service ea0369
all_test_programs     = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \
Packit Service ea0369
                        $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs)
Packit Service ea0369
all_test_scripts      = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \
Packit Service ea0369
                        $(test_extra_scripts) $(uninstalled_test_extra_scripts) $(installed_test_extra_scripts)
Packit Service ea0369
all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \
Packit Service ea0369
                        $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts)
Packit Service ea0369
all_test_scripts     += $(all_dist_test_scripts)
Packit Service ea0369
EXTRA_DIST           += $(all_dist_test_scripts)
Packit Service ea0369
all_test_data         = $(test_data) $(uninstalled_test_data) $(installed_test_data)
Packit Service ea0369
all_dist_test_data    = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data)
Packit Service ea0369
all_test_data        += $(all_dist_test_data)
Packit Service ea0369
EXTRA_DIST           += $(all_dist_test_data)
Packit Service ea0369
all_test_ltlibs       = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries)
Packit Service ea0369
Packit Service ea0369
if ENABLE_ALWAYS_BUILD_TESTS
Packit Service ea0369
noinst_LTLIBRARIES += $(all_test_ltlibs)
Packit Service ea0369
noinst_PROGRAMS += $(all_test_programs)
Packit Service ea0369
noinst_SCRIPTS += $(all_test_scripts)
Packit Service ea0369
noinst_DATA += $(all_test_data)
Packit Service ea0369
else
Packit Service ea0369
check_LTLIBRARIES += $(all_test_ltlibs)
Packit Service ea0369
check_PROGRAMS += $(all_test_programs)
Packit Service ea0369
check_SCRIPTS += $(all_test_scripts)
Packit Service ea0369
check_DATA += $(all_test_data)
Packit Service ea0369
endif
Packit Service ea0369
Packit Service ea0369
if ENABLE_INSTALLED_TESTS
Packit Service ea0369
installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \
Packit Service ea0369
                          $(test_extra_programs) $(installed_test_extra_programs)
Packit Service ea0369
installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \
Packit Service ea0369
                          $(test_extra_scripts) $(test_installed_extra_scripts)
Packit Service ea0369
installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \
Packit Service ea0369
                          $(dist_installed_test_scripts) $(dist_installed_test_extra_scripts)
Packit Service ea0369
nobase_installed_test_DATA += $(test_data) $(installed_test_data)
Packit Service ea0369
nobase_installed_test_DATA += $(dist_test_data) $(dist_installed_test_data)
Packit Service ea0369
installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries)
Packit Service ea0369
installed_testcases = $(test_programs) $(installed_test_programs) \
Packit Service ea0369
                      $(test_scripts) $(installed_test_scripts) \
Packit Service ea0369
                      $(dist_test_scripts) $(dist_installed_test_scripts)
Packit Service ea0369
Packit Service ea0369
installed_test_meta_DATA = $(installed_testcases:=.test)
Packit Service ea0369
Packit Service ea0369
%.test: %$(EXEEXT) Makefile
Packit Service ea0369
	$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
Packit Service ea0369
	echo 'Type=session' >> $@.tmp; \
Packit Service ea0369
	echo 'Exec=$(installed_testdir)/$(notdir $<) --tap' >> $@.tmp; \
Packit Service ea0369
	echo 'Output=TAP' >> $@.tmp; \
Packit Service ea0369
	mv $@.tmp $@)
Packit Service ea0369
Packit Service ea0369
CLEANFILES += $(installed_test_meta_DATA)
Packit Service ea0369
endif