I have managed to reproduce the problem (Perl 5.26.2, fedora linux) when I omitted ./ from INC dir - as Test::Classifier requires t::TestMods::Test::Processor :

prove -Iblib/lib -It/TestMods t/01-file-collector.t
t/01-file-collector.t .. # Running my tests t/01-file-collector.t .. 1/13 # Failed test 'creates an object' # at t/01-file-collector.t line 30. # died: Test::Classifier is not a Role::Tiny at /home/andreas/Download +s/File-Collector-0.037/blib/lib/File/Collector.pm line 391. # Failed test 'has files property' # at t/01-file-collector.t line 34. # Failed test 'has common_dir property' # at t/01-file-collector.t line 38. Can't call method "get_count" on unblessed reference at t/01-file-coll +ector.t line 41. # Looks like your test exited with 2 just after 4.

This works fine on my system:

prove -Iblib/lib -It/TestMods -I. t/01-file-collector.t

Could it be that some of the modules in t/TestMods do not load correctly under certain circumstances?


A comment on your code if I may (File-Collector-0.037 / lib / File / Collector.pm):

# eval class code foreach my $class ( @$classes ) { eval "require $class"; }

Adding a check on eval will tell you if requireed class was not found or failed to load. e.g. from eval, e.g. eval "xyz"; die $@ if $@;

I make this comment because the test fails when constructor sets @classes to contain Test::Classifier. Does this module load OK?

Same goes for AUTOLOAD in said file:

my $obj = $class->new($s->{_files}{all}, \($s->{selected}), $s->{_files}{"${cat}_files"}{_files}); return $obj;

You may want to check whether $obj materialised before returning instead of relying on caller checking if got undef.

bw, bliako


In reply to Re: How do track down underlying reason for smoke test failure by bliako
in thread How do track down underlying reason for smoke test failure by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.