Commit graph

5740 commits

Author SHA1 Message Date
Simon McVittie
83be61aa2d Consistently add CODE_COVERAGE_CPPFLAGS everywhere
We forgot this in a couple of places.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:46:07 +00:00
Simon McVittie
e0ea7a130c Consistently add CODE_COVERAGE_LIBS everywhere
We need to link the code coverage objects, directly or indirectly,
into every executable and every shared library. The rule I've followed
to make it clear that we do this, without too much repetition, is:
each executable, shared library or convenience library has
CODE_COVERAGE_LIBS in its LDADD or LIBADD, unless it is linked to a
convenience library in the same directory that has CODE_COVERAGE_LIBS
in *its* LIBADD.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:45:38 +00:00
Simon McVittie
2938c2125e Adapt to API change in AX_CODE_COVERAGE version 28
AX_CODE_COVERAGE recently changed the way it embedded its Makefile rules
in the output file: instead of using @CODE_COVERAGE_RULES@, users
are now meant to include aminclude_static.am.

The new AX_CODE_COVERAGE is only in the latest autoconf-archive release,
version 2019.01.06, which is inconveniently new, so bundle everything
we need for the moment.

This requires us to stop using the deprecated CODE_COVERAGE_LDFLAGS
(which we still used to support older versions of autoconf-archive)
and replace them with CODE_COVERAGE_LIBS.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 18:43:08 +00:00
Simon McVittie
8747c9b5a0 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
2019-01-21 16:23:53 +00:00
Simon McVittie
402344e89e 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
2019-01-21 16:22:14 +00:00
Simon McVittie
2ebc5101ec 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]
2019-01-21 15:48:12 +00:00
Simon McVittie
1972390d42 test: Move _dbus_list_test() here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:07 +00:00
Simon McVittie
0296c1fcbf 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>
2019-01-21 15:22:07 +00:00
Simon McVittie
d9dfe4ee3e test: Move _dbus_server_test() here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:07 +00:00
Simon McVittie
58fc8a0360 test: Move _dbus_misc_test() here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:06 +00:00
Simon McVittie
0dd9853a37 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>
2019-01-21 15:22:06 +00:00
Simon McVittie
4cc474a5de 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>
2019-01-21 15:22:06 +00:00
Simon McVittie
cccb35dfef test: Move sysdeps tests here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:22:05 +00:00
Simon McVittie
b1cfd892fc test: Move string tests (most of dbus-string-util.c) here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:21:43 +00:00
Simon McVittie
8ead2011ac 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>
2019-01-21 15:21:16 +00:00
Simon McVittie
5424eb2b0d 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>
2019-01-21 15:20:40 +00:00
Simon McVittie
f1f5294276 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>
2019-01-21 15:20:39 +00:00
Simon McVittie
28f3ecf190 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>
2019-01-21 15:20:24 +00:00
Simon McVittie
9feeeaea9a test: Move auth, credentials tests from libdbus-internal into test/
Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-21 15:20:22 +00:00
Simon McVittie
b4b0e1b3f5 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>
2019-01-21 15:20:06 +00:00
Simon McVittie
ab4c7c52f9 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>
2019-01-21 15:20:06 +00:00
Simon McVittie
f6213c709b 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>
2019-01-21 15:20:06 +00:00
Simon McVittie
053a62122b 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>
2019-01-21 15:20:06 +00:00
Simon McVittie
10a5a2c695 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>
2019-01-21 15:20:05 +00:00
Simon McVittie
24a1f3406a 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>
2019-01-21 15:20:04 +00:00
Simon McVittie
b7f11c17d1 _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>
2019-01-21 15:19:36 +00:00
Simon McVittie
e23bba929a 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>
2019-01-21 15:18:46 +00:00
Simon McVittie
b28e0886ed 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>
2019-01-21 15:18:18 +00:00
Simon McVittie
3b512610c0 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>
2019-01-21 15:17:36 +00:00
Simon McVittie
a15839da9b 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>
2019-01-21 15:16:51 +00:00
Simon McVittie
2732038528 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>
2019-01-21 15:15:21 +00:00
Simon McVittie
037d19a328 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>
2019-01-21 15:15:16 +00:00
Simon McVittie
d7644b7d4f 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>
2019-01-21 15:14:29 +00:00
Simon McVittie
651a82e685 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>
2019-01-21 15:14:29 +00:00
Simon McVittie
1063bba06b 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
2019-01-21 15:05:11 +00:00
Simon McVittie
ee09cc0acd 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
2019-01-21 14:28:24 +00:00
Simon McVittie
470d3f9d4b 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
2019-01-10 21:45:55 +00:00
Ralf Habacker
7f9eb9cea8 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.
2019-01-10 20:19:04 +01:00
Ralf Habacker
85253791ff 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
2019-01-09 17:54:07 +00:00
Ralf Habacker
4573c15ebb 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.
2019-01-09 15:20:19 +01:00
Simon McVittie
20deb4b61b Merge branch 'windows-spawn-cleanup' into 'master'
Windows spawn cleanup

See merge request dbus/dbus!80
2019-01-07 11:06:16 +00:00
Ralf Habacker
276e766c97 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
2019-01-07 09:27:55 +00:00
Ralf Habacker
602f4506a8 Add glib 2.38 support 2019-01-06 21:24:10 +01:00
Ralf Habacker
0c0056c7d6 dbus-spawn-win.c: Simplify logic of return value from call to _dbus_spawn_program()
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-05 11:41:58 +01:00
Ralf Habacker
4cae5cb81c dbus-spawn-win.c: Return valid error if child could not be spawned
Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
2019-01-05 11:41:58 +01:00
Ralf Habacker
bcd750fa2e 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>
2019-01-05 11:41:58 +01:00
Ralf Habacker
61c76cae02 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>
2019-01-05 11:41:58 +01:00
Simon McVittie
88032367a9 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>
2019-01-05 11:41:58 +01:00
Simon McVittie
5b72329d7d 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>
2019-01-05 11:41:58 +01:00
Simon McVittie
fb7484121a Merge branch 'cmake-custom-install-dirs' into 'master'
In cmake use variables provided from GNUInstallDirs consequently

See merge request dbus/dbus!77
2019-01-04 18:27:50 +00:00