From 7ee4f778ed433feab8a07225b6c40d5ac77bfe66 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 12 Mar 2021 07:58:04 -0500 Subject: [PATCH 47/68] gnu: gtk+-2: Enable tests. * gnu/packages/gtk.scm (gtk+-2) [arguments]<#:phases>['disable-tests]: Remove phase. ['disable-failing-tests]: New phase. ['pre-check]: New phase. [native-inputs]: Add xorg-server-for-tests. --- gnu/packages/gtk.scm | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 84d20ecafb..227cdff7f4 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -862,7 +862,8 @@ is part of the GNOME accessibility project.") ("glib" ,glib "bin") ("gobject-introspection" ,gobject-introspection) ("pkg-config" ,pkg-config) - ("python-wrapper" ,python-wrapper))) + ("python-wrapper" ,python-wrapper) + ("xorg-server" ,xorg-server-for-tests))) (arguments `(#:configure-flags (list "--with-xinput=yes" @@ -871,11 +872,26 @@ is part of the GNOME accessibility project.") "/share/gtk-doc/html")) #:phases (modify-phases %standard-phases - (add-before 'configure 'disable-tests + (add-after 'unpack 'disable-failing-tests (lambda _ - ;; FIXME: re-enable tests requiring an X server - (substitute* "gtk/Makefile.in" - (("SUBDIRS = theme-bits . tests") "SUBDIRS = theme-bits .")) + (substitute* "gtk/tests/recentmanager.c" + (("g_test_add_func \\(\"/recent-manager/add-many\", recent_manager_add_many\\);") + "")) + (substitute* "gtk/tests/defaultvalue.c" + (("return g_test_run\\(\\);") + "")) + #t)) + (add-before 'check 'pre-check + (lambda _ + ;; Tests require a running X server. + (system "Xvfb :1 +extension GLX &") + (setenv "DISPLAY" ":1") + ;; Tests write to $HOME. + (setenv "HOME" (getcwd)) + ;; Tests look for $XDG_RUNTIME_DIR. + (setenv "XDG_RUNTIME_DIR" (getcwd)) + ;; For missing '/etc/machine-id'. + (setenv "DBUS_FATAL_WARNINGS" "0") #t)) (add-after 'install 'remove-cache (lambda* (#:key outputs #:allow-other-keys) -- 2.30.1