dk / Prima

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

Question on test suite v.s. libthai #67

Closed jddurand closed 1 year ago

jddurand commented 1 year ago

Hello,

After having compiled all the dependencies of Prima on Windows and the cl compiler, in particular libthai version 0.1.29 for which the test suite is successful, Prima test suite fails only thai breaks IMHO:

C:\Users\jddfr\git\Prima>nmake test

Microsoft (R) Program Maintenance Utility Version 14.32.31332.0
Copyright (C) Microsoft Corporation. Tous droits réservés.

        "C:\cl-perl-5.37.6-32bit\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Prima.bs blib\arch\auto\Prima\Prima.bs 644
        "C:\cl-perl-5.37.6-32bit\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib\arch')" t\*\*.t
t\Image\Bar.t ........... ok
t\Image\Basic.t ......... ok
t\Image\Bitmaps.t ....... ok
t\Image\Codec.t ......... ok
t\Image\Colormap.t ...... ok
t\Image\Conversion.t .... ok
t\Image\Extract.t ....... ok
t\Image\FloodFill.t ..... ok
t\Image\Import.t ........ ok
t\Image\Path.t .......... ok
t\Image\ROP.t ........... ok
t\Image\Stream.t ........ ok
t\Image\Stretch.t ....... ok
t\Image\Tile.t .......... ok
t\Image\Transform.t ..... ok
t\misc\cpan.t ........... ok
t\misc\fs.t ............. ok
t\misc\pod.t ............ skipped: Test::Pod 1.00 required for testing POD
t\misc\syntax.t ......... ok
t\Object\Application.t .. ok
t\Object\Array.t ........ ok
t\Object\Clipboard.t .... ok
t\Object\Component.t .... ok
t\Object\File.t ......... ok
t\Object\Fonts.t ........ ok
t\Object\GP.t ........... ok
t\Object\GPExtra.t ...... ok
t\Object\GPState.t ...... ok
t\Object\Object.t ....... ok
t\Object\Polyfont.t ..... ok
t\Object\Region.t ....... ok
t\Object\Shaping.t ...... ok
t\Object\TextWrap.t ..... 1/? libthai error, disabling at t\Object\TextWrap.t line 35.

#   Failed test 'thai breaks: length'
#   at t\Object\TextWrap.t line 46.
#     Structures begin differing at:
#          $got->[0] = '8'
#     $expected->[0] = '6'

#   Failed test 'thai breaks: chunks'
#   at t\Object\TextWrap.t line 48.
#     Structures begin differing at:
#          $got->[1] = '8'
#     $expected->[1] = '6'
# WANTED: 0 6 6 6
# GOT:0 8 8 4

