mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
trash test: Don't assume that ~/.local exists
In a minimal autobuilder environment, this test could conceivably be the first thing to refer to ~/.local. Modified by Iain Lane <laney@debian.org>: Don't try to create ~/.local from tests, but skip if it doesn't exist. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
1ddcdbb8ec
commit
56a5cd1337
@ -107,8 +107,19 @@ test_trash_symlinks (void)
|
|||||||
|
|
||||||
g_test_bug ("1522");
|
g_test_bug ("1522");
|
||||||
|
|
||||||
/* The test assumes that ~/.local always exists. */
|
|
||||||
target = g_build_filename (g_get_home_dir (), ".local", NULL);
|
target = g_build_filename (g_get_home_dir (), ".local", NULL);
|
||||||
|
|
||||||
|
if (!g_file_test (target, G_FILE_TEST_IS_DIR))
|
||||||
|
{
|
||||||
|
gchar *message;
|
||||||
|
|
||||||
|
message = g_strdup_printf ("Directory '%s' does not exist", target);
|
||||||
|
g_test_skip (message);
|
||||||
|
g_free (message);
|
||||||
|
g_free (target);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
target_mount = g_unix_mount_for (target, NULL);
|
target_mount = g_unix_mount_for (target, NULL);
|
||||||
g_assert_nonnull (target_mount);
|
g_assert_nonnull (target_mount);
|
||||||
g_test_message ("Target: %s (mount: %s)", target, g_unix_mount_get_mount_path (target_mount));
|
g_test_message ("Target: %s (mount: %s)", target, g_unix_mount_get_mount_path (target_mount));
|
||||||
|
Loading…
Reference in New Issue
Block a user