]> git.ipfire.org Git - thirdparty/dbus.git/log
thirdparty/dbus.git
6 years agoAdd script for formatting cmake files
Ralf Habacker [Thu, 10 Jan 2019 09:11:46 +0000 (10:11 +0100)] 
Add script for formatting cmake files

The prefered call order is

  tools/cmake-format --trailing-spaces
  # create git commit
  tools/cmake-format --tabs
  # create git commit
  tools/cmake-format --keyword-case
  # create git commit
  tools/cmake-format --keyword-spaces
  # create git commit
  tools/cmake-format --end-args
  # create git commit
  tools/cmake-format --indents
  # create git commit

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoMerge branch 'move-cmake-toplevel' into 'master'
Ralf Habacker [Wed, 23 Jan 2019 19:50:57 +0000 (19:50 +0000)] 
Merge branch 'move-cmake-toplevel' into 'master'

Move cmake related build system to top level

See merge request dbus/dbus!84

Reviewed-by: @smcv
6 years agocmake: Set working directory to be a native path
Simon McVittie [Mon, 21 Jan 2019 20:25:09 +0000 (20:25 +0000)] 
cmake: Set working directory to be a native path

If we're cross-compiling for Windows on Unix, CTest needs to chdir() to
the native Unix path.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoAdd cmake macros add_executable_version_info and add_library_version_info
Ralf Habacker [Tue, 15 Jan 2019 13:41:14 +0000 (14:41 +0100)] 
Add cmake macros add_executable_version_info and add_library_version_info

This helps to reduce duplicated code.

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoRemove duplicated cmake variable definition
Ralf Habacker [Tue, 15 Jan 2019 10:57:20 +0000 (11:57 +0100)] 
Remove duplicated cmake variable definition

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoInstall devhelp2 and api doc with cmake
Ralf Habacker [Tue, 15 Jan 2019 10:56:36 +0000 (11:56 +0100)] 
Install devhelp2 and api doc with cmake

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoGenerate documentation html index file from doc/index.html.in for autotools and cmake
Ralf Habacker [Tue, 15 Jan 2019 10:56:14 +0000 (11:56 +0100)] 
Generate documentation html index file from doc/index.html.in for autotools and cmake

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoMove cmake related build system to top level
Ralf Habacker [Thu, 10 Jan 2019 18:42:52 +0000 (19:42 +0100)] 
Move cmake related build system to top level

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agoMerge branch 'cmake-dist' into 'master'
Simon McVittie [Mon, 21 Jan 2019 16:23:53 +0000 (16:23 +0000)] 
Merge branch 'cmake-dist' into 'master'

CI: Do the CMake native debug build from an Autotools `make dist`

Closes #255

See merge request dbus/dbus!87

6 years agoMerge branch 'ax-missing' into 'master'
Simon McVittie [Mon, 21 Jan 2019 16:22:14 +0000 (16:22 +0000)] 
Merge branch 'ax-missing' into 'master'

configure.ac: Forbid AX_-prefixed patterns more selectively

Closes #249

See merge request dbus/dbus!86

Reviewed-by: @pwithnall
6 years agoMerge branch 'test-bundling' into 'master'
Simon McVittie [Mon, 21 Jan 2019 15:48:12 +0000 (15:48 +0000)] 
Merge branch 'test-bundling' into 'master'

Move some test code from dbus/ and bus/ into test/

Closes #223

See merge request dbus/dbus!1

Reviewed-by: @rhabacker
[smcv: Use ${TEST_DIR} as requested during review]

6 years agotest: Move _dbus_list_test() here
Simon McVittie [Wed, 3 Oct 2018 17:31:15 +0000 (18:31 +0100)] 
test: Move _dbus_list_test() here

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move _dbus_transport_unix_test() here
Simon McVittie [Fri, 28 Sep 2018 16:06:00 +0000 (17:06 +0100)] 
test: Move _dbus_transport_unix_test() here

This requires exposing _dbus_connection_get_address() as an internal
symbol, but that seems worth it.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move _dbus_server_test() here
Simon McVittie [Fri, 28 Sep 2018 16:05:26 +0000 (17:05 +0100)] 
test: Move _dbus_server_test() here

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move _dbus_misc_test() here
Simon McVittie [Fri, 28 Sep 2018 16:02:38 +0000 (17:02 +0100)] 
test: Move _dbus_misc_test() here

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move _dbus_signature_test() here
Simon McVittie [Fri, 28 Sep 2018 16:00:01 +0000 (17:00 +0100)] 
test: Move _dbus_signature_test() here

