Blame glib.mk

Packit Service d3d246
# GLIB - Library of useful C routines
Packit Service d3d246
Packit Service d3d246
#GTESTER = gtester 			# for non-GLIB packages
Packit Service d3d246
#GTESTER_REPORT = gtester-report        # for non-GLIB packages
Packit Service d3d246
GTESTER = $(top_builddir)/glib/gtester			# for the GLIB package
Packit Service d3d246
GTESTER_REPORT = $(top_builddir)/glib/gtester-report	# for the GLIB package
Packit Service d3d246
NULL =
Packit Service d3d246
Packit Service d3d246
# initialize variables for unconditional += appending
Packit Service d3d246
BUILT_SOURCES =
Packit Service d3d246
BUILT_EXTRA_DIST =
Packit Service d3d246
CLEANFILES = *.log *.trs
Packit Service d3d246
DISTCLEANFILES =
Packit Service d3d246
MAINTAINERCLEANFILES =
Packit Service d3d246
EXTRA_DIST =
Packit Service d3d246
TEST_PROGS =
Packit Service d3d246
Packit Service d3d246
installed_test_LTLIBRARIES =
Packit Service d3d246
installed_test_PROGRAMS =
Packit Service d3d246
installed_test_SCRIPTS =
Packit Service d3d246
nobase_installed_test_DATA =
Packit Service d3d246
Packit Service d3d246
noinst_LTLIBRARIES =
Packit Service d3d246
noinst_PROGRAMS =
Packit Service d3d246
noinst_SCRIPTS =
Packit Service d3d246
noinst_DATA =
Packit Service d3d246
Packit Service d3d246
check_LTLIBRARIES =
Packit Service d3d246
check_PROGRAMS =
Packit Service d3d246
check_SCRIPTS =
Packit Service d3d246
check_DATA =
Packit Service d3d246
Packit Service d3d246
TESTS =
Packit Service d3d246
Packit Service d3d246
# test-nonrecursive: run tests only in cwd
Packit Service d3d246
if OS_UNIX
Packit Service d3d246
test-nonrecursive: ${TEST_PROGS}
Packit Service d3d246
	@test -z "${TEST_PROGS}" || G_TEST_SRCDIR="$(abs_srcdir)" G_TEST_BUILDDIR="$(abs_builddir)" G_DEBUG=gc-friendly MALLOC_CHECK_=2 MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) ${GTESTER} --verbose ${TEST_PROGS}
Packit Service d3d246
else
Packit Service d3d246
test-nonrecursive:
Packit Service d3d246
endif
Packit Service d3d246
Packit Service d3d246
.PHONY: test-nonrecursive
Packit Service d3d246
Packit Service d3d246
.PHONY: lcov genlcov lcov-clean
Packit Service d3d246
# use recursive makes in order to ignore errors during check
Packit Service d3d246
lcov:
Packit Service d3d246
	-$(MAKE) $(AM_MAKEFLAGS) -k check
Packit Service d3d246
	$(MAKE) $(AM_MAKEFLAGS) genlcov
Packit Service d3d246
Packit Service d3d246
# we have to massage the lcov.info file slightly to hide the effect of libtool
Packit Service d3d246
# placing the objects files in the .libs/ directory separate from the *.c
Packit Service d3d246
# we also have to delete tests/.libs/libmoduletestplugin_*.gcda
Packit Service d3d246
genlcov:
Packit Service d3d246
	$(AM_V_GEN) rm -f $(top_builddir)/tests/.libs/libmoduletestplugin_*.gcda; \
Packit Service d3d246
	  $(LTP) --quiet --directory $(top_builddir) --capture --output-file glib-lcov.info --test-name GLIB_PERF --no-checksum --compat-libtool --ignore-errors source; \
Packit Service d3d246
	  $(LTP) --quiet --output-file glib-lcov.info --remove glib-lcov.info docs/reference/\* /tmp/\*  gio/tests/gdbus-object-manager-example/\* ; \
Packit Service d3d246
	  LANG=C $(LTP_GENHTML) --quiet --prefix $(top_builddir) --output-directory glib-lcov --title "GLib Code Coverage" --legend --frames --show-details glib-lcov.info --ignore-errors source
Packit Service d3d246
	@echo "file://$(abs_top_builddir)/glib-lcov/index.html"
Packit Service d3d246
Packit Service d3d246
lcov-clean:
Packit Service d3d246
	if test -n "$(LTP)"; then \
Packit Service d3d246
	  $(LTP) --quiet --directory $(top_builddir) -z; \
Packit Service d3d246
	fi
