mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
Merge branch '786-gio-test-leaks' into 'master'
Fix memory leaks in libgio tests and ensure tests are run under Meson Closes #786 See merge request GNOME/glib!151
This commit is contained in:
commit
c96f987f0d
@ -136,7 +136,10 @@ main (int argc,
|
|||||||
|
|
||||||
ret = g_test_run();
|
ret = g_test_run();
|
||||||
|
|
||||||
|
session_bus_down ();
|
||||||
|
|
||||||
g_object_unref (c);
|
g_object_unref (c);
|
||||||
|
g_main_loop_unref (loop);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -813,7 +813,7 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
||||||
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, '(s)', does not match expected type '()'");
|
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Type of message, “(s)”, does not match expected type “()”");
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
|
|
||||||
@ -826,7 +826,7 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||||
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method 'NonExistantMethod'");
|
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such method “NonExistantMethod”");
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
|
|
||||||
@ -874,7 +874,7 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
&error);
|
&error);
|
||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
||||||
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property 'ThisDoesntExist'");
|
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such property “ThisDoesntExist”");
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
@ -889,7 +889,7 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
&error);
|
&error);
|
||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
||||||
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Property 'NotReadable' is not readable");
|
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Property “NotReadable” is not readable");
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
@ -926,7 +926,7 @@ test_dispatch_thread_func (gpointer user_data)
|
|||||||
&error);
|
&error);
|
||||||
g_assert (value == NULL);
|
g_assert (value == NULL);
|
||||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS);
|
||||||
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Property 'NotWritable' is not writable");
|
g_assert_cmpstr (error->message, ==, "GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Property “NotWritable” is not writable");
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
|
@ -64,6 +64,14 @@ gio_tests = [
|
|||||||
'glistmodel',
|
'glistmodel',
|
||||||
'testfilemonitor',
|
'testfilemonitor',
|
||||||
'thumbnail-verification',
|
'thumbnail-verification',
|
||||||
|
'tls-certificate',
|
||||||
|
'tls-interaction',
|
||||||
|
]
|
||||||
|
slow_tests = [
|
||||||
|
'actions',
|
||||||
|
'gdbus-export',
|
||||||
|
'gdbus-threading',
|
||||||
|
'testfilemonitor',
|
||||||
]
|
]
|
||||||
|
|
||||||
test_extra_programs = [
|
test_extra_programs = [
|
||||||
@ -197,7 +205,7 @@ if host_machine.system() != 'windows'
|
|||||||
]
|
]
|
||||||
|
|
||||||
if not glib_have_cocoa
|
if not glib_have_cocoa
|
||||||
gio_dbus_tests = [['dbus-appinfo', [], []]]
|
gio_dbus_tests += [['dbus-appinfo', [], []]]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# separate loop because extra source files for each test
|
# separate loop because extra source files for each test
|
||||||
@ -210,7 +218,12 @@ if host_machine.system() != 'windows'
|
|||||||
install : false,
|
install : false,
|
||||||
c_args : test_c_args,
|
c_args : test_c_args,
|
||||||
dependencies : common_gio_tests_deps + extra_deps)
|
dependencies : common_gio_tests_deps + extra_deps)
|
||||||
|
# These tests may take more than 30 seconds to run on the CI infrastructure
|
||||||
|
if slow_tests.contains(test_name)
|
||||||
|
test(test_name, exe, env : test_env, timeout : 120, suite : ['gio', 'slow'])
|
||||||
|
else
|
||||||
test(test_name, exe, env : test_env, suite : ['gio'])
|
test(test_name, exe, env : test_env, suite : ['gio'])
|
||||||
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
exe = executable('gdbus-test-codegen-old', 'gdbus-test-codegen.c',
|
exe = executable('gdbus-test-codegen-old', 'gdbus-test-codegen.c',
|
||||||
@ -293,13 +306,16 @@ foreach test_name : gio_tests
|
|||||||
# This is peer to peer so it doesn't need a session bus, so we can run
|
# This is peer to peer so it doesn't need a session bus, so we can run
|
||||||
# it automatically as a test by default
|
# it automatically as a test by default
|
||||||
extra_deps = [libgdbus_example_objectmanager_dep]
|
extra_deps = [libgdbus_example_objectmanager_dep]
|
||||||
|
elif test_name == 'tls-certificate' or test_name == 'tls-interaction'
|
||||||
|
srcs += ['gtesttlsbackend.c']
|
||||||
endif
|
endif
|
||||||
exe = executable(test_name, srcs,
|
exe = executable(test_name, srcs,
|
||||||
install : false,
|
install : false,
|
||||||
c_args : test_c_args,
|
c_args : test_c_args,
|
||||||
dependencies : common_gio_tests_deps + extra_deps)
|
dependencies : common_gio_tests_deps + extra_deps)
|
||||||
if test_name == 'testfilemonitor'
|
# These tests may take more than 30 seconds to run on the CI infrastructure
|
||||||
test(test_name, exe, env : test_env, timeout : 45, suite : ['gio', 'slow'])
|
if slow_tests.contains(test_name)
|
||||||
|
test(test_name, exe, env : test_env, timeout : 120, suite : ['gio', 'slow'])
|
||||||
else
|
else
|
||||||
test(test_name, exe, env : test_env, suite : ['gio'])
|
test(test_name, exe, env : test_env, suite : ['gio'])
|
||||||
endif
|
endif
|
||||||
@ -332,8 +348,6 @@ uninstalled_test_extra_programs = [
|
|||||||
['send-data'],
|
['send-data'],
|
||||||
['socket-server'],
|
['socket-server'],
|
||||||
['socket-client', ['gtlsconsoleinteraction.c']],
|
['socket-client', ['gtlsconsoleinteraction.c']],
|
||||||
['tls-certificate', ['gtesttlsbackend.c']],
|
|
||||||
['tls-interaction', ['gtesttlsbackend.c']],
|
|
||||||
# These three are manual-run tests because they need a session bus but don't bring one up themselves
|
# These three are manual-run tests because they need a session bus but don't bring one up themselves
|
||||||
# FIXME: these build but don't seem to work!
|
# FIXME: these build but don't seem to work!
|
||||||
['gdbus-example-objectmanager-client', [], [libgdbus_example_objectmanager_dep]],
|
['gdbus-example-objectmanager-client', [], [libgdbus_example_objectmanager_dep]],
|
||||||
|
@ -18,6 +18,7 @@ glib_tests = [
|
|||||||
'error',
|
'error',
|
||||||
'fileutils',
|
'fileutils',
|
||||||
'gdatetime',
|
'gdatetime',
|
||||||
|
'guuid',
|
||||||
'gvariant',
|
'gvariant',
|
||||||
'hash',
|
'hash',
|
||||||
'hmac',
|
'hmac',
|
||||||
|
@ -3,7 +3,7 @@ refcount_tests = [
|
|||||||
['objects', 'objects.c', []],
|
['objects', 'objects.c', []],
|
||||||
['objects2', 'objects2.c', [], 90],
|
['objects2', 'objects2.c', [], 90],
|
||||||
['properties', 'properties.c', []],
|
['properties', 'properties.c', []],
|
||||||
['properties2', 'properties2.c', []],
|
['properties2', 'properties2.c', [], 90],
|
||||||
['properties3', 'properties3.c', [], 90], # extra long timeout
|
['properties3', 'properties3.c', [], 90], # extra long timeout
|
||||||
['properties4', 'properties4.c', []],
|
['properties4', 'properties4.c', []],
|
||||||
['signal1', 'signals.c', ['-DTESTNUM=1']],
|
['signal1', 'signals.c', ['-DTESTNUM=1']],
|
||||||
|
Loading…
Reference in New Issue
Block a user