From 1191262f5ebb881f9a07862f0b7b9176c502edc1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 16 Nov 2018 18:53:11 +0000 Subject: Translate Python-based tests to C This simplifies bootstrapping: now you don't have to build dbus, build dbus-python (with GLib), and use dbus-python to test dbus. It also avoids test failures when using facilities like AddressSanitizer. When libdbus is built with AddressSanitizer, but the system copies of Python and dbus-python were not, dbus-python will exit the Python interpreter on load, because libasan wasn't already initialized. The simplest way to avoid this is to not use Python: the scripts are not *that* hard to translate into C. Both of these tests happen to be conditionally compiled for Unix only. test_activation_forking() relies on code in TestSuiteForkingEchoService that calls fork(), which can only work on Unix; meanwhile, test_system_signals() tests the system bus configuration, which is only relevant to Unix because we don't support using dbus-daemon as a privilege boundary on Windows (and in any case D-Bus is not a Windows OS feature, so the system bus cannot be used to communicate with OS services like it can on most Linux systems). This is also a partial solution to , by reducing the size of name-test/. For this to work, we need to build the test-service helper executable even if embedded tests are disabled. Signed-off-by: Simon McVittie --- configure.ac | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 64a655b1..4b6cba6e 100644 --- a/configure.ac +++ b/configure.ac @@ -247,7 +247,7 @@ AC_ARG_ENABLE([tests], [ if test "x$enableval" = xyes; then AC_MSG_NOTICE([Full test coverage was requested with --enable-tests=yes]) - AC_MSG_NOTICE([This has many dependencies (GLib, Python etc.)]) + AC_MSG_NOTICE([This requires GLib]) fi enable_embedded_tests=$enableval enable_modular_tests=$enableval @@ -313,22 +313,6 @@ AC_ARG_ENABLE([installed-tests], AM_CONDITIONAL([DBUS_ENABLE_INSTALLED_TESTS], [test "x$enable_installed_tests" = xyes]) -if test "x$enable_tests" = xyes; then - # full test coverage is required, Python is a hard dependency - AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygi]) - AM_PATH_PYTHON([2.6]) - AC_MSG_CHECKING([for Python modules for full test coverage]) - if "$PYTHON" -c "import dbus, gi.repository.GObject, dbus.mainloop.glib"; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - AC_MSG_ERROR([cannot import dbus, gi.repository.GObject, dbus.mainloop.glib Python modules]) - fi -else - # --enable-tests not given: do not abort if Python is missing - AM_PATH_PYTHON([2.6], [], [:]) -fi - if test x$enable_verbose_mode = xyes; then AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode]) fi -- cgit v1.2.1