Commit Graph

17 Commits

Author SHA1 Message Date
Philip Withnall
fd27c8dc6e tests: Add G_TEST_OPTION_ISOLATE_DIRS to almost all gdbus tests
This is a spiritual follow-up to commit 8cff531520, which
added `G_TEST_OPTION_ISOLATE_DIRS` to the `gdbus-connection-flush` test
to avoid its D-Bus cookie lock file from being erroneously deleted by
other tests running in parallel.

The same failure mode could affect any of the other D-Bus tests which
connect to a bus. As an easy fix, enable `G_TEST_OPTION_ISOLATE_DIRS`
for all of them.

The only test it’s not (yet) enabled for is `gdbus-address-get-session`
as that messes around with `XDG_RUNTIME_DIR` to test finding the session
bus. It might be possible to use `G_TEST_OPTION_ISOLATE_DIRS` with it,
but that would take longer than I have right now.

In any case, the more tests (which try to connect to a bus) that this is
enabled for, the lower the chances of spurious test failure due to them
conflicting over shared resources.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-11-23 11:15:20 +00:00
Marco Trevisan (Treviño)
1da208cddc gio/tests/gdbus-proxy-threads: Unref GVariant's that we own
This test is leaking various GVariant's that we are supposed to unref,
leading the valgrind CI job to complain about.

Helps with: https://gitlab.gnome.org/GNOME/glib/-/issues/333
2022-09-02 20:26:06 +02:00
Philip Withnall
c613d32b92 tests: Add SPDX license headers automatically
Add SPDX license (but not copyright) headers to all files which follow a
certain pattern in their existing non-machine-readable header comment.

This commit was entirely generated using the command:
```
git ls-files gio/tests/*.c | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs'
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-05-18 09:20:07 +01:00
Philip Withnall
00bfb3ab44 tree: Fix various typos and outdated terminology
This was mostly machine generated with the following command:
```
codespell \
    --builtin clear,rare,usage \
    --skip './po/*' --skip './.git/*' --skip './NEWS*' \
    --write-changes .
```
using the latest git version of `codespell` as per [these
instructions](https://github.com/codespell-project/codespell#user-content-updating).

Then I manually checked each change using `git add -p`, made a few
manual fixups and dropped a load of incorrect changes.

There are still some outdated or loaded terms used in GLib, mostly to do
with git branch terminology. They will need to be changed later as part
of a wider migration of git terminology.

If I’ve missed anything, please file an issue!

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-06-12 15:01:08 +01:00
Sébastien Wilmet
d9a44b66af gio/tests/: LGPLv2+ -> LGPLv2.1+
A lot of tests in gio/tests/ don't have a license header.

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:34 +02:00
Simon McVittie
45dae4b506 tests: replace most g_print() with g_printerr()
I searched all files that mention g_test_run, and replaced most
g_print() calls. This avoids interfering with TAP. Exceptions:

* gio/tests/network-monitor: a manual mode that is run by
  "./network-monitor --watch" is unaffected
* glib/gtester.c: not a test
* glib/gtestutils.c: not a test
* glib/tests/logging.c: specifically exercising g_print()
* glib/tests/markup-parse.c: a manual mode that is run by
  "./markup-parse --cdata-as-text" is unaffected
* glib/tests/testing.c: specifically exercising capture of stdout
  in subprocesses
* glib/tests/utils.c: captures a subprocess's stdout
* glib/tests/testglib.c: exercises an assertion failure in g_print()

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Colin Walters <walters@verbum.org>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 20:24:56 +01:00
Simon McVittie
bced30cfbb GDBus tests: change progress noise from "if not quiet" to "if verbose"
It seems that even after Bug #711796, these can still interfere
with TAP testing:

PASS: gdbus-proxy-threads 1 /gdbus/proxy/vs-threads
tap-driver.sh: internal error getting exit status
tap-driver.sh: fatal: I/O or internal error

Let's shut them up unless --verbose is used (which would be appropriate
when running them interactively).

Similar symptoms have been seen in Debian:
https://buildd.debian.org/status/fetch.php?pkg=glib2.0&arch=mipsel&ver=2.39.91-1&stamp=1394394568
and in Guix:
https://lists.gnu.org/archive/html/bug-guix/2014-12/msg00002.html

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=725981
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2015-05-11 16:16:50 +01:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Dan Winship
8f5b40c046 gio/tests: fix output of gdbus-proxy-threads and gdbus-threading
Make gdbus-proxy-threads and gdbus-threading print a newline at the
end of their progress strings, to avoid messing up their TAP-format
output.

https://bugzilla.gnome.org/show_bug.cgi?id=711796
2013-11-23 00:43:54 -05:00
Ryan Lortie
1dc774a653 Remove g_type_init() calls
Very many testcases, some GLib tools (resource compiler, etc) and
GApplication were calling g_type_init().

Remove those uses, as they are no longer required.

https://bugzilla.gnome.org/show_bug.cgi?id=686161
2012-10-16 09:39:24 -04:00
Xavier Claessens
415a8d81f6 Use GTestDBus in all GDBus unit tests
To make port easier, this rewrites dbus-sessionbus.c using a
GTestDBus singleton internally.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
2012-04-19 10:07:39 +02:00
David Zeuthen
a6f83d73e5 Revert "Add GTestDBus object"
This reverts commit 1b5f70b5b0.
2012-04-18 13:47:51 -04:00
Xavier Claessens
1b5f70b5b0 Add GTestDBus object
This is a helper to write unit tests using a private dbus-daemon.

session_bus_up/down() are now just wrappers around a GTestDBus singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
2012-04-18 11:19:13 -04:00
Ryan Lortie
430c5635f2 g_thread_new: never fail
Remove the GError argument from g_thread_new() and abort on failure.
Introduce g_thread_try() for those who want to handle failure.
2011-10-13 01:00:57 -04:00
Ryan Lortie
015f4b4513 thread: nuke the concept of 'joinable'
And remove the 'joinable' argument from g_thread_new() and
g_thread_new_full().

Change the wording in the docs.  Clarify expectations for
(deprecated) g_thread_create().
2011-10-13 00:43:33 -04:00
Matthias Clasen
93e49aea1b Don't use deprecated GThread API in gio tests 2011-10-10 09:49:50 -04:00
Simon McVittie
67cf3ea368 Add a stress-test for GDBusProxy in threads with no default main context
Destroying a GDBusProxy in a thread used to race with NameOwnerChanged
being delivered to the main context's thread (GNOME #651133).

Also, g_dbus_proxy_call_sync in a thread would race with NameOwnerChanged
being delivered to the main context's thread and rewriting the name_owner
(GNOME #656039).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=656039
Bug-NB: NB#259760
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-08-15 12:50:04 -04:00