From 6a86bb1b9235dfac0605f704c81fb1e692409496 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 acc4e50..65e81bc 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:        19%{?dist}
@@ -19,6 +21,8 @@ Patch3:         
Qt-0.96.0-Bundle-Devel-Peel-SvREFCNT_inc-removed-from-perl-5.2.p
 Patch4:         
perlqt-4.14.2-Use-a-copy-of-the-Qt-AutoLoad-AUTOLOAD-variable.patch
 # Adjust to GCC 6, bug #1303658, CPAN RT#111630
 Patch5:         Qt-0.96.0-Initialize-smokeperl_object-properly.patch
+# Adjust to smokeqt's QChar, in upstream after 4.8.0
+Patch6:         Qt-0.96.0-Fix-uchar-test.patch
 BuildRequires:  coreutils
 BuildRequires:  cmake
 # gcc for C standard library headers
@@ -58,6 +62,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
@@ -85,12 +94,14 @@ Development files for perl-Qt.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -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' \
@@ -109,6 +120,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
@@ -128,7 +147,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
@@ -145,6 +168,7 @@ make test
 %changelog
 * Tue Mar 22 2016 Petr Pisar <ppi...@redhat.com> - 0.96.0-19
 - Modernize spec file
+- Run X11 tests
 
 * Thu Feb 04 2016 Fedora Release Engineering <rel...@fedoraproject.org> - 
0.96.0-18
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-Qt.git/commit/?h=epel7&id=6a86bb1b9235dfac0605f704c81fb1e692409496
_______________________________________________
perl-devel mailing list -- perl-devel@lists.fedoraproject.org
To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org

Reply via email to