#   Failed test 'thai breaks: text'
#   at t\Object\TextWrap.t line 52.
Wide character in print at C:/cl-perl-5.37.6-32bit/lib/Test2/Formatter/TAP.pm
        line 125 (#1)
    (S utf8) Perl met a wide character (ordinal >255) when it wasn't
    expecting one.  This warning is by default on for I/O (like print).

    If this warning does come from I/O, the easiest
    way to quiet it is simply to add the :utf8 layer, e.g.,
    binmode STDOUT, ':utf8'.  Another way to turn off the warning is
    to add no warnings 'utf8'; but that is often closer to
    cheating.  In general, you are supposed to explicitly mark the
    filehandle with an encoding, see open and "binmode" in perlfunc.

    If the warning comes from other than I/O, this diagnostic probably
    indicates that incorrect results are being obtained.  You should examine
    your code to determine how a wide character is getting to an operation
    that doesn't handle them.

#     Structures begin differing at:
#          $got->[0] = 'สวัสดีชา'
#     $expected->[0] = 'สวัสดี'

#   Failed test 'thai breaks: G(0)'
#   at t\Object\TextWrap.t line 58.
#     Structures begin differing at:
#          $got->[0][6] = '1'
#     $expected->[0][6] = Does not exist
# WANTED:
# 6 glyphs: 1 1 1 1 1 1
# indexes: 0 1 2 3 4 5 : 12
# advances: 10 10 10 10 10 10
# positions: (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)
# GOT:
# 8 glyphs: 1 1 1 1 1 1 1 1
# indexes: 0 1 2 3 4 5 6 7 : 12
# advances: 10 10 10 10 10 10 10 10
# positions: (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)

#   Failed test 'thai breaks: G(1)'
#   at t\Object\TextWrap.t line 58.
#     Structures begin differing at:
#          $got->[0][4] = Does not exist
#     $expected->[0][4] = '1'
# WANTED:
# 6 glyphs: 1 1 1 1 1 1
# indexes: 6 7 8 9 10 11 : 12
# advances: 10 10 10 10 10 10
# positions: (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)
# GOT:
# 4 glyphs: 1 1 1 1
# indexes: 8 9 10 11 : 12
# advances: 10 10 10 10
# positions: (0,0) (0,0) (0,0) (0,0)
# Looks like you failed 5 tests of 9.
t\Object\TextWrap.t ..... Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/9 subtests
t\Object\Timer.t ........ ok
t\Widget\Basic.t ........ ok
t\Widget\Desktop.t ...... ok
t\Widget\Key.t .......... ok
t\Widget\leshed.t ....... ok
t\Widget\Lock.t ......... ok
t\Widget\Map.t .......... ok
t\Widget\Mouse.t ........ ok
t\Widget\Move.t ......... ok
t\Widget\Paint.t ........ ok
t\Widget\Position.t ..... ok
t\Widget\Size.t ......... ok
t\Widget\SizeLimits.t ... ok
t\Widget\Window.t ....... ok
t\Widget\ZOrder.t ....... ok

Test Summary Report
-------------------
t\Object\TextWrap.t   (Wstat: 1280 (exited 5) Tests: 9 Failed: 5)
  Failed tests:  4-6, 8-9
  Non-zero exit status: 5
Files=48, Tests=11110, 37 wallclock secs ( 1.06 usr +  0.14 sys =  1.20 CPU)
Result: FAIL
Uncaught exception from user code:
        Failed 1/48 test programs. 5/11110 subtests failed.
        Test::Harness::runtests("t\\Image\\Bar.t", "t\\Image\\Basic.t", "t\\Image\\Bitmaps.t", "t\\Image\\Codec.t", "t\\Image\\Colormap.t", "t\\Image\\Conversion.t", "t\\Image\\Extract.t", "t\\Image\\FloodFill.t", ...) called at C:/cl-perl-5.37.6-32bit/lib/ExtUtils/Command/MM.pm line 72
        ExtUtils::Command::MM::test_harness(0, "blib\\lib", "blib\\arch") called at -e line 1
NMAKE : fatal error U1077: 'C:\cl-perl-5.37.6-32bit\bin\perl.exe' : code retour '0xff'
Stop.

My question is if you know if libthai is stable concerning the notion of breaks. If yes, I suppose my libthai is wrong (and this is strange since its test suite is ok...), if no then the thai breaks part of Prima test suite should not be compulsory.

jddurand commented 1 year ago

Seems that I have an issue with libthai, where the relocatable thingy patch that I used (c.f. https://github.com/tlwg/libthai/commit/391b612d6916fa34254bdd8f1984cbbe0ac3c14a) fails. Sorry about this issue, I'll come back on it and will keep it updated, regardless that fact that I closed it.

jddurand commented 1 year ago

I confirm this was an installation on my side, I installed the thai dictionnary in the wrong path. So please consider that Prima compiles ok and tests ok on Windows using cl, modulo the problem with the CALLBACK definition mentionned in this comment

dk commented 1 year ago

Yes, I also have an issue with libthai's dll relocation, and also made a issue https://github.com/tlwg/libthai/issues/17 , but that didn't go anywhere so I basically rolled my own libthai.dll, more or less the same way as you did (but never sent a patch, didn't want to step on any toes before a discussion). I references that binary distro in Prima's README if anyone needs it. But I agree the situation is quite shameful for this library, it is a standard implementation of thai breaks on linux, and the author(s) are not responding.