Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 98831
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 804.032
Fixed in: 804.032_500



Subject: 335 t/entry.t test fails
I cloned the git repository and I run tests with perl 5.20 on Linux. All pass except test number 335 from t/entry.t: # Failed test at t/entry.t line 1236. # got: '0' # expected: '1' # Looks like you failed 1 test of 351. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/351 subtests (less 37 skipped subtests: 313 okay) Test Summary Report ------------------- t/entry.t (Wstat: 256 Tests: 351 Failed: 1) Failed test: 335 Non-zero exit status: 1 I tried that against Xfvb locally and fluxbox over network. Its the second test from: Tk::catch { $e->destroy }; $e = $mw->Entry(-show => "."); $e->insert(qw(0 XXXYZZY)); $e->pack; $e->update; SKIP: { skip($skip_font_test, 2) if !$do_font_test; is($e->index('@7'), 0); is($e->index('@8'), 1); } Is a certain font needed for the test? I have enabled XFT and very few fonts installed.
Subject: Re: [rt.cpan.org #98831] AutoReply: 335 t/entry.t test fails
Date: Fri, 12 Sep 2014 14:59:30 +0200
To: Bugs in Tk via RT <bug-Tk [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Fri, Sep 12, 2014 at 08:21:02AM -0400, Bugs in Tk via RT wrote: Show quoted text
> I cloned the git repository and I run tests with perl 5.20 on Linux. All > pass except test number 335 from t/entry.t:
[...] Show quoted text
> Is a certain font needed for the test? I have enabled XFT and very few fonts > installed.
It is definitevely. I tried another machine with a lot fonts available and the test passed. I compared the fonts and I found out that the needed font is liberation-sans-fonts. When I installed this font into original machine, the test started to pass. On the other hand when I uninsalled almost all fonts from the original machine, more tests started to fail. It would be great to improve the test to cope with this issue. -- Petr
Download (untitled)
application/pgp-signature 213b

Message body not shown because it is not plain text.

On 2014-09-12 08:59:47, ppisar wrote: Show quoted text
> On Fri, Sep 12, 2014 at 08:21:02AM -0400, Bugs in Tk via RT wrote:
> > I cloned the git repository and I run tests with perl 5.20 on Linux. > > All > > pass except test number 335 from t/entry.t:
> [...]
> > Is a certain font needed for the test? I have enabled XFT and very > > few fonts > > installed.
> > It is definitevely. I tried another machine with a lot fonts available > and the > test passed. I compared the fonts and I found out that the needed font > is > liberation-sans-fonts. When I installed this font into original > machine, the > test started to pass. On the other hand when I uninsalled almost all > fonts > from the original machine, more tests started to fail. > > It would be great to improve the test to cope with this issue. > > -- Petr
Hi Petr, I assume that you're doing XFT=1 builds. In this case, the font check in entry.t used to be skipped. In this case: can you try the attached "dirty" patch and tell me - whether the test passes - what's the data dumper output here Regards, Slaven
Subject: entry-do-font-test.patch
diff --git i/t/entry.t w/t/entry.t index 465a455..bafa29d 100755 --- i/t/entry.t +++ w/t/entry.t @@ -89,8 +89,10 @@ $mw->option("add", "*Entry.font", "Helvetica -12"); my $e = $mw->Entry(qw(-bd 2 -relief sunken))->pack; $mw->update; -if (!$Xft) { # XXX Is this condition necessary? +#if (!$Xft) +{ # XXX Is this condition necessary? my %fa = $mw->fontActual($e->cget(-font)); + $fa{-family} = lc $fa{-family} if $fa{-family}; # normalize my %expected = ( "-weight" => "normal", "-underline" => 0, @@ -105,6 +107,8 @@ if (!$Xft) { # XXX Is this condition necessary? last; } } +require Data::Dumper; diag(Data::Dumper->new([\%fa, \%expected, $do_font_test],[qw()])->Indent(1)->Useqq(1)->Dump); # XXX + } my $i;
Subject: Re: [rt.cpan.org #98831] 335 t/entry.t test fails
Date: Tue, 16 Sep 2014 15:18:13 +0200
To: Slaven_Rezic via RT <bug-Tk [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Mon, Sep 15, 2014 at 04:43:17PM -0400, Slaven_Rezic via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=98831 > > I assume that you're doing XFT=1 builds. In this case, the font check in entry.t used to be skipped. >
Yes, the XFT is enabled. Show quoted text
> In this case: can you try the attached "dirty" patch and tell me > - whether the test passes
No. Show quoted text
> - what's the data dumper output here >
I cannot reproduce the single failing test #335 from. Now test #297 fails. If I apply the patch and I have the liberation-sans-fonts installed, tests pass and the Dumper output is: # $VAR1 = { # "-size" => -12, # "-overstrike" => 0, # "-weight" => "normal", # "-slant" => "roman", # "-family" => "liberation sans", # "-underline" => 0 # }; # $VAR2 = { # "-size" => -12, # "-overstrike" => 0, # "-slant" => "roman", # "-weight" => "normal", # "-family" => "helvetica", # "-underline" => 0 # }; # $VAR3 = 0; If I apply the patch and remove the fonts, the Dumper output is: # $VAR1 = { # "-family" => "gothic", # "-slant" => "roman", # "-underline" => 0, # "-size" => -12, # "-weight" => "normal", # "-overstrike" => 0 # }; # $VAR2 = { # "-underline" => 0, # "-size" => -12, # "-weight" => "normal", # "-overstrike" => 0, # "-family" => "helvetica", # "-slant" => "roman" # }; # $VAR3 = 0; and test failure is: # Failed test at t/entry.t line 1077. # '22' # >= # '23' # Looks like you failed 1 test of 351. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/351 subtests (less 39 skipped subtests: 311 okay) Test Summary Report ------------------- t/entry.t (Wstat: 256 Tests: 351 Failed: 1) Failed test: 297 This is the code with all saying comment: $x = "abcde"; $y = "ab"; $e->configure(-textvariable => \$x); $e->update; $e->configure(-textvariable => \$y); $e->update; is($e->get, "ab"); # On Unix/X11 and Windows it's 24, on cygwin/X11 with Xvfb running it's 25, # on Mac OS X with XFT=1 and a remote Xserver it's 23: cmp_ok($e->reqwidth, ">=", 23); cmp_ok($e->reqwidth, "<=", 25); Just for your information, I use Xvfb. -- Petr
Download (untitled)
application/pgp-signature 213b

Message body not shown because it is not plain text.

On 2014-09-16 09:18:30, ppisar wrote: Show quoted text
> On Mon, Sep 15, 2014 at 04:43:17PM -0400, Slaven_Rezic via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=98831 > > > I assume that you're doing XFT=1 builds. In this case, the font check > > in entry.t used to be skipped. > >
> Yes, the XFT is enabled. >
> > In this case: can you try the attached "dirty" patch and tell me > > - whether the test passes
> > No. >
> > - what's the data dumper output here > >
> I cannot reproduce the single failing test #335 from. Now test #297 > fails. > > If I apply the patch and I have the liberation-sans-fonts installed, > tests > pass and the Dumper output is: > > # $VAR1 = { > # "-size" => -12, > # "-overstrike" => 0, > # "-weight" => "normal", > # "-slant" => "roman", > # "-family" => "liberation sans", > # "-underline" => 0 > # }; > # $VAR2 = { > # "-size" => -12, > # "-overstrike" => 0, > # "-slant" => "roman", > # "-weight" => "normal", > # "-family" => "helvetica", > # "-underline" => 0 > # }; > # $VAR3 = 0; > > If I apply the patch and remove the fonts, the Dumper output is: > > # $VAR1 = { > # "-family" => "gothic", > # "-slant" => "roman", > # "-underline" => 0, > # "-size" => -12, > # "-weight" => "normal", > # "-overstrike" => 0 > # }; > # $VAR2 = { > # "-underline" => 0, > # "-size" => -12, > # "-weight" => "normal", > # "-overstrike" => 0, > # "-family" => "helvetica", > # "-slant" => "roman" > # }; > # $VAR3 = 0; > > and test failure is: > > # Failed test at t/entry.t line 1077. > # '22' > # >= > # '23' > # Looks like you failed 1 test of 351. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/351 subtests > (less 39 skipped subtests: 311 okay) > > Test Summary Report > ------------------- > t/entry.t (Wstat: 256 Tests: 351 Failed: 1) > Failed test: 297 > > This is the code with all saying comment: > > $x = "abcde"; > $y = "ab"; > $e->configure(-textvariable => \$x); > $e->update; > $e->configure(-textvariable => \$y); > $e->update; > is($e->get, "ab"); > # On Unix/X11 and Windows it's 24, on cygwin/X11 with Xvfb running > it's 25, > # on Mac OS X with XFT=1 and a remote Xserver it's 23: > cmp_ok($e->reqwidth, ">=", 23); > cmp_ok($e->reqwidth, "<=", 25); > > Just for your information, I use Xvfb. >
Can you check if commit 39ce3fa564b0843a00553f5444b2110ed5e9701e fixes these problems?
Subject: Re: [rt.cpan.org #98831] 335 t/entry.t test fails
Date: Fri, 10 Oct 2014 09:27:58 +0200
To: Slaven_Rezic via RT <bug-Tk [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Sat, Sep 20, 2014 at 04:07:46PM -0400, Slaven_Rezic via RT wrote: Show quoted text
> Can you check if commit 39ce3fa564b0843a00553f5444b2110ed5e9701e fixes these > problems? >
Yes, it makes the t/entry.t test passing even without installed liberation-sans-fonts. However that's naturally only because you tuned the value for my size. I think more portable way would be to let render the text by a freetype into a bitmap and then compare the sizes. -- Petr
Download (untitled)
application/pgp-signature 213b

Message body not shown because it is not plain text.

On 2014-10-10 03:28:14, ppisar wrote: Show quoted text
> On Sat, Sep 20, 2014 at 04:07:46PM -0400, Slaven_Rezic via RT wrote:
> > Can you check if commit 39ce3fa564b0843a00553f5444b2110ed5e9701e > > fixes these > > problems? > >
> Yes, it makes the t/entry.t test passing even without installed > liberation-sans-fonts. However that's naturally only because you tuned > the > value for my size. I think more portable way would be to let render > the text > by a freetype into a bitmap and then compare the sizes.
Do you have a suggestion how to do this? Unless there's a hidden gem, it's not possible to do this with Perl/Tk and without the use of additional tools...
Subject: Re: [rt.cpan.org #98831] 335 t/entry.t test fails
Date: Tue, 18 Nov 2014 14:21:04 +0100
To: Slaven_Rezic via RT <bug-Tk [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Mon, Nov 17, 2014 at 04:32:55PM -0500, Slaven_Rezic via RT wrote: Show quoted text
> On 2014-10-10 03:28:14, ppisar wrote:
> > Yes, it makes the t/entry.t test passing even without installed > > liberation-sans-fonts. However that's naturally only because you tuned > > the > > value for my size. I think more portable way would be to let render > > the text > > by a freetype into a bitmap and then compare the sizes.
> > Do you have a suggestion how to do this? Unless there's a hidden gem, it's > not possible to do this with Perl/Tk and without the use of additional > tools... >
I recall a tool which came with freetype library which did that. Something like pango-view for Pango library. But I cannot find it. Maybe it has gone. <http://www.freetype.org/developer.html#bug-report> mentions "ftview" and "ftstring". -- Petr
Download (untitled)
application/pgp-signature 213b

Message body not shown because it is not plain text.

On 2014-11-18 08:21:17, ppisar wrote: Show quoted text
> On Mon, Nov 17, 2014 at 04:32:55PM -0500, Slaven_Rezic via RT wrote:
> > On 2014-10-10 03:28:14, ppisar wrote:
> > > Yes, it makes the t/entry.t test passing even without installed > > > liberation-sans-fonts. However that's naturally only because you tuned > > > the > > > value for my size. I think more portable way would be to let render > > > the text > > > by a freetype into a bitmap and then compare the sizes.
> > > > Do you have a suggestion how to do this? Unless there's a hidden gem, it's > > not possible to do this with Perl/Tk and without the use of additional > > tools... > >
> I recall a tool which came with freetype library which did that. Something > like pango-view for Pango library. But I cannot find it. Maybe it has gone. > <http://www.freetype.org/developer.html#bug-report> mentions "ftview" and > "ftstring".
I found these tools in a separate FreeBSD package named ft2demos. Unfortunately both tools render into an X11 window with a fixed geometry and there does not seem to be an option to render the result to a file or so. And it seems that it is quite unlikely that users have these tools installed. Regards, Slaven