Packit Service d3d246
Packit Service d3d246
# run tests in cwd as part of make check
Packit Service d3d246
check-local: test-nonrecursive
Packit Service d3d246
Packit Service d3d246
# We support a fairly large range of possible variables.  It is expected that all types of files in a test suite
Packit Service d3d246
# will belong in exactly one of the following variables.
Packit Service d3d246
#
Packit Service d3d246
# First, we support the usual automake suffixes, but in lowercase, with the customary meaning:
Packit Service d3d246
#
Packit Service d3d246
#   test_programs, test_scripts, test_data, test_ltlibraries
Packit Service d3d246
#
Packit Service d3d246
# The above are used to list files that are involved in both uninstalled and installed testing.  The
Packit Service d3d246
# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite.
Packit Service d3d246
# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is
Packit Service d3d246
# installed in the same way as it appears in the package layout.
Packit Service d3d246
#
Packit Service d3d246
# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled',
Packit Service d3d246
# like so:
Packit Service d3d246
#
Packit Service d3d246
#   installed_test_programs, uninstalled_test_programs
Packit Service d3d246
#   installed_test_scripts, uninstalled_test_scripts
Packit Service d3d246
#   installed_test_data, uninstalled_test_data
Packit Service d3d246
#   installed_test_ltlibraries, uninstalled_test_ltlibraries
Packit Service d3d246
#
Packit Service d3d246
# Additionally, we support 'extra' infixes for programs and scripts.  This is used for support programs/scripts
Packit Service d3d246
# that should not themselves be run as testcases (but exist to be used from other testcases):
Packit Service d3d246
#
Packit Service d3d246
#   test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs
Packit Service d3d246
#   test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts
Packit Service d3d246
#
Packit Service d3d246
# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data
Packit Service d3d246
# file automatically end up in the tarball.
Packit Service d3d246
#
Packit Service d3d246
#   dist_test_scripts, dist_test_data, dist_test_extra_scripts
Packit Service d3d246
#   dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts
Packit Service d3d246
#   dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts
Packit Service d3d246
#
Packit Service d3d246
# Note that no file is automatically disted unless it appears in one of the dist_ variables.  This follows the
Packit Service d3d246
# standard automake convention of not disting programs scripts or data by default.
Packit Service d3d246
#
Packit Service d3d246
# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their disted
Packit Service d3d246
# variants) will be run as part of the in-tree 'make check'.  These are all assumed to be runnable under
Packit Service d3d246
# gtester.  That's a bit strange for scripts, but it's possible.
Packit Service d3d246
Packit Service d3d246
# we use test -z "$(TEST_PROGS)" above, so make sure we have no extra whitespace...
Packit Service d3d246
TEST_PROGS += $(strip $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
Packit Service d3d246
                      $(dist_test_scripts) $(dist_uninstalled_test_scripts))
Packit Service d3d246
Packit Service d3d246
if OS_WIN32
Packit Service d3d246
TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \
Packit Service d3d246
         $(dist_test_scripts) $(dist_uninstalled_test_scripts)
Packit Service d3d246
endif
Packit Service d3d246
Packit Service d3d246
# Note: build even the installed-only targets during 'make check' to ensure that they still work.
Packit Service d3d246
# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to
Packit Service d3d246
# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were
Packit Service d3d246
# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'.
Packit Service d3d246
all_test_programs     = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \
Packit Service d3d246
                        $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs)
Packit Service d3d246
all_test_scripts      = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \
Packit Service d3d246
                        $(test_extra_scripts) $(uninstalled_test_extra_scripts) $(installed_test_extra_scripts)
Packit Service d3d246
all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \
Packit Service d3d246
                        $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts)
Packit Service d3d246
all_test_scripts     += $(all_dist_test_scripts)
Packit Service d3d246
EXTRA_DIST           += $(all_dist_test_scripts)
Packit Service d3d246
all_test_data         = $(test_data) $(uninstalled_test_data) $(installed_test_data)
Packit Service d3d246
all_dist_test_data    = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data)
Packit Service d3d246
all_test_data        += $(all_dist_test_data)
Packit Service d3d246
EXTRA_DIST           += $(all_dist_test_data)
Packit Service d3d246
all_test_ltlibs       = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries)
Packit Service d3d246
Packit Service d3d246
if ENABLE_ALWAYS_BUILD_TESTS
Packit Service d3d246
noinst_LTLIBRARIES += $(all_test_ltlibs)
Packit Service d3d246
noinst_PROGRAMS += $(all_test_programs)
Packit Service d3d246
noinst_SCRIPTS += $(all_test_scripts)
Packit Service d3d246
noinst_DATA += $(all_test_data)
Packit Service d3d246
else
Packit Service d3d246
check_LTLIBRARIES += $(all_test_ltlibs)
Packit Service d3d246
check_PROGRAMS += $(all_test_programs)
Packit Service d3d246
check_SCRIPTS += $(all_test_scripts)
Packit Service d3d246
check_DATA += $(all_test_data)
Packit Service d3d246
endif
Packit Service d3d246
Packit Service d3d246
if ENABLE_INSTALLED_TESTS
Packit Service d3d246
installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \
Packit Service d3d246
                          $(test_extra_programs) $(installed_test_extra_programs)
Packit Service d3d246
installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \
Packit Service d3d246
                          $(test_extra_scripts) $(test_installed_extra_scripts)
Packit Service d3d246
installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \
Packit Service d3d246
                          $(dist_installed_test_scripts) $(dist_installed_test_extra_scripts)
Packit Service d3d246
nobase_installed_test_DATA += $(test_data) $(installed_test_data)
Packit Service d3d246
nobase_installed_test_DATA += $(dist_test_data) $(dist_installed_test_data)
Packit Service d3d246
installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries)
Packit Service d3d246
installed_testcases = $(test_programs) $(installed_test_programs) \
Packit Service d3d246
                      $(test_scripts) $(installed_test_scripts) \
Packit Service d3d246
                      $(dist_test_scripts) $(dist_installed_test_scripts)
Packit Service d3d246
Packit Service d3d246
installed_test_meta_DATA = $(installed_testcases:=.test)
Packit Service d3d246
Packit Service d3d246
%.test: %$(EXEEXT) Makefile
Packit Service d3d246
	$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
Packit Service d3d246
	echo 'Type=session' >> $@.tmp; \
Packit Service d3d246
	echo 'Exec=$(installed_testdir)/$(notdir $<)' >> $@.tmp; \
Packit Service d3d246
	mv $@.tmp $@)
Packit Service d3d246
Packit Service d3d246
CLEANFILES += $(installed_test_meta_DATA)
Packit Service d3d246
endif