Commit Graph

3 Commits

Author SHA1 Message Date
Simon McVittie
30b89b830d testutils: Add a backport of g_test_disable_crash_reporting()
When testing something that is expected to fail or crash, it's useful
to disable core dump reporting.

This is a slightly simplified version of GNOME/glib!3510: because
libglnx isn't portable to non-Linux, we can assume that <sys/prctl.h>,
prctl() and <sys/resource.h> are always available, so we don't need
to check for them in the build system.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2023-07-28 14:50:13 +01:00
Simon McVittie
a91959e0d4 backport-testutils: Add g_assert_true(), g_assert_false()
These were only added in 2.38, and some projects with particularly
ancient dependencies (like the Steam Runtime, based on a 2012 version
of Ubuntu) still avoid depending on that version.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-10 15:27:56 +01:00
Simon McVittie
c52b73d4ae Backport most of the test convenience helpers from GLib's GTest
This includes a test (who tests the tests themselves?). Run
as `${build}/tests/testing --tap` with semi-modern GLib, or
`${build}/tests/testing --verbose` with GLib < 2.38, to check that the
output is as reasonable as possible given the limitations of the GLib
version in use.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-08-19 10:59:24 +01:00