This is all public API, so there's no need to embed it in the library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-signature: Move static assertion outside test code
Simon McVittie [Fri, 28 Sep 2018 15:57:13 +0000 (16:57 +0100)] 
dbus-signature: Move static assertion outside test code

This always needs to be true, even if we're not embedding test goo
in the library. These static assertions have no runtime overhead, only
compile-time, so it's OK to make it unconditional.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move sysdeps tests here
Simon McVittie [Fri, 28 Sep 2018 15:46:41 +0000 (16:46 +0100)] 
test: Move sysdeps tests here

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move string tests (most of dbus-string-util.c) here
Simon McVittie [Fri, 28 Sep 2018 15:45:50 +0000 (16:45 +0100)] 
test: Move string tests (most of dbus-string-util.c) here

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move marshalling tests into test/
Simon McVittie [Fri, 28 Sep 2018 15:36:49 +0000 (16:36 +0100)] 
test: Move marshalling tests into test/

dbus-marshal-recursive-util.c contains utility functions used by the
other two, as well as tests. The others are purely test code.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-marshal-*-util: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:34:41 +0000 (11:34 +0000)] 
dbus-marshal-*-util: Remove all trailing whitespace

This is in preparation for moving the files: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move dbus-message-factory and most of dbus-message-util into test/
Simon McVittie [Fri, 28 Sep 2018 15:32:03 +0000 (16:32 +0100)] 
test: Move dbus-message-factory and most of dbus-message-util into test/

As with previous moves, I've tried to extract the possible copyright
holders from the git history.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-message-factory: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:31:17 +0000 (11:31 +0000)] 
dbus-message-factory: Remove all trailing whitespace

This is in preparation for moving the files: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move auth, credentials tests from libdbus-internal into test/
Simon McVittie [Fri, 28 Sep 2018 15:27:42 +0000 (16:27 +0100)] 
test: Move auth, credentials tests from libdbus-internal into test/

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-credentials-util: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:30:23 +0000 (11:30 +0000)] 
dbus-credentials-util: Remove all trailing whitespace

This is in preparation for moving the file: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-auth-util: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:30:00 +0000 (11:30 +0000)] 
dbus-auth-util: Remove all trailing whitespace

This is in preparation for moving the file: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-auth-script: Remove all trailing whitespace
Simon McVittie [Mon, 17 Dec 2018 11:29:29 +0000 (11:29 +0000)] 
dbus-auth-script: Remove all trailing whitespace

This is in preparation for moving the file: our commit hook would
object to the delete + add otherwise.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Unembed hash test from libdbus and move it into test/
Simon McVittie [Mon, 17 Dec 2018 11:18:35 +0000 (11:18 +0000)] 
test: Unembed hash test from libdbus and move it into test/

This required exposing one additional internal symbol:
_dbus_hash_table_ref(). I think that's a reasonable trade-off for not
compiling this test into the library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agodbus-hash: Attempt to update copyright holders from git history
Simon McVittie [Mon, 17 Dec 2018 11:17:59 +0000 (11:17 +0000)] 
dbus-hash: Attempt to update copyright holders from git history

This is in preparation for splitting the file, tests vs. non-tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Split slow parts of the former test-dbus into their own executables
Simon McVittie [Thu, 15 Nov 2018 15:48:26 +0000 (15:48 +0000)] 
test: Split slow parts of the former test-dbus into their own executables

This makes it easier for a developer to run just the fast parts while
debugging some issue reproduced by the faster tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago_dbus_test_main: Move to test-utils
Simon McVittie [Thu, 15 Nov 2018 14:08:03 +0000 (14:08 +0000)] 
_dbus_test_main: Move to test-utils

Now that there is no code outside test/ that calls into this, we can
move it into test/, reducing the size of libdbus.

dbus-test-tap.[ch] still need to stay in dbus/ as long as there is
code in dbus/ or bus/ relying on them, and also need to be linked into
libdbus as long as there is other code in libdbus relying on them,
so they stay where they are for now. Similarly, dbus-tests.h lists
the tests that are still embedded in libdbus, and must stay where
it is for the moment.

