some tests in test/name-test/ fail under cmake `make test`
Submitted by Simon McVittie
Assigned to D-Bus Maintainers
While testing Bug #41222 I found that several tests in test/name-test/ failed under cmake. However, this wasn't a regression: they'd fail in dbus-1.4 too.
The reason is that those tests expect to be run under a dbus-daemon that has test/data/valid-service-files/ in its search path. The Automake build system achieves this by running them via run-test.sh and run-test-systemserver.sh, which in turn use run-with-tmp-session-bus.sh. That's needlessly complicated, but sort of works in an Automake environment, where you can guarantee to have a POSIX shell.
For these tests to work without a POSIX shell, I think the best solution is to have them implement an equivalent of tools/run-with-tmp-session-bus.sh internally, using a config file passed in via the environment (TESTS_ENVIRONMENT for the entire Makefile.am in Automake; the ENVIRONMENT property on each test in CMake). The "modular tests" tests that I've been adding recently use GLib to do that; we could either extend the optional GLib dependency so it's required for all tests, or use dbus-spawn to get similar functionality.
On Unix, this would be an ideal place to combine Bug #35230 with a "dbus-daemon --inetd" sort of thing, but I don't think having a child process inherit a socket from its parent is portable to Windows, sadly...