diff options
author | Garrett Regier <garrettregier@gmail.com> | 2015-05-12 04:48:42 -0700 |
---|---|---|
committer | Garrett Regier <garrettregier@gmail.com> | 2015-05-14 03:47:42 -0700 |
commit | f5c7668f600f16f144c3772cc34c9fd929f98d28 (patch) | |
tree | 2fcad370b0cb4e598633d5286bcbe776aff137f1 | |
parent | a4c583e3732985835a9868659522b1d8aadf4cea (diff) | |
download | libpeas-f5c7668f600f16f144c3772cc34c9fd929f98d28.tar.gz |
Fix Python tests on OpenBSD
The OpenBSD linker spews warnings when a
symbol has a different size. This was causing
the stderr is empty assert to fail. Remove the
assert and only inherit stderr when the
PEAS_DEBUG environment variable is defined.
https://bugzilla.gnome.org/show_bug.cgi?id=727380
Signed-off-by: Garrett Regier <garrettregier@gmail.com>
-rw-r--r-- | tests/libpeas/extension-py.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/libpeas/extension-py.c b/tests/libpeas/extension-py.c index 17f54f1..0d9f913 100644 --- a/tests/libpeas/extension-py.c +++ b/tests/libpeas/extension-py.c @@ -180,11 +180,19 @@ test_extension_py_already_initialized_subprocess (void) static void test_extension_py_mixed_python (void) { + GTestSubprocessFlags flags = 0; + + /* Loading both Python 2 and Python 3 might cause + * the linker to spew warnings, i.e. on OpenBSD, so + * only inherit standard error when debugging + */ + if (g_getenv ("PEAS_DEBUG") != NULL) + flags |= G_TEST_SUBPROCESS_INHERIT_STDERR; + g_test_trap_subprocess (EXTENSION_TEST_NAME (PY_LOADER, "mixed-python/subprocess"), - 0, G_TEST_SUBPROCESS_INHERIT_STDERR); + 0, flags); g_test_trap_assert_passed (); - g_test_trap_assert_stderr (""); } static void |