With this move, various tests now need to be linked to the dbus-testutils
convenience library.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move dbus-daemon-launch-helper-test here, and rename
Simon McVittie [Wed, 3 Oct 2018 18:01:42 +0000 (19:01 +0100)] 
test: Move dbus-daemon-launch-helper-test here, and rename

The -test suffix does not indicate that this is a test, but rather that
it is for tests (similar to the -unix and -win suffixes on modules like
dbus-sysdeps). This seems unnecessarily confusing, so rename it to end
with -for-tests.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move libdbus embedded tests from dbus/ to test/
Simon McVittie [Wed, 3 Oct 2018 18:15:38 +0000 (19:15 +0100)] 
test: Move libdbus embedded tests from dbus/ to test/

This groups them with the rest of the tests, and enables parts of
the test code to be unembedded from libdbus and moved to test/ too.

Rename the executable to test-misc-internals, not test-dbus. The name
test-dbus made some sense as "the executable that contains the code in
dbus/", but makes a lot less sense in test/: dbus is the name of the
entire project, so this test has no particular special claim to that
name. test-libdbus doesn't seem right either, because all the tests
exercise libdbus one way or another.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Break out the slow parts of test-bus into their own executables
Simon McVittie [Mon, 3 Sep 2018 23:57:10 +0000 (16:57 -0700)] 
test: Break out the slow parts of test-bus into their own executables

This makes it more convenient to re-run the rest of test-bus as
required when debugging.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest: Move dbus-daemon and d-d-launch-helper tests from bus/
Simon McVittie [Wed, 3 Oct 2018 17:49:56 +0000 (18:49 +0100)] 
test: Move dbus-daemon and d-d-launch-helper tests from bus/

This groups them with the other tests, and avoids having them influence
the test coverage stats in bus/.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobus tests: Collect possible copyright holders from git history
Simon McVittie [Mon, 17 Dec 2018 11:11:34 +0000 (11:11 +0000)] 
bus tests: Collect possible copyright holders from git history

This is in preparation to move some of this code into the test/
directory. I've ignored changes that appear to be trivial.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoConvert spawn test into a standalone test executable
Simon McVittie [Fri, 28 Sep 2018 14:53:40 +0000 (15:53 +0100)] 
Convert spawn test into a standalone test executable

This test is sufficiently well-separated that there's no real need
to embed it in libdbus. Move it into the test directory instead.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobuild: Compile most bus/ files into static libraries
Simon McVittie [Mon, 3 Sep 2018 22:27:29 +0000 (15:27 -0700)] 
build: Compile most bus/ files into static libraries

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>
6 years agotest-utils: Add copyright and licensing
Simon McVittie [Mon, 3 Sep 2018 21:37:55 +0000 (14:37 -0700)] 
test-utils: Add copyright and licensing

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>
6 years agoCI: Do the CMake native debug build from an Autotools `make dist`
Simon McVittie [Mon, 21 Jan 2019 15:00:34 +0000 (15:00 +0000)] 
CI: Do the CMake native debug build from an Autotools `make dist`

We officially release dbus in the form of Autotools `make dist` tarballs,
but people who have downloaded those tarballs should be able to choose
the CMake build system. Our CI should assert that they can.

(The Autotools debug build already does a `make distcheck`, which
asserts that tarball releases can be used for an Autotools build.)

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus#255

6 years agoconfigure.ac: Forbid AX_-prefixed patterns more selectively
Simon McVittie [Mon, 21 Jan 2019 14:28:24 +0000 (14:28 +0000)] 
configure.ac: Forbid AX_-prefixed patterns more selectively

We want to make autoconf fail early and with a user-comprehensible
message if autoconf-archive isn't installed, rather than generating
a configure script with syntax errors, or a configure script that runs
successfully but doesn't do what we intended.

However, autoconf-archive doesn't actually guarantee not to use
AX_-prefixed shell variable names without m4_pattern_allow'ing them
(unlike Autoconf, Automake, Libtool and pkg-config, which explicitly use
m4_pattern_allow for variables with AC_, AM_, LT_ and PKG_ prefixes), so
it isn't safe to assume that they won't be used. In particular, recent
versions of AX_CHECK_GNU_MAKE appear to be using
$AX_CHECK_GNU_MAKE_HEADLINE as a shell variable.

Instead, specifically forbid the names of the finite list of macros
that we actually use.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus#249

