2009-08-07

shipping compile tests with dist-zilla

perl community places some emphasis on testing. which is great, since it enhances the overall quality of perl ecosystem.

the first, easiest test that one should provide is basic: making sure the modules compile. we have 2 options here:
  • either create a test and add some use_ok('Foo::Bar'). but we then need to update it whenever we add more modules to our distribution - without forgetting to update test count.
  • or, to get rid of this burden, ship a test that automatically finds the module and tries to compile them.
but shipping the exact same generic test is boring, and could be automated. which is now the case for dist::zilla with the new module dist::zilla::plugin::compiletests. just add the following in your dist.ini file:
[CompileTests]
and you will get a brand new t/00-compile.t that will test your modules and your scripts one by one. this my take some time if your dist ships a lot of modules having lots of prereqs, especially if they are a bit slow to compile such as Moose. but this will potentially find more compile errors in your modules.

2 comments:

  1. Hi Jerome,

    Could you have a look at the Mandriva bugzilla bug I've open for padre : a missing dependency which prevents padre from working out-of-the-box.

    Thanks

    ReplyDelete
  2. @yohofr: sure, i just fixed it. however, please use the right channels to ask this: #mandriva-cooker, or mailing-list, or even regular email.

    note that i just changed my bugzilla settings to receive a mail when a bug is assigned to me, which is not the default (wtf?)

    ReplyDelete