[perl-Tk] Enable X11 tests

Petr Pisar ppisar at fedoraproject.org
Fri Sep 12 13:14:57 UTC 2014


commit 4f1ab03e14369d6168a082d55c6fada3178acc10
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Sep 12 15:06:54 2014 +0200

    Enable X11 tests

 perl-Tk.spec |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/perl-Tk.spec b/perl-Tk.spec
index 8fcfd96..8ddfa1c 100644
--- a/perl-Tk.spec
+++ b/perl-Tk.spec
@@ -1,6 +1,8 @@
 %{!?perl_vendorarch: %define perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)}
 %define perlver %(eval "`%{__perl} -V:version`"; echo $version)
 
+%global use_x11_tests 1
+
 Name:           perl-Tk
 # devel version fix for perl 5.14: 
 Version:        804.032
@@ -39,6 +41,14 @@ BuildRequires:  perl(Config)
 BuildRequires:  perl(Cwd)
 BuildRequires:  perl(ExtUtils::MakeMaker)
 BuildRequires:  perl(lib)
+%if %{use_x11_tests}
+# X11 tests:
+BuildRequires:  xorg-x11-server-Xvfb
+BuildRequires:  xorg-x11-xinit
+BuildRequires:  font(:lang=en)
+# Specific font is needed for tests, bug #1141117, CPAN RT#98831
+BuildRequires:  liberation-sans-fonts
+%endif
 
 Requires:       perl(:MODULE_COMPAT_%{perlver})
 Provides:       perl(Tk::LabRadio) = 4.004
@@ -104,9 +114,10 @@ chmod -x pod/Popup.pod Tixish/lib/Tk/balArrow.xbm
 find . -name Makefile | xargs %{__perl} -pi -e 's/^\tLD_RUN_PATH=[^\s]+\s*/\t/'
 make %{?_smp_mflags}
 
-# disable because they need an x screen
 %check
-# make test
+%if %{use_x11_tests}
+    xvfb-run -a make test
+%endif
 
 %install
 make pure_install DESTDIR=$RPM_BUILD_ROOT
@@ -147,6 +158,7 @@ find __demos/ -type f -exec chmod -x {} \;
 * Fri Sep 12 2014 Petr Pisar <ppisar at redhat.com> - 804.032-4
 - Fix freetype detection
 - Fix creating a window with perl 5.20 (bug #1141117)
+- Enable X11 tests
 
 * Tue Aug 26 2014 Jitka Plesnikova <jplesnik at redhat.com> - 804.032-3
 - Perl 5.20 rebuild



More information about the perl-devel mailing list