6 years agoMerge branch 'fix-ctest-runtime-path-issue' into 'master'
Simon McVittie [Thu, 10 Jan 2019 21:45:55 +0000 (21:45 +0000)] 
Merge branch 'fix-ctest-runtime-path-issue' into 'master'

Make sure ctest on Windows uses the currently built dbus library

See merge request dbus/dbus!83

6 years agoMake sure ctest on Windows uses the currently built dbus library
Ralf Habacker [Thu, 10 Jan 2019 14:29:59 +0000 (15:29 +0100)] 
Make sure ctest on Windows uses the currently built dbus library

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.

6 years agoMerge branch 'rename-dbus-socket-set' into 'master'
Ralf Habacker [Wed, 9 Jan 2019 17:54:07 +0000 (17:54 +0000)] 
Merge branch 'rename-dbus-socket-set' into 'master'

Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files

See merge request dbus/dbus!81

Reviewed-by: Simon McVittie
6 years agoRename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functi...
Ralf Habacker [Mon, 7 Jan 2019 12:07:12 +0000 (13:07 +0100)] 
Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functions/files

Because the implementation of DBusSocketSet already supports non-socket
pollables like pipes and inotify fd on Unix, DBusPollableSet is a better
name.

6 years agoMerge branch 'windows-spawn-cleanup' into 'master'
Simon McVittie [Mon, 7 Jan 2019 11:06:16 +0000 (11:06 +0000)] 
Merge branch 'windows-spawn-cleanup' into 'master'

Windows spawn cleanup

See merge request dbus/dbus!80

6 years agoMerge branch 'glib-2.38-support' into 'master'
Ralf Habacker [Mon, 7 Jan 2019 09:27:55 +0000 (09:27 +0000)] 
Merge branch 'glib-2.38-support' into 'master'

Add glib 2.38 support

See merge request dbus/dbus!79

Reviewed-by: Philip Withnall
Reviewed-by: Simon McVittie
6 years agoAdd glib 2.38 support
Ralf Habacker [Thu, 3 Jan 2019 22:54:56 +0000 (23:54 +0100)] 
Add glib 2.38 support

6 years agodbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()
Ralf Habacker [Fri, 21 Dec 2018 16:55:29 +0000 (17:55 +0100)] 
dbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Return valid error if child could not be spawned
Ralf Habacker [Fri, 21 Dec 2018 16:54:16 +0000 (17:54 +0100)] 
dbus-spawn-win.c: Return valid error if child could not be spawned

Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
6 years agodbus-spawn-win.c: Don't wait for babysitter thread to start
Ralf Habacker [Fri, 21 Dec 2018 16:03:27 +0000 (17:03 +0100)] 
dbus-spawn-win.c: Don't wait for babysitter thread to start

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>
6 years agodbus-spawn-win.c: Move out argv copy from DBusSitter struct
Ralf Habacker [Fri, 21 Dec 2018 15:38:02 +0000 (16:38 +0100)] 
dbus-spawn-win.c: Move out argv copy from DBusSitter struct

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>
6 years agodbus-spawn: Don't take ownership of envp
Simon McVittie [Thu, 20 Dec 2018 15:27:03 +0000 (15:27 +0000)] 
dbus-spawn: Don't take ownership of envp

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>
6 years agodbus-spawn-win: Move _dbus_spawn_program() to main thread
Simon McVittie [Thu, 20 Dec 2018 15:17:13 +0000 (15:17 +0000)] 
dbus-spawn-win: Move _dbus_spawn_program() to main thread

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>
6 years agoMerge branch 'cmake-custom-install-dirs' into 'master'
Simon McVittie [Fri, 4 Jan 2019 18:27:50 +0000 (18:27 +0000)] 
Merge branch 'cmake-custom-install-dirs' into 'master'

In cmake use variables provided from GNUInstallDirs consequently

See merge request dbus/dbus!77

6 years agoIn cmake use variables provided from GNUInstallDirs consequently
Ralf Habacker [Fri, 21 Dec 2018 18:36:37 +0000 (19:36 +0100)] 
In cmake use variables provided from GNUInstallDirs consequently

This is required to support a custom installation layout, e.g. the
KDE binary factory.

6 years agoMerge branch 'test-defend-getenv' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:28:42 +0000 (13:28 +0000)] 
Merge branch 'test-defend-getenv' into 'master'

test-wrappers: Copy strings that might come from getenv()

