[patch] Use a temporary directory as $HOME in the Gtk3 test suite



Hi,

the attached patch (that we apply in Debian) fixes a test suite
failure in Gtk3, whenever it is run with a non-existent $HOME, which
is the case on the Debian buildds.

The patch should apply fine with `git am'.

Cheers,
-- 
  intrigeri
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc

From: intrigeri <intrigeri boum org>
Date: Thu, 31 Oct 2013 18:21:11 +0000
Subject: Use a temporary directory as $HOME.

Debian-Bug: http://bugs.debian.org/724103
Forwarded: no
Last-Update: 2013-10-31

Else, t/overrides.t and t/zz-GtkRecentChooserDialog.t fail with:
(overrides.t:5041): Gtk-CRITICAL **: Unable to create user data directory
'/sbuild-nonexistent/.local/share' for storing the recently used files list:
Permission denied
**
Gtk:ERROR:/tmp/buildd/gtk+3.0-3.8.4/./gtk/gtkrecentmanager.c:622:gtk_recent_manager_set_filename:
assertion failed: (priv->filename != NULL)
---
 t/overrides.t                 | 3 +++
 t/zz-GtkRecentChooserDialog.t | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/t/overrides.t b/t/overrides.t
index 02127b8..d013b16 100644
--- a/t/overrides.t
+++ b/t/overrides.t
@@ -7,6 +7,9 @@ use warnings;
 use utf8;
 use Encode;
 
+use File::Temp qw{tempdir};
+$ENV{HOME} = tempdir(CLEANUP => 1);
+
 plan tests => 159;
 
 # Gtk3::CHECK_VERSION and check_version
diff --git a/t/zz-GtkRecentChooserDialog.t b/t/zz-GtkRecentChooserDialog.t
index ec4938a..42d48c6 100644
--- a/t/zz-GtkRecentChooserDialog.t
+++ b/t/zz-GtkRecentChooserDialog.t
@@ -8,6 +8,9 @@ BEGIN { require './t/inc/setup.pl' }
 use strict;
 use warnings;
 
+use File::Temp qw{tempdir};
+$ENV{HOME} = tempdir(CLEANUP => 1);
+
 plan tests => 14;
 
 my $window = Gtk3::Window->new;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]