This question is related to this question I asked before. I have multiple test files (A.t, B.t, C.t etc) created to test their respective module A, B, C & so on. But when I do a make test, it runs all the tests. But, when I’m working on a specific module say B, I’d like to run unit tests for that module. After I’m done with my changes, I’ll run the whole suite.
So is there any way to do like make test B, which will run only the tests using B.t? And when I say some thing like “make test all” it runs all the tests under the “t” dir? Thanks.
I just run the test that I want to run:
You can do the same thing with
prove, too.That
-Mblibloads the module blib which merely adds blib/lib (and various special directories under it) to@INCfor you. It comes with Perl.proveshould do the same thing with the-bswitch.My command is really two parts: the
make(or./Buildfor Module::Build). This builds the source and moves Perl modules and other files into the "build library", or blib, as an intermediate step in the full installation. Normallymake testworks against the versions in blib and refreshes that for me. Since I’m testing on my own, I ensure that I refresh blib myself and include it in Perl’s module search path.Despite the fact that I know all this, you might be surprised that I often forget to do one of those steps and end up testing against the wrong version of things, whether the fully installed old version (forgot
-Mblib) or the old development sources (forgotmake). This leads me to debugging statements such as: