summaryrefslogtreecommitdiff
path: root/m4macros
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-05-30 00:07:32 -0400
committerRyan Lortie <desrt@desrt.ca>2013-05-31 23:12:15 -0400
commitf9eb9eed10b7123ef000e49be1290755b2d6ae8f (patch)
treedffb3fdb91e25915ca5f67d9af508b541b1d720c /m4macros
parent210b1f8b4230b881d1c2e4a9e7dac571c967e091 (diff)
downloadglib-f9eb9eed10b7123ef000e49be1290755b2d6ae8f.tar.gz
Rework the build system for a new tests approach
Perform a substantial cleanup of the build system with respect to building and installing testcases. First, Makefile.decl has been renamed glib.mk and substantially expanded. We intend to add more stuff here in the future, like canned rules for mkenums, marshallers, resources, etc. By default, tests are no longer compiled as part of 'make'. They will be built when 'make check' is run. The old behaviour can be obtained with --enable-always-build-tests. --disable-modular-tests is gone (because tests are no longer built by default). There is no longer any way to cause 'make check' to be a no-op, but that's not very useful anyway. A new glibtests.m4 file is introduced. Along with glib.mk, this provides for consistent handling of --enable-installed-tests and --enable-always-build-tests (mentioned above). Port our various test-installing Makefiles to the new framework. This patch substantially improves the situation in the toplevel tests/ directory. Things are now somewhat under control there. There were some tests being built that weren't even being run and we run those now. The long-running GObject performance tests in this directory have been removed from 'make check' because they take too long. As an experiment, 'make check' now runs the testcases on win32 builds, by default. We can't run them under gtester (since it uses a pipe to communicate with the subprocess) so just toss them in TESTS. Most of them are passing on win32. Things are not quite done here, but this patch is already a substantial improvement. More to come.
Diffstat (limited to 'm4macros')
-rw-r--r--m4macros/Makefile.am2
-rw-r--r--m4macros/glibtests.m428
2 files changed, 29 insertions, 1 deletions
diff --git a/m4macros/Makefile.am b/m4macros/Makefile.am
index 75a9ca05a..971871ce7 100644
--- a/m4macros/Makefile.am
+++ b/m4macros/Makefile.am
@@ -1,4 +1,4 @@
-include $(top_srcdir)/Makefile.decl
+include $(top_srcdir)/glib.mk
installed_m4= glib-2.0.m4 glib-gettext.m4 gsettings.m4
diff --git a/m4macros/glibtests.m4 b/m4macros/glibtests.m4
new file mode 100644
index 000000000..27e902466
--- /dev/null
+++ b/m4macros/glibtests.m4
@@ -0,0 +1,28 @@
+dnl GLIB_TESTS
+dnl
+
+AC_DEFUN([GLIB_TESTS],
+[
+ AC_ARG_ENABLE(installed-tests,
+ AS_HELP_STRING([--enable-installed-tests],
+ [Enable installation of some test cases]),
+ [case ${enableval} in
+ yes) ENABLE_INSTALLED_TESTS="1" ;;
+ no) ENABLE_INSTALLED_TESTS="" ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-installed-tests]) ;;
+ esac])
+ AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], test "$ENABLE_INSTALLED_TESTS" = "1")
+ AC_ARG_ENABLE(always-build-tests,
+ AS_HELP_STRING([--enable-always-build-tests],
+ [Enable always building tests during 'make all']),
+ [case ${enableval} in
+ yes) ENABLE_ALWAYS_BUILD_TESTS="1" ;;
+ no) ENABLE_ALWAYS_BUILD_TESTS="" ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-always-build-tests]) ;;
+ esac])
+ AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS], test "$ENABLE_ALWAYS_BUILD_TESTS" = "1")
+ if test "$ENABLE_INSTALLED_TESTS" == "1"; then
+ AC_SUBST(installed_test_metadir, [${datadir}/installed-tests/]AC_PACKAGE_NAME)
+ AC_SUBST(installed_testdir, [${libexecdir}/installed-tests/]AC_PACKAGE_NAME)
+ fi
+])