Closes #240

See merge request dbus/dbus!74

Reviewed-by: Philip Withnall
6 years agoMerge branch 'test-main-boilerplate' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:27:42 +0000 (13:27 +0000)] 
Merge branch 'test-main-boilerplate' into 'master'

Consolidate boilerplate from embedded tests' main()

See merge request dbus/dbus!73

Reviewed-by: Ralf Habacker
6 years agoMerge branch 'deprecate-packaged-xml-in-sysconfdir' into 'master'
Simon McVittie [Thu, 20 Dec 2018 13:25:21 +0000 (13:25 +0000)] 
Merge branch 'deprecate-packaged-xml-in-sysconfdir' into 'master'

Deprecate packaged XML policies in ${sysconfdir}

See merge request dbus/dbus!76

Reviewed-by: Tom Gundersen
6 years agodbus-daemon(1): Give more comprehensive examples of how to add services
Simon McVittie [Wed, 19 Dec 2018 17:29:11 +0000 (17:29 +0000)] 
dbus-daemon(1): Give more comprehensive examples of how to add services

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>
6 years agoOfficially deprecate package-supplied dbus-daemon policy in ${sysconfdir}
Simon McVittie [Wed, 19 Dec 2018 17:27:15 +0000 (17:27 +0000)] 
Officially deprecate package-supplied dbus-daemon policy in ${sysconfdir}

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>
6 years agoMerge branch '135-session-test-support-windows' into 'master'
Ralf Habacker [Tue, 18 Dec 2018 07:15:01 +0000 (07:15 +0000)] 
Merge branch '135-session-test-support-windows' into 'master'

name-test: Run most tests in CMake, via dbus-run-session

See merge request dbus/dbus!23

6 years agoFix multi-configuration generator support
Ralf Habacker [Mon, 17 Dec 2018 15:37:16 +0000 (16:37 +0100)] 
Fix multi-configuration generator support

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.

6 years agoAdd cmake support for session based test executables
Ralf Habacker [Mon, 17 Dec 2018 15:36:32 +0000 (16:36 +0100)] 
Add cmake support for session based test executables

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>
6 years agoAdd cmake support for session based test executables
Ralf Habacker [Mon, 17 Dec 2018 15:13:00 +0000 (16:13 +0100)] 
Add cmake support for session based test executables

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>
6 years agoUse prefined variables to setup environment in cmake macro add_test_executable
Ralf Habacker [Mon, 17 Dec 2018 15:12:33 +0000 (16:12 +0100)] 
Use prefined variables to setup environment in cmake macro add_test_executable

Bug: https://gitlab.freedesktop.org/dbus/dbus/issues/135

6 years agoAdd missing extension to TEST_LAUNCH_HELPER_BINARY in cmake
Ralf Habacker [Mon, 17 Dec 2018 15:11:48 +0000 (16:11 +0100)] 
Add missing extension to TEST_LAUNCH_HELPER_BINARY in cmake

6 years agoFix setup of build time output paths in cmake
Ralf Habacker [Sat, 15 Dec 2018 09:54:47 +0000 (10:54 +0100)] 
Fix setup of build time output paths in cmake

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.

6 years agotest-wrappers: Copy strings that might come from getenv()
Simon McVittie [Fri, 14 Dec 2018 20:31:31 +0000 (20:31 +0000)] 
test-wrappers: Copy strings that might come from getenv()

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>
6 years agotests: Collect common code from embedded-test main executables
Simon McVittie [Mon, 3 Sep 2018 21:53:24 +0000 (14:53 -0700)] 
tests: Collect common code from embedded-test main executables

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>
6 years agobus tests: Skip unsupported fd-passing test internally, not from main()
Simon McVittie [Mon, 3 Sep 2018 21:13:45 +0000 (14:13 -0700)] 
bus tests: Skip unsupported fd-passing test internally, not from main()

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>
6 years agoembedded tests: Time how long each test takes
Simon McVittie [Mon, 3 Sep 2018 19:46:25 +0000 (12:46 -0700)] 
embedded tests: Time how long each test takes

This will help to split them up into modules that each take a
reasonable time.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoembedded tests: Conform to the same API for all tests
Simon McVittie [Mon, 3 Sep 2018 19:18:39 +0000 (12:18 -0700)] 
embedded tests: Conform to the same API for all tests

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>
6 years agodbus-marshal-validate.h: Make self-contained
Simon McVittie [Mon, 3 Sep 2018 21:59:02 +0000 (14:59 -0700)] 
dbus-marshal-validate.h: Make self-contained

