PDLPorters / PDL-Graphics-Gnuplot

Gnuplot-based plotting backend for PDL
https://p3rl.org/PDL::Graphics::Gnuplot
Other
8 stars 7 forks source link

Tests (and functionality?) fail when Gnuplot has "unknown" default terminal #66

Closed akhuettel closed 7 months ago

akhuettel commented 7 years ago

Depending on the Gnuplot compilation options, differents sets of terminals are available. When (on Linux) either X or Qt4 terminals are enabled, one of these automatically becomes default terminal after program start. This can be verified with "show terminal", and in this case also PDL::Graphics::Gnuplot works fine.

However, if both X and Qt4 terminal are disabled during compilation, the default terminal after gnuplot start is "unknown", meaning it's not functional (and a terminal has to be selected first). This makes the PDL::Graphics::Gnuplot tests fail:

make -j3 test TEST_VERBOSE=0
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/manifest.t .. skipped: Author tests not required for installation
t/plot.t ...... 1/185
#   Failed test 'Constructor created a plotting object'
#   at t/plot.t line 23.
#
# P::G::G v2.011, gnuplot v5.0, Perl v5.026000, /usr/bin/perl on linux #

#   Failed test 'basic plotting succeeded without error'
#   at t/plot.t line 41.
# plot() died with 'PDL::Graphics::Gnuplot: Your gnuplot has terminal 'unknown' but it is not supported.
#         unknown: Unknown term (gnuplot final default)   [NS: not a terminal]
#
# You can use the 'terminfo' method for a list of available terminals.
#
#  at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 2312.
#       PDL::Graphics::Gnuplot::output(undef) called at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 2165
#       PDL::Graphics::Gnuplot::new("PDL::Graphics::Gnuplot") called at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 7934
#       PDL::Graphics::Gnuplot::_obj_or_global(ARRAY(0x32f6e50)) called at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 2600
#       PDL::Graphics::Gnuplot::plot(HASH(0x3414fc0), PDL=SCALAR(0x3508a80)) called at t/plot.t line 38
#       eval {...} called at t/plot.t line 38
# '

#   Failed test 'basic plotting created a reasonably-sized file'
#   at t/plot.t line 49.
# resulting output file should be ascii 79x24, but only contains 0 bytes
PDL::Graphics::Gnuplot: Your gnuplot has terminal 'unknown' but it is not supported.
        unknown: Unknown term (gnuplot final default)   [NS: not a terminal]

You can use the 'terminfo' method for a list of available terminals.

 at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 2312.
        PDL::Graphics::Gnuplot::output(undef) called at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 2165
        PDL::Graphics::Gnuplot::new("PDL::Graphics::Gnuplot") called at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 7934
        PDL::Graphics::Gnuplot::_obj_or_global(ARRAY(0x329c308)) called at /var/tmp/portage/dev-perl/PDL-Graphics-Gnuplot-2.11.0/work/PDL-Graphics-Gnuplot-2.011/blib/lib/PDL/Graphics/Gnuplot.pm line 2433
        PDL::Graphics::Gnuplot::restart() called at t/plot.t line 52
# Looks like you planned 185 tests but ran 7.
# Looks like you failed 3 tests of 7 run.
t/plot.t ...... Dubious, test returned 3 (wstat 768, 0x300)
Failed 181/185 subtests

Test Summary Report
-------------------
t/plot.t    (Wstat: 768 Tests: 7 Failed: 3)
  Failed tests:  3, 5, 7
  Non-zero exit status: 3
  Parse errors: Bad plan.  You planned 185 tests but ran 7.

See also https://bugs.gentoo.org/show_bug.cgi?id=622586

mohawk2 commented 7 months ago

Much later: thank you for the report! The next version will use dumb if probing shows unknown.