mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
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>
This commit is contained in:
@@ -123,7 +123,7 @@ Exec = {python} -c 'print("%k")'
|
||||
def launchAndCheck(self, entry: Path, cwd: Path = None):
|
||||
result = self.runTestProgram(["launch", str(entry)], cwd=str(cwd))
|
||||
|
||||
self.assertEqual(result.out, str(self.entry))
|
||||
self.assertIn(str(self.entry), result.out)
|
||||
|
||||
def test_absolute_from_folder(self):
|
||||
"""Test with absolute path, with changing working directory to folder."""
|
||||
|
Reference in New Issue
Block a user