This header mentions DBusString, so it had better include dbus-string.h.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'copyright-whitespace' into 'master'
Simon McVittie [Mon, 17 Dec 2018 12:13:12 +0000 (12:13 +0000)] 
Merge branch 'copyright-whitespace' into 'master'

trivial: Remove trailing whitespace from copyright notices

See merge request dbus/dbus!75

Reviewed-by: pwithnall
6 years agotrivial: Remove trailing whitespace from copyright notices
Simon McVittie [Mon, 17 Dec 2018 10:56:38 +0000 (10:56 +0000)] 
trivial: Remove trailing whitespace from copyright notices

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>
6 years agoMerge branch 'remove-threads-init-debug' into 'master'
Simon McVittie [Mon, 17 Dec 2018 10:28:07 +0000 (10:28 +0000)] 
Merge branch 'remove-threads-init-debug' into 'master'

_dbus_threads_init_debug: Remove

See merge request dbus/dbus!72

6 years ago_dbus_threads_init_debug: Remove
Simon McVittie [Fri, 14 Dec 2018 20:06:02 +0000 (20:06 +0000)] 
_dbus_threads_init_debug: Remove

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>
6 years agoMerge branch 'gitignore' into 'master'
Simon McVittie [Fri, 14 Dec 2018 15:11:51 +0000 (15:11 +0000)] 
Merge branch 'gitignore' into 'master'

trivial: Clean up .gitignore files

See merge request dbus/dbus!70

Reviewed-by: pwithnall
6 years ago.gitignore: Ignore many more generated files
Simon McVittie [Fri, 14 Dec 2018 13:28:50 +0000 (13:28 +0000)] 
.gitignore: Ignore many more generated files

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'reduce-test-refs-run-time' into 'master'
Simon McVittie [Fri, 14 Dec 2018 13:08:01 +0000 (13:08 +0000)] 
Merge branch 'reduce-test-refs-run-time' into 'master'

Decrease the runtime of test-refs under Windows

Closes #244

See merge request dbus/dbus!65

6 years ago.gitignore: Normalize into LC_ALL=C sort order
Simon McVittie [Fri, 14 Dec 2018 12:51:51 +0000 (12:51 +0000)] 
.gitignore: Normalize into LC_ALL=C sort order

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>
6 years ago.gitignore: Make match patterns more specific
Simon McVittie [Fri, 14 Dec 2018 12:50:25 +0000 (12:50 +0000)] 
.gitignore: Make match patterns more specific

In subdirectories we mostly only want to match at the current level,
not in nested subdirectories.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agovalid-config-files-system .gitignore: Don't ignore many-rules.conf
Simon McVittie [Fri, 14 Dec 2018 12:48:41 +0000 (12:48 +0000)] 
valid-config-files-system .gitignore: Don't ignore many-rules.conf

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Remove obsolete patterns
Simon McVittie [Fri, 14 Dec 2018 12:48:08 +0000 (12:48 +0000)] 
.gitignore: Remove obsolete patterns

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years ago.gitignore: Consolidate generic patterns at top level
Simon McVittie [Fri, 14 Dec 2018 12:46:35 +0000 (12:46 +0000)] 
.gitignore: Consolidate generic patterns at top level

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>
6 years agoTop level .gitignore: Sort anchored patterns in LC_ALL=C sort order
Simon McVittie [Fri, 14 Dec 2018 12:42:52 +0000 (12:42 +0000)] 
Top level .gitignore: Sort anchored patterns in LC_ALL=C sort order

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>
6 years agoTop level .gitignore: Group anchored and unanchored patterns
Simon McVittie [Fri, 14 Dec 2018 12:42:22 +0000 (12:42 +0000)] 
Top level .gitignore: Group anchored and unanchored patterns

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>
6 years ago.gitignore: Anchor patterns for files that are only at top level
Simon McVittie [Fri, 14 Dec 2018 12:39:33 +0000 (12:39 +0000)] 
.gitignore: Anchor patterns for files that are only at top level

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>
6 years agoTop level .gitignore: Remove files that now live in build-aux/
Simon McVittie [Fri, 14 Dec 2018 12:37:48 +0000 (12:37 +0000)] 
Top level .gitignore: Remove files that now live in build-aux/

