summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* test: fix loopback AF_UNIX tests to work on WindowsMarc-André Lureau2022-07-151-6/+6
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* test: enable AF_UNIX corrupt test on !unixMarc-André Lureau2022-07-151-7/+4
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* tests/corrupt: do not hardcode /tmp on !unixMarc-André Lureau2022-07-151-2/+11
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* test: add test_check_af_unix_works()Marc-André Lureau2022-07-152-0/+20
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* test-privserver: Exit if DBusLoop cannot be allocatedSimon McVittie2022-07-151-0/+3
| | | | | | Otherwise, we'd just crash when we dereference the null pointer. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test-privserver: Move cleanup of DBusLoop into test_service_data_free()Simon McVittie2022-07-151-11/+7
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test-privserver: Don't leak a copy of the server addressSimon McVittie2022-07-151-1/+8
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Work around TAP test regression in Meson 0.63.0Simon McVittie2022-07-152-4/+11
| | | | | | | | | | | | | | With Meson 0.63.0, detailed output of TAP tests is not logged, and the test deadlocks if the stderr pipe fills up. I'm hoping this will be fixed before 0.63.1, but in the meantime we can work around it by falling back to the 'exitcode' protocol: this means we lose machine-readable detailed test results, but at least our tests pass. See https://github.com/mesonbuild/meson/issues/10577 and https://github.com/mesonbuild/meson/issues/10563 for details of the Meson regression. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Don't prepend test- to the names of manual testsSimon McVittie2022-07-131-5/+11
| | | | | | This makes them consistent with what we do in Autotools. Signed-off-by: Simon McVittie <smcv@collabora.com>
* autotools: dist listen-autolaunch-win.conf.in as wellMarc-André Lureau2022-07-131-0/+1
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* meson: add test-autolaunch-winMarc-André Lureau2022-07-132-1/+7
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* test: Set PATH or WINEPATH to find dbus-daemon.exe in build-time testsSimon McVittie2022-07-131-0/+15
| | | | | | | | When building for Windows, either natively or cross-compiling and running tests with Wine, test-autolaunch-win expects to be able to find the just-built dbus-daemon.exe in the PATH. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Extend some timeoutsSimon McVittie2022-07-132-6/+30
| | | | | | | | | | | | | | | | Group slow tests (those taking about a minute or more in one of the configurations built on Gitlab-CI) into a new 'slow' suite, which can be used with `meson test --no-suite=slow` to run just the faster tests. They default to a 5 minute timeout (usually enough) unless overridden (bus/dispatch.c can be *very* slow when OOM testing is enabled, and gets a 30 minute timeout). For the remaining tests, default to Meson's usual 30 second timeout, but bump up the timeout a bit in some cases to have a safety margin (my method was to take the slowest run on our Gitlab-CI, and make sure we're allowing about 3 times that long). Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Group together tests that run the dbus-daemonSimon McVittie2022-07-131-0/+11
| | | | | | | These have slightly different requirements on CI, and are harder to get working on Windows. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Add missing session.conf, system.conf to Meson buildSimon McVittie2022-07-131-0/+19
| | | | | | | For as-installed testing on Unix, we want these to be symlinks to the production versions of the same file. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Install transient-services.sh into a subdirectorySimon McVittie2022-07-131-12/+26
| | | | | | | This is what we do with Autotools, and keeping Meson the same means we can diff the installed trees more easily. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: libdbus-testutils depends on GIO, not just GLibSimon McVittie2022-07-131-0/+1
| | | | | | This matters when we build against GLib as a Meson subproject. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Make environment variables consistent with AutotoolsSimon McVittie2022-07-131-3/+2
| | | | | | | | | | | | DBUS_SESSION_BUS_LISTEN_ADDRESS is the same as in non-test files: the test data distinguishes between DBUS_SESSION_BUS_LISTEN_ADDRESS, the real session bus configuration, and TEST_LISTEN, the test-only configuration. DBUS_TEST_HOMEDIR and HOME should be in the build directory, not the source directory. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Correct generation of .test metadataSimon McVittie2022-07-131-6/+19
| | | | | | | | | | | | | | | | | | | If a helper executable is not, in itself, a test-case, then we should not generate metadata that tells ginsttest-runner to run it as a test-case. Meanwhile, we were previously generating foo_with_config.test metadata for tests that don't get installed; stop doing that. We also need to distinguish between the abstract name of the test (which usually does not start with test-), the name of the .test file (which does start with test- for compiled executables), and the name of the executable (which may include .exe as well). To make validation against the Autotools build system as straightforward as possible, generate exactly the same names as in Autotools. We can consider removing the test- prefix later, if we remove the Autotools build system. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Allow for scripts that don't get installedSimon McVittie2022-07-131-1/+2
| | | | | | | At the moment there aren't any like this, but it seems reasonable that we might get some later. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Don't run integration tests at build-timeSimon McVittie2022-07-131-10/+18
| | | | | | | | | | | | | | | | Some items listed in the tests array are helper executables rather than actually being tests, and should not be run as a test at any time. Those have {"test": false}. Expand this special case to the scripts array for completeness (although currently, no scripts need this). Meanwhile, some items listed in the scripts array are "as-installed" integration tests which cannot safely be run at build-time, because they make assertions about the state of the installed system. Introduce {"build_time_test": false} for these, and expand this special case to the tests array for completeness (although currently, no compiled executables need this). Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Propagate some comments from Autotools build into MesonSimon McVittie2022-07-131-1/+7
| | | | | | | Comments like these represent hard-won knowledge which we should not discard. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Add machine-readable licensing markers to the Meson build systemSimon McVittie2022-07-134-0/+4
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Try to create temporary XDG_RUNTIME_DIR with correct modeSimon McVittie2022-07-133-2/+18
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Distribute Meson build system in release tarballsSimon McVittie2022-07-132-0/+8
| | | | | | | As long as we are treating Autotools as a first-class citizen, what we release will be `make distcheck` output. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test/data: Generate a separate installable set of data filesSimon McVittie2022-07-132-7/+51
| | | | | | | Some of the strings we need to substitute into these files are not the same for as-installed testing as for build-time testing. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Avoid arbitrary Python injection if compiled in a path with quotesSimon McVittie2022-07-131-1/+3
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Disable sanitizers for test-segfaultSimon McVittie2022-07-131-3/+2
| | | | | | This resolves the TODO comment. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Expect TAP output for tests in name-testSimon McVittie2022-07-131-0/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Don't run test-autolaunch directlySimon McVittie2022-07-131-0/+5
| | | | | | It's intended to be run from run-test.sh. Signed-off-by: Simon McVittie <smcv@collabora.com>
* test: Sort test executablesSimon McVittie2022-07-131-1/+1
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* Add Meson build systemFélix Piédallu2022-07-137-6/+940
| | | | | Signed-off-by: Félix Piédallu <felix@piedallu.me> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* Add a test application for autostart on Windows implementationRalf Habacker2022-06-274-3/+393
| | | | | | | | | The test application performs several individual tests to detect possible problems with the autostart support under Windows. Connections are tested with the standard scope, a 'custom' scope, the 'install path' scope and the 'user' scope. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
* build-sys: drop DBUS_CMAKEMarc-André Lureau2022-06-171-4/+0
| | | | | | TEST_LISTEN is defined by the cmake/autotools (or meson) build systems. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* test: fix unused variable warningsMarc-André Lureau2022-05-191-1/+1
| | | | | | | | | | | ../../test/internals/assertions.c: In function ‘test_assert_error_is_set’: ../../test/internals/assertions.c:82:14: warning: unused variable ‘ep’ [-Wunused-variable] 82 | DBusError *ep = NULL; | ^~ ../../test/internals/assertions.c:81:13: warning: unused variable ‘e’ [-Wunused-variable] 81 | DBusError e = DBUS_ERROR_INIT; Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* Add unit tests for platform-specific mutex implementation.Ralf Habacker2022-05-013-0/+288
| | | | | | | | | | | | | | | | | | | | The tests are enabled with the embedded tests; the required low-level functions from the dbus library are decorated with DBUS_EMBEDDED_TESTS_EXPORT to indicate the appropriate usage. On Windows, all tests are run; on unix-like operating systems, individual tests are disabled: - the tests on #NULL pointers of type DBus[C|R]Mutex, since they point to a data structure and would cause a segment violation when accessed. - the multiple lock test for type DBusCMutex, since it would block the current thread. Since the whole point of "rmutex" is to be able to lock multiple times, the "rmutex double lock" test is enabled on unix-like operating systems too. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
* tests: Fix build warning "dereferencing type-punned pointer will break ↵Ralf Habacker2022-05-011-7/+22
| | | | | | | | | | strict-aliasing rules" To avoid that build break in test-marshall-recursive-util.c the newly added function _dbus_string_append_buffer_as_hex() is used to print the hex bytes. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de>
* _dbus_string_test(): Fix fatal build error caused by "-Wstrict-aliasing"Ralf Habacker2022-04-211-1/+1
| | | | | | | | | | To fix this problem, the problematic code was replaced by a new function _dbus_string_get_allocated_size(), which uses the existing macro DBUS_CONST_STRING_PREAMBLE for these purposes. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de> Part-of: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/275 Reviewed-by: Simon McVittie <smcv@collabora.com>
* test-segfault: Fix build error caused by a null pointer dereference warningRalf Habacker2022-04-211-5/+6
| | | | | | | | | | | Only do the deliberate crash via undefined behaviour (which the compiler is quite right to warn us about!) if raise() isn't available. The pointer needs to be volatile otherwise the compiler is free to remove the store. Part-of: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/275 Reviewed-by: Simon McVittie <smcv@collabora.com>
* test: Add basic test coverage for _dbus_close_all and friendsSimon McVittie2022-04-211-5/+137
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test-utils-glib: Add backports of some convenience macrosSimon McVittie2022-04-211-0/+12
| | | | Signed-off-by: Simon McVittie <smcv@collabora.com>
* test-utils-glib: Ensure correct precedence in g_assert_nonnull()Simon McVittie2022-04-211-1/+1
| | | | | | | It's best-practice to put macro arguments in parentheses so that they are always treated as a unit. Signed-off-by: Simon McVittie <smcv@collabora.com>
* build: Define DBUS_INT64_MODIFIER, analogous to G_GINT64_MODIFIERSimon McVittie2022-04-193-6/+35
| | | | | | | | | | | | | | | | | | | Using PRId64, etc. to print dbus_int64_t or dbus_uint64_t is not 100% portable. On platforms where both long and long long are 64-bit (such as Linux and macOS), we will prefer to define dbus_int64_t as long. If the operating system has chosen to define int64_t as long long, which is apparently the case on macOS, then the compiler can warn that we are passing a long argument to PRId64, which is "lld" and therefore expects a long long argument (even though that ends up with the same bit-pattern being used). We can't necessarily just use int64_t and uint64_t directly, even if all our supported platforms have them available now, because swapping dbus_int64_t between long and long long might change C++ name mangling, causing ABI breaks in third-party libraries if they define C++ functions that take a dbus_int64_t argument. Signed-off-by: Simon McVittie <smcv@collabora.com>
* tests: Ensure session bus has started before integration testSimon McVittie2022-02-211-2/+13
| | | | | | | | | | The session dbus-daemon won't necessarily be run immediately on login if we are using systemd socket activation for it, and the transient services directory $XDG_RUNTIME_DIR/dbus-1/services isn't created until it's actually run. Ping the dbus-daemon to make sure it's available. Signed-off-by: Simon McVittie <smcv@debian.org> Bug-Debian: https://bugs.debian.org/1005889
* test-utils: Don't assume all arrays of tests are zero-terminatedSimon McVittie2021-12-151-12/+23
| | | | | | Fixes: dbus!233 Resolves: dbus#366 Signed-off-by: Simon McVittie <smcv@collabora.com>
* Disable the Containers interfaceSimon McVittie2021-12-104-16/+2
| | | | | | | | We've had a request for a 1.14.x stable-branch, but the Containers interface is only partially implemented, not yet described in the D-Bus Specification, and not ready to be part of our API guarantees. Signed-off-by: Simon McVittie <smcv@collabora.com>
* cmake: add option ENABLE_VERBOSE_CONFIGRalf Habacker2021-12-101-14/+19
| | | | | | Checking the filenames of generated configuration files is now optionally possible with this cmake option. They are no longer displayed by default to avoid unnecessarily flooding the output.
* In _dbus_test_main() check if a specified test name is availableRalf Habacker2021-12-101-0/+23
| | | | Fixes #362
* test/test-utils.c: Add command line option --list-tests to test applicationsRalf Habacker2021-12-101-0/+16
| | | | | With this command line option a list of available tests is printed to stdout.
* test/test-utils.c: Add command line option --help to test applicationsRalf Habacker2021-12-101-2/+23
|