The common mantra is:

perl Makefile.PL make make test make install

The first line, perl Makefile.PL invokes a tool in ExtUtils::MakeMaker that creates a Makefile. The next step, make then builds the distribution according to the rules set forth in the makefile. It will be built into ./blib/ for now.

The next line, make test runs the test target in Makefile, which runs the suite against the version of the module built into blib. Later you would run make install, which runs a target in the Makefile that copies the contents of blib/ into the appropriate final destination -- where your Perl modules live.

The reason for blib/'s existence, and why you typically wouldn't test against the lib/ that ships with the distribution is that Makefile.PL, and more appropriately, the make step can and often do all sorts of work to build the module. Whatever lives in lib/ should be considered just part of the template for the final blib/ version. For example, if the module contained XS or C code, that code couldn't possibly be useful prior to the make phase, where it gets compiled. Once compiled, the resulting components will also go somewhere under blib/. make is pretty powerful. And ExtUtils::MakeMaker exposes much of that power. Another example is that the module itself could be entirely written by the make phase. make could even invoke a Perl script that produces output that becomes the module. This is the build process, and the result of the build goes into blib/.

So as I mentioned, make test runs the tests against the module that lives in blib/. On the other hand, prove runs the tests against lib/ unless directed otherwise prove -l runs the tests against ./lib, and prove without library-influencing flags runs the tests using standard @INC semantics. prove -b runs the tests against the version that was built into blib/.

So when you run make, you are running against different code than when you run prove. To run against the same code, use prove -b.


Dave


In reply to Re: "make test" catches a C undefined symbol, but "prove" doesn't by davido
in thread "make test" catches a C undefined symbol, but "prove" doesn't by stevieb

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.