ab5tract / Terminal-Print

Terminal::Print is a pure Raku layer for printing to terminal screens
Other
25 stars 18 forks source link

all examples and tests fail for me #32

Closed ugexe closed 7 years ago

ugexe commented 7 years ago

Read the advent post covering this. Went to see snowfall.p6 in action and it didn't work. Further inspection reveled nothing worked. Is this a problem with my terminal? (I'm just using screen on debian)

perl6 -v

This is Rakudo version 2016.12-49-gb8df3a6 built on MoarVM version 2016.12-16-gf22376d
implementing Perl 6.c.

perl6 -Ilib examples/snowfall.p6

<just a blank screen>

perl6 -Ilib examples/clock.p6

Unhandled exception in code scheduled on thread 3
Cannot invoke this object (REPR: Null; VMNull)
  in sub ansi at /home/nickl/perl6/Terminal-Print/lib/Terminal/Print/Commands.pm6 (Terminal::Print::Commands) line 52
  in method span-string at /home/nickl/perl6/Terminal-Print/lib/Terminal/Print/Grid.pm6 (Terminal::Print::Grid) line 71
  in any call_with_capture at gen/moar/Metamodel.nqp line 3901
  in block  at /home/nickl/.rakudobrew/moar-blead-nom/install/share/perl6/site/sources/D26BE9BE3E2E4446371F551DF52DDF70968D9CA0 (OO::Monitors) line 31
  in any enter at gen/moar/Metamodel.nqp line 3999
  in block  at /home/nickl/perl6/Terminal-Print/lib/Terminal/Print/Grid.pm6 (Terminal::Print::Grid) line 211
  in method print-string at /home/nickl/perl6/Terminal-Print/lib/Terminal/Print/Grid.pm6 (Terminal::Print::Grid) line 206
  in any call_with_capture at gen/moar/Metamodel.nqp line 3901
  in block  at /home/nickl/.rakudobrew/moar-blead-nom/install/share/perl6/site/sources/D26BE9BE3E2E4446371F551DF52DDF70968D9CA0 (OO::Monitors) line 31
  in any enter at gen/moar/Metamodel.nqp line 3999
  in method print-string at /home/nickl/perl6/Terminal-Print/lib/Terminal/Print.pm6 (Terminal::Print) line 230
  in block  at examples/clock.p6 line 32

prove -v -e 'perl6 -Ilib' t/

t/00-basics.t .. 
1..4
ok 1 - Import Terminal::Print
ok 2 - Can create a Terminal::Print object
ok 3 - Can create Terminal::Print object with print-profile 'universal'
ok 4 - Cannot create Terminal::Print object with print-profile 'nonexistent'
ok

    # Failed test 'Can print the current grid'
    # at t/10-grid.t line 27
    # Cannot invoke this object (REPR: Null; VMNull)

    # Failed test 'Can print a screen full of multi colored hearts'
    # at t/10-grid.t line 34
    # Cannot invoke this object (REPR: Null; VMNull)
    # Looks like you failed 2 tests of 3

# Failed test 'Basic screen of hearts can be generated in the expected fashion'
# at t/10-grid.t line 20
# Looks like you failed 1 test of 1
t/10-grid.t .... 
1..1
    ok 1 - Can .change-cell a grid to be full of hearts, one at a time
[?1049h[?25l    not ok 2 - Can print the current grid
[?1049h[?25l    not ok 3 - Can print a screen full of multi colored hearts
    1..3
not ok 1 - Basic screen of hearts can be generated in the expected fashion
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 
t/11-golf.t .... 
1..1
    ok 1 - T is a Terminal::Print object
[?1049h[?25l[?1049l[?25h    ok 2 - Lives through calling the draw sub
    1..2
ok 1 - All the expected golf patterns behave as expected
ok

Test Summary Report
-------------------
t/10-grid.t  (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=3, Tests=6,  2 wallclock secs ( 0.03 usr  0.00 sys +  1.83 cusr  0.21 csys =  2.07 CPU)
Result: FAIL
japhb commented 7 years ago

This is a bug in precompilation that affects OO-Monitors. You will need to clone OO-Monitors locally, add no precompilation; at the top of lib/OO/Monitors.pm6, and then zef --force install . or panda --force install . to install the fix. Unfortunately this means anything using OO-Monitors (including Terminal-Print) will load very slowly, but on the plus side they will work.

japhb commented 7 years ago

ugexe, does this fix it for you?

ugexe commented 7 years ago

Yes that works, thanks. You can simplify all of that for others with the following install instructions:

# Only needed if you already have OO::Monitors installed
$ zef uninstall "OO::Monitors:ver<1.1>"

# Installs OO::Monitors:ver<1.0> and Terminal::Print
$ zef install https://github.com/jnthn/oo-monitors/archive/3e9975f.tar.gz Terminal::Print
japhb commented 7 years ago

Oooh, shiny. Thanks, ugexe!

japhb commented 7 years ago

I believe the most recent push includes workarounds for precomp problems; this should be fixed now.