Commit Graph

8 Commits

Author SHA1 Message Date
Luca Bacci
12543df16f Tests: do not set a timeout in Python tests
The Meson test harness handles that for us.

With a custom timeout, meson test -t is not useful (which is
surprising for users) and interactive debugging sessions may
terminate unexepectedly.
2025-08-04 10:47:50 +02:00
Philip Withnall
41fe7c3797 tests: Loosen string comparison assertion in gio-tool.py
On BSD, the subprocess being spawned by `gio launch` ends up emitting
debug output onto stdout, which confuses the strict string assertion in
the test.

Instead use a ‘contains’ assertion.

Fixes this failure:
```
348/385 glib:gio+no-valgrind / gio-tool.py                                     ERROR            0.39s   exit status 1
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
stderr:
(test program exited with status code 1)
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
stdout:  12: UNKNOWN:   ---
stdout:  13: UNKNOWN:     message: |
stdout:  14: UNKNOWN:       Traceback (most recent call last):
stdout:  15: UNKNOWN:         File "/var/tmp/gitlab_runner/builds/Ff4WDDRj/0/GNOME/glib/_build/../gio/tests/gio-tool.py", line 130, in test_absolute_from_folder
stdout:  16: UNKNOWN:           self.launchAndCheck(self.entry, cwd=self.folder)
stdout:  17: UNKNOWN:         File "/var/tmp/gitlab_runner/builds/Ff4WDDRj/0/GNOME/glib/_build/../gio/tests/gio-tool.py", line 126, in launchAndCheck
stdout:  18: UNKNOWN:           self.assertEqual(result.out, str(self.entry))
stdout:  19: UNKNOWN:       AssertionError: '(gio launch:35500): GLib-GIO-DEBUG: 04:55[130 chars]ntry' != '/tmp/tmpa8oxxwvv/folder/desktop.entry'
stdout:  20: UNKNOWN:       - (gio launch:35500): GLib-GIO-DEBUG: 04:55:51.790: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
stdout:  21: UNKNOWN:         /tmp/tmpa8oxxwvv/folder/desktop.entry
stdout:  22: UNKNOWN:   ...
```

seen here: https://gitlab.gnome.org/GNOME/glib/-/jobs/5301812

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2025-07-15 12:26:43 +01:00
Christoph Martin
e2970dad72 tests: skip gio launch tests on darwin
Tests currently fail under macOS because the tool claims not to work
on apple devices. Since I cannot disprove this myself, I'm disabling the
tests on Darwin.
2025-07-09 13:39:34 +01:00
Christoph Martin
c2debf4fa9 tests: ensure gio launch expands field code %k
This introduces an integration test that executes gio launch from a
variety of working directories, and checks that %k is expanded to a
location that makes sense in the context of the executed program, i.e.
an absolute path.
2025-07-09 13:39:34 +01:00
Marco Trevisan (Treviño)
00ebf4e1eb tests/lib: Add a new unittest type to simplify launching test programs
We were reusing the same logic everywhere, while we can just reuse an
unique class to base our tests on that avoids having to copy-and-paste
code for no good reason
2025-02-11 18:51:15 +01:00
Philip Withnall
d59bac3f32 tests: Fix gio-tool.py test on macOS
Content types are different on macOS.

This fixes commit 9028c9bdf.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3158
2023-11-08 10:29:43 +00:00
Philip Withnall
9028c9bdf3 gio-tool-info: Fix critical warning when --attributes are specified
When `--attributes` is specified and doesn’t include `standard::name` in
its list, `gio` would print a critical warning from the (mandatory) call
to `g_file_info_get_name()`.

Fix that by making the call to `g_file_info_get_name()` optional.

Add a unit test too.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3158
2023-11-07 13:51:56 +00:00
Philip Withnall
3e0a99a059 tests: Add a very basic test suite for gio-tool
It gives nowhere near full coverage, but it’s something we can build on
in future.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3158
Helps: #2950
2023-11-07 13:51:56 +00:00