dk / Prima

prima.eu.org
Other
106 stars 27 forks source link

t test failing on minor value difference #118

Closed PhilterPaper closed 1 month ago

PhilterPaper commented 1 month ago

Previously I had opened https://rt.cpan.org/Public/Bug/Display.html?id=149672 reporting some problems with missing libraries and a couple of failed t tests. You suggested 'forcing' the install, which I'm reluctant to do (on general principles). I would suggest looking at why there's a minor difference:

t/Object/Region.t ...... ok
t/Object/Shaping.t ..... 40/?
#   Failed test 'glyphs plotting'
#   at t/Object/Shaping.t line 16.
#          got: '29482'
#     expected: '29441'
# font: [Noto Sans JP Medium]

#   Failed test 'glyphs plotting, terse version'
#   at t/Object/Shaping.t line 16.
#          got: '29482'
#     expected: '29441'
# font: [Noto Sans JP Medium]
t/Object/Shaping.t ..... 57/? # Looks like you failed 2 tests of 67.
t/Object/Shaping.t ..... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/67 subtests
t/Object/TextWrap.t .... ok

That's all that's standing between me and a Prima installation that works without doing manual interventions (not going into forced installs and other questionable actions).

Something I have experienced with some of my Perl packages (PDF::Table and Text::KnuthPlass) is that a number of test platforms (for CPANTS) have different Perl extended precision math packages installed. This leads to "raw" unformatted internal floating point numbers being slightly different 15 or more decimal digits out, from what I get on a bog-standard Perl. I solved this problem by rounding down offending floating point numbers (in the t-test itself) to 6 decimal digits (significant digits), which should match up on any reasonable system (I presume even on a System/390).

I don't know the internals of Prima, or if floating point is involved in deriving these numbers, but you might consider whether rounding to fewer digits at some point in the t-test would product matching results. Granted, a mismatch at the fourth significant digit is a lot worse than at the 20th, but it all depends on whether there's some intermediate floating point numbers that perhaps you're not handling well. Do you have any Perl extended precision math packages in use on your development platform?

The missing libthai and libheif (on Windows, Strawberry Perl 5.32) I'm not going to worry about for the time being. I don't see any mention of 'fribidi' in the build, so either you're no longer using it, or it's hidden somewhere.

dk commented 1 month ago

Hi Phil,

The missing libraries can be downloaded from http://prima.eu.org/download/, I built these myself. I'm not 100% sure they would mix well with 5.32-sb, they very much might, but I can guarantee they are working on 5.38-sb

/dk