summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2015-05-06 00:22:47 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2015-05-06 00:49:44 +0100
commit802fad787566223913bd03e39c60b7b6c1baa9f7 (patch)
treec0cd690eac10cbcf57315dd51fe88400642366ec /configure.ac
parent10f67845a07c75bf92f1128d949edae75d645ec7 (diff)
downloadlibgdata-802fad787566223913bd03e39c60b7b6c1baa9f7.tar.gz
tests: Port to use installed-tests
Port the unit tests to follow the installed-tests standard, installing the test binaries and generated .test metadata files. This removes the existing --enable-tests configure option, replacing it with the standard: • --enable-always-build-tests • --enable-installed-tests options. --enable-always-build-tests is a direct replacement for --enable-tests, controlling whether tests are built at compile time, or only when run under `make check`. --enable-installed-tests controls whether tests will be installed on the system. If the tests are installed, use gnome-desktop-testing-runner libgdata to run them all. https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac29
1 files changed, 21 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 27079913..8a7f355a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,14 +149,27 @@ AC_SUBST([GNOME_PACKAGES_PRIVATE])
AC_SUBST([GNOME_PACKAGES])
AC_SUBST([GOA_ENABLED])
-AC_MSG_CHECKING([whether to build tests])
-AC_ARG_ENABLE([tests], AS_HELP_STRING([--enable-tests], [Enable building of tests]),, [enable_tests=yes])
-AC_MSG_RESULT($enable_tests)
-AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
-
-if test "x$enable_tests" = "xyes"; then
- PKG_CHECK_MODULES(UHTTPMOCK, libuhttpmock-0.0)
-fi
+AC_ARG_ENABLE([always_build_tests],
+ AS_HELP_STRING([--enable-always-build-tests],
+ [Enable always building tests (default: yes)]),,
+ [enable_always_build_tests=yes])
+AC_ARG_ENABLE([installed_tests],
+ AS_HELP_STRING([--enable-installed-tests],
+ [Install test programs (default: no)]),,
+ [enable_installed_tests=no])
+
+AM_CONDITIONAL([ENABLE_ALWAYS_BUILD_TESTS],
+ [test "$enable_always_build_tests" = "yes"])
+AC_SUBST([ENABLE_ALWAYS_BUILD_TESTS],[$enable_always_build_tests])
+
+AM_CONDITIONAL([ENABLE_INSTALLED_TESTS],
+ [test "$enable_installed_tests" = "yes"])
+AC_SUBST([ENABLE_INSTALLED_TESTS],[$enable_installed_tests])
+
+AS_IF([test "$enable_always_build_tests" = "yes" ||
+ test "$enable_installed_tests" = "yes"],[
+ PKG_CHECK_MODULES([UHTTPMOCK],[libuhttpmock-0.0])
+])
# Various necessary functions and headers
AC_CHECK_FUNCS([memset])