This means we can share them between tests without having to compile
the same file repeatedly, and makes them easier to share between
directories when we move test executables into test/.
Signed-off-by: Simon McVittie <smcv@collabora.com>
As far as I can tell, the only significant contributions have been
from Red Hat and Collabora, both of which have given permission to
relicense their parts of the dbus codebase to MIT/X11; so let's go
with that.
I'm assuming here that tree-wide changes from
_DBUS_GNUC_WARN_UNUSED_RESULT to _DBUS_WARN_UNUSED_RESULT, and tree-wide
changes to how we include config.h, are not significant for copyright
purposes.
Signed-off-by: Simon McVittie <smcv@collabora.com>
The ctest application is usually not installed in the dbus build
directory. If an older dbus library is contained in this path, it will
be used instead of the currently built one, which can lead to runtime
errors (e.g.: c0000139) if the internal dbus API differs.
Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files
See merge request dbus/dbus!81
Reviewed-by: Simon McVittie
Now that we start the spawned program from the main thread, there
is no need to wait for it before dereferencing `sitter->child_handle`.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Since the child program is started in the main thread, there is no
need to pass a copy of argv to the thread waiting for the child's
termination.
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
It's unexpected for a function to take ownership of its arguments
without indicating that in its name, or at least documenting it.
The only caller with envp != NULL is in
bus_activation_activate_service(), which has been updated.
Based on part of a larger commit by Ralf Habacker.
Signed-off-by: Simon McVittie <smcv@collabora.com>
We would like to stop taking ownership of envp, but we can't do that
without a deep copy if a different thread might still be using it
(asynchronously) after the main thread has returned from
_dbus_spawn_async_with_babysitter().
Originally part of a larger commit by Ralf Habacker.
Signed-off-by: Simon McVittie <smcv@collabora.com>
While writing the wording to deprecate XML policy installed by packages
into ${sysconfdir}, I realised we didn't give a typical example of
what packages *should* do.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Now that dbus 1.10 has become widely available, we should start to
treat ${sysconfdir} as reserved for the sysadmin, and encourage
third-party software packages to install their integration files into
${datadir}.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Multi-configuration generators (VS, Xcode) append a per-configuration
subdirectory to the specified CMAKE_xxx_OUTPUT_DIRECTORY} directory.
To use the real output paths in test applications, this subdirectory
must be added to the corresponding cmake variables.
This patch introduces a new cmake macro add_session_test_executable,
which uses dbus-run-session to start a dbus-daemon process with a
temporary session bus in the background and the desired client file.
add_session_test_executable requires additional environment variables
defined in the top level CMakeLists.txt.
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
This patch introduces a new cmake macro add_session_test_executable,
which uses dbus-run-session to start a dbus-daemon process with a
temporary session bus in the background and the desired client file.
add_session_test_executable requires additional environment variables
defined in the top level CMakeLists.txt.
Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
Instead of the variables EXECUTABLE_OUTPUT_PATH and
LIBRARY_OUTPUT_PATH, which have become obsolete since
cmake 3.x, CMAKE_xxx_OUTPUT_PATH is now used to define
output paths in the build directory.
It is not safe to assume that the result of getenv() is not invalidated
by a subsequent call to setenv(), and dbus#240 demonstrates that this
can be a problem in practice when running Windows code under Wine.
Closes: https://gitlab.freedesktop.org/dbus/dbus/issues/240
Signed-off-by: Simon McVittie <smcv@collabora.com>
This all seems to have been written by Red Hat or by Collabora, so we
have permission to relicense it under the MIT/X11 license, and we
might as well do so.
Signed-off-by: Simon McVittie <smcv@collabora.com>
This results in one less special case in test-main, which will be
significant when we want to make the tests more data-driven.
Signed-off-by: Simon McVittie <smcv@collabora.com>
This will make it possible to unify the wrapper code that runs them.
I'm using a plain C string rather than a DBusString to make it
more straightforward to carve out tests into their own executables.
Signed-off-by: Simon McVittie <smcv@collabora.com>
We don't usually mass-remove trailing whitespace from the actual source
code because it would complicate cherry-picking bug fixes to older
branches, but that reasoning doesn't really apply to the comments
containing copyright and licensing notices.
Removing trailing whitespace makes it much easier to move code around:
we have a commit hook that rejects commits containing trailing
whitespace, but that commit hook counts moving a file as a delete + add
pair, so it objects to moving code that contains trailing whitespace.
Signed-off-by: Simon McVittie <smcv@collabora.com>
libdbus has been thread-safe by default since 1.7.6 (2013):
dbus_threads_init_default() is called on a just-in-time basis
whenever needed, and _dbus_thread_init_debug() is equivalent to that.
Signed-off-by: Simon McVittie <smcv@collabora.com>
If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Patterns in the top-level .gitignore match in all subdirectories, so
there's no need to repeat ourselves quite so much for generic
C, Autotools and gcov patterns.
Signed-off-by: Simon McVittie <smcv@collabora.com>
If lists are in a completely arbitrary order, sorting them consistently
means that there is only one correct place to insert a new entry, avoiding
the merge conflicts that would occur if we always append new entries.
Signed-off-by: Simon McVittie <smcv@collabora.com>
The anchored patterns match only in the top directory; the unanchored
patterns match in any subdirectory. While I'm moving the unanchored
patterns around anyway, sort them in lexicographical (LC_ALL=C sort)
order.
Signed-off-by: Simon McVittie <smcv@collabora.com>
There shouldn't be an aclocal.m4 in any subdirectory, for instance,
so there's no need to ignore it.
Signed-off-by: Simon McVittie <smcv@collabora.com>