From 68d13ae8c793a263dc331a6324e5b7c361e21448 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Tue, 22 Mar 2016 12:42:48 +0100
Subject: Run X11 tests

---
 Qt-0.96.0-Fix-uchar-test.patch | 37 +++++++++++++++++++++++++++++++++++++
 perl-Qt.spec                   | 26 +++++++++++++++++++++++++-
 2 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100644 Qt-0.96.0-Fix-uchar-test.patch

diff --git a/Qt-0.96.0-Fix-uchar-test.patch b/Qt-0.96.0-Fix-uchar-test.patch
new file mode 100644
index 0000000..0857b9c
--- /dev/null
+++ b/Qt-0.96.0-Fix-uchar-test.patch
@@ -0,0 +1,37 @@
+From 5c1433a05cea92e3b1f73afdb488543299eadcf1 Mon Sep 17 00:00:00 2001
+From: Chris Burel <cbu...@rhythm.com>
+Date: Sun, 12 Feb 2012 15:59:01 -0800
+Subject: [PATCH] Fix uchar test.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It seems the smoke libs no longer recognize the QChar( uchar ) method.  So use 
the QChar( uchar, uchar ) instead.
+
+Petr Písař: Ported to 0.96.0:
+
+commit 2b2e2d106abff67a55abd0dc38268f74f98d64da
+Author: Chris Burel <cbu...@rhythm.com>
+Date:   Sun Feb 12 15:59:01 2012 -0800
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ qtcore/t/f_handlers.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/qtcore/t/f_handlers.t b/qtcore/t/f_handlers.t
+index ca95423..53b7d63 100644
+--- a/qtcore/t/f_handlers.t
++++ b/qtcore/t/f_handlers.t
+@@ -93,7 +93,7 @@ my $app = Qt::Application( \@ARGV );
+     # Test char and uchar marshalling
+     my $char = Qt::Char( Qt::Int(87) );
+     is ( $char->toAscii(), 87, 'signed char' );
+-    $char = Qt::Char( Qt::Uchar('f') );
++    $char = Qt::Char( Qt::Uchar('f'), Qt::Uchar("\0") );
+     is ( $char->toAscii(), ord('f'), 'unsigned char' );
+     $char = Qt::Char( 'f', 3 );
+     is ( $char->row(), 3, 'unsigned char' );
+-- 
+2.5.5
+
diff --git a/perl-Qt.spec b/perl-Qt.spec
index 67ca44d..d5b02e1 100644
--- a/perl-Qt.spec
+++ b/perl-Qt.spec
@@ -1,3 +1,5 @@
+%global use_x11_tests 1
+
 Name:           perl-Qt
 Version:        0.96.0
 Release:        17%{?dist}
@@ -17,6 +19,8 @@ Patch3:         
Qt-0.96.0-Bundle-Devel-Peel-SvREFCNT_inc-removed-from-perl-5.2.p
 # Adjust to perl-5.20.0, bug #1136340, CPAN RT#98790, in new upstream
 # <git://anongit.kde.org/perlqt>
 Patch4:         
perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch
+# Adjust to smokeqt's QChar, in upstream after 4.8.0
+Patch5:         Qt-0.96.0-Fix-uchar-test.patch
 BuildRequires:  coreutils
 BuildRequires:  cmake
 # gcc for C standard library headers
@@ -56,6 +60,11 @@ BuildRequires:  perl(Devel::Peek)
 BuildRequires:  perl(lib)
 BuildRequires:  perl(Test::More)
 BuildRequires:  perl(utf8)
+%if %{use_x11_tests}
+# X11 tests:
+BuildRequires:  xorg-x11-server-Xvfb
+BuildRequires:  font(:lang=en)
+%endif
 Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
 
 %?perl_default_filter
@@ -82,12 +91,14 @@ Development files for perl-Qt.
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 mkdir build
 
 # fix smoke qwt detection
 sed -i -e 's/SMOKE_Qwt5_Qt4_FOUND/SMOKE_QWT_FOUND/' CMakeLists.txt
 
+%if !%{use_x11_tests}
 # these tests require running X server
 sed -i -e '/perlqt_qtcore4_qapp/d' \
        -e '/perlqt_qtcore4_sigslot/d' \
@@ -106,6 +117,14 @@ sed -i -e '/perlqt_itemviewspixelator/d' \
        -e '/perlqt_sqlquerymodel/d' \
        -e '/perlqt_widgetscalculator/d' \
        -e '/perlqt_xmlstreambookmarks/d' qtgui/t/CMakeLists.txt
+%endif
+
+# These tests fail even in latest upstream code,
+# <https://bugs.kde.org/show_bug.cgi?id=360846>
+sed -i \
+       -e '/perlqt_helpcontextsensitivehelp/d' \
+       -e '/perlqt_mainwindowsmdi/d' \
+       qtgui/t/CMakeLists.txt
 
 %build
 cd build
@@ -125,7 +144,11 @@ make install DESTDIR=%{buildroot}
 %check
 cd build
 export PERL5LIB="$PWD/blib/lib:$PWD/blib/arch"
-make test
+%if %{use_x11_tests}
+    xvfb-run -a make test
+%else
+    make test
+%endif
 
 %files
 %license LICENSE
@@ -143,6 +166,7 @@ make test
 * Wed Mar 23 2016 Petr Pisar <ppi...@redhat.com> - 0.96.0-17
 - Specify more dependencies
 - Modernize spec file
+- Run X11 tests
 
 * Thu Jun 18 2015 Fedora Release Engineering <rel-...@lists.fedoraproject.org> 
- 0.96.0-16
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
-- 
cgit v0.12


        
http://pkgs.fedoraproject.org/cgit/perl-Qt.git/commit/?h=f23&id=68d13ae8c793a263dc331a6324e5b7c361e21448
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/perl-devel@lists.fedoraproject.org

Reply via email to