From 806472dea969ce1f6955bbfab2ae28d350ecaf27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com>
Date: Tue, 4 Oct 2016 09:24:30 +0200
Subject: Fix qtgui/t/itemviewspuzzle.t test

---
 perl-Qt.spec                                       | 14 ++++----
 ...-QMessageBox-information-in-test-so-test-.patch | 37 ++++++++++++++++++++++
 2 files changed, 45 insertions(+), 6 deletions(-)
 create mode 100644 
perlqt-4.14.3-Monkeypatch-QMessageBox-information-in-test-so-test-.patch

diff --git a/perl-Qt.spec b/perl-Qt.spec
index 283abc7..7f9212e 100644
--- a/perl-Qt.spec
+++ b/perl-Qt.spec
@@ -2,7 +2,7 @@
 
 Name:           perl-Qt
 Version:        4.14.3
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Perl bindings for Qt
 # qtcore/lib/QtCore4.pm:    GPL+ or Artistic
 # other files:              GPLv2+
@@ -20,6 +20,9 @@ URL:            https://techbase.kde.org/Languages/Perl
 Source0:        
http://download.kde.org/stable/%{version}/src/perlqt-%{version}.tar.xz
 # Adjust to GCC 6, bug #1303658, KDE bug #360844, CPAN RT#111630
 Patch1:         perlqt-4.14.3-Initialize-smokeperl_object-properly.patch
+# Fix qtgui/t/itemviewspuzzle.t test, KDE bug #360899,
+# in upstream after 4.14.3
+Patch2:         
perlqt-4.14.3-Monkeypatch-QMessageBox-information-in-test-so-test-.patch
 BuildRequires:  coreutils
 BuildRequires:  cmake
 # gcc for C standard library headers
@@ -86,6 +89,7 @@ Development files for perl-Qt.
 %prep
 %setup -q -n perlqt-%{version}
 %patch1 -p1
+%patch2 -p1
 
 mkdir build
 
@@ -126,11 +130,6 @@ sed -i \
        -e '/perlqt_mainwindowsmdi/d' \
        qtgui/t/CMakeLists.txt
 
-# This test hangs, <https://bugs.kde.org/show_bug.cgi?id=360899>
-sed -i \
-       -e '/perlqt_itemviewspuzzle/d' \
-       qtgui/t/CMakeLists.txt
-
 %ifarch armv7hl ppc64 s390 s390x
 # perlqt_qtcore4_handlers fails on armv7hl
 sed -i \
@@ -175,6 +174,9 @@ export PERL5LIB="$PWD/blib/lib:$PWD/blib/arch"
 %{_datadir}/perlqt
 
 %changelog
+* Tue Oct 04 2016 Petr Pisar <ppi...@redhat.com> - 4.14.3-5
+- Fix qtgui/t/itemviewspuzzle.t test (KDE bug #360899)
+
 * Sun May 15 2016 Jitka Plesnikova <jples...@redhat.com> - 4.14.3-4
 - Perl 5.24 rebuild
 
diff --git 
a/perlqt-4.14.3-Monkeypatch-QMessageBox-information-in-test-so-test-.patch 
b/perlqt-4.14.3-Monkeypatch-QMessageBox-information-in-test-so-test-.patch
new file mode 100644
index 0000000..d7e594c
--- /dev/null
+++ b/perlqt-4.14.3-Monkeypatch-QMessageBox-information-in-test-so-test-.patch
@@ -0,0 +1,37 @@
+From 8f066267118c66e01d45b60ba086510d577fa854 Mon Sep 17 00:00:00 2001
+From: Chris Burel <chrisbu...@gmail.com>
+Date: Mon, 3 Oct 2016 11:17:01 -0700
+Subject: [PATCH] Monkeypatch QMessageBox::information in test, so test does
+ not require user interaction.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Petr Písař <ppi...@redhat.com>
+---
+ qtgui/t/itemviewspuzzle.t | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/qtgui/t/itemviewspuzzle.t b/qtgui/t/itemviewspuzzle.t
+index ea1c07e..0cc359b 100644
+--- a/qtgui/t/itemviewspuzzle.t
++++ b/qtgui/t/itemviewspuzzle.t
+@@ -22,6 +22,15 @@ sub NEW {
+ }
+ 
+ sub solve {
++    local *Qt::MessageBox::information = sub {
++        # Patch QMessageBox::information so that no additional event loop is
++        # started.  The test framework has no good way to intercept this
++        # method, because it will run in its own thread with its own event
++        # loop.
++        my ($parent, $title, $message, $submessage) = @_;
++        QVERIFY($title eq $parent->tr('Puzzle Completed'));
++    };
++
+     my $window = this->{window};
+     my $model = $window->{model};
+     my $view = $window->{piecesList};
+-- 
+2.7.4
+
-- 
cgit v1.1


        
https://src.fedoraproject.org/cgit/perl-Qt.git/commit/?h=epel7&id=806472dea969ce1f6955bbfab2ae28d350ecaf27
_______________________________________________
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