We put these in build-aux/ since 15e6b4f5, and we ignore all of
build-aux/, so we don't need to ignore them separately.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'all-helpers-in-test' into 'master'
Simon McVittie [Fri, 14 Dec 2018 12:17:14 +0000 (12:17 +0000)] 
Merge branch 'all-helpers-in-test' into 'master'

test-privserver: Move helper executable out of name-test/

See merge request dbus/dbus!67

6 years agoIncrease the number of references/threads to be tested under Windows by default to...
Ralf Habacker [Fri, 14 Dec 2018 09:54:31 +0000 (10:54 +0100)] 
Increase the number of references/threads to be tested under Windows by default to detect errors

6 years agoDecrease the runtime of test refs under Windows by default
Ralf Habacker [Fri, 7 Dec 2018 16:52:58 +0000 (17:52 +0100)] 
Decrease the runtime of test refs under Windows by default

If the environment variable DBUS_TEST_SLOW is not set or is 0
fewer iterations are performed in test-refs enough to demonstrate
that it works, rather than seriously trying to reproduce race
conditions.

This solves the long runtime that Wine 3.x (4 times longer than
native Windows 7) or Windows 7 as a VirtualBox 5.22 guest (10
times longer) is to be seen.

Fixes #244

6 years agotest-privserver: Move helper executable out of name-test/
Simon McVittie [Tue, 11 Dec 2018 11:52:38 +0000 (11:52 +0000)] 
test-privserver: Move helper executable out of name-test/

This means we don't need to distinguish between DBUS_NAME_TEST_EXEC and
DBUS_TEST_EXEC any more, because all test helper executables are in the
same place, both during build and when installed (we don't install
test-privserver since no installed test requires it yet, but in
principle we could).

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Add copyright and licensing information
Simon McVittie [Thu, 13 Dec 2018 13:07:20 +0000 (13:07 +0000)] 
test-privserver: Add copyright and licensing information

I've assumed that trivial changes from Scott James Remnant (correcting
some bus names) and Marcus Brinkmann (adding a <config.h> include
tree-wide) are not significant here. All the other potential copyright
holders from the git log are listed, and all have given permission to
relicense their dbus contributions under the MIT/X11 license.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agotest-privserver: Remove all trailing whitespace
Simon McVittie [Thu, 13 Dec 2018 12:42:11 +0000 (12:42 +0000)] 
test-privserver: Remove all trailing whitespace

Otherwise the commit hook would forbid commits that move it to a new
location.

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agoMerge branch 'wip/asan' into 'master'
Simon McVittie [Wed, 12 Dec 2018 12:01:40 +0000 (12:01 +0000)] 
Merge branch 'wip/asan' into 'master'

Add AddressSanitizer and UBSan support

See merge request dbus/dbus!57

Reviewed-by: pwithnall
6 years agoMerge branch 'basic-value-align' into 'master'
Simon McVittie [Wed, 12 Dec 2018 12:00:03 +0000 (12:00 +0000)] 
Merge branch 'basic-value-align' into 'master'

Don't cast user-supplied pointers to DBusBasicValue *

See merge request dbus/dbus!69

Reviewed-by: thiago
6 years agoci: Apply AddressSanitizer to Linux "debug" builds
Simon McVittie [Mon, 3 Dec 2018 17:48:45 +0000 (17:48 +0000)] 
ci: Apply AddressSanitizer to Linux "debug" builds

Signed-off-by: Simon McVittie <smcv@collabora.com>
6 years agobuild: Add a way to set CFLAGS for AddressSanitizer etc.
Simon McVittie [Wed, 29 Aug 2018 19:06:00 +0000 (20:06 +0100)] 
build: Add a way to set CFLAGS for AddressSanitizer etc.

We don't want to set these globally via the normal CFLAGS, because if
we did, AddressSanitizer would catch test-segfault deliberately
segfaulting, and "helpfully" turn it into exit status 1, which in turn
makes our test fail because it asserts that the segfault is reported
as a segfault.

A typical use with gcc as compiler, on a reasonably recent Debian,
would be:

    ./configure SANITIZE_CFLAGS="-fsanitize=address -fsanitize=undefined -fPIE -pie"

Signed-off-by: Simon McVittie <smcv@collabora.com>