Beginner question (i searched vainly for this basic information) :
What happens if i install a module (make install), and then want to use its uninstalled development version?
Is this when i should use perl -I ? Will @INC react as i wish it will?
Thanks for the tips on tests BrowserUk, really good !
I will do it your way for now. And it's always possible to .t files if i ever want to.
Here are a few reasons why i think it could be worth the try:
- they are not all in the same file, so i don't risk to have variables 'collision' (same variable in two unrelated tests).
- it is easier for someone who installs the module (or even just myself after 6 months) to understand what happens, know in which file to look (and each of them are a lot smaller - no need to search around), and understand what 'ok' means without needing to think about how the testing algorithm works.
- it enables to use Coverage tools. If i understood properly what they do, thanks to them you will be less likely to forget to test any part of your code, which will result in easier maintenance.
Especially when you get this nasty bug in a part of your code that you didn't look at for 6 months
=> there will be a test there to clearly indicate what didn't work and where. You might have forgotten to put this test there if you hadn't use test coverage.
Thus, testing with .t files makes things easy for others and for yourself (in the future), and it doesn't seem to be so much work to set them up : just paste a piece of test code into a .t file and add some ok() statements... and you will have to use 'prove' quite often, which you could automate with an alias every time you run your code.
Well, it is quite some work to create these .t files, and the more you will create, the more you will think of adding ("and what if... ok, let's add a test). Which ends up in more Testing, and thus more time, less efficiency. I guess this is what testing is about : a bit more slowly, but surely. And thus you will gain time in the future.
Do these ideas make any sense?
Having said this, i am starting a project for which i don't have the time to learn and do all of this right now, so i will go with your method. Later i might try and make this project "safer". I should.
Thanks for the advice on how to use PERL5LIB, lib and perl -I, too. It's exactly what i needed to understand =o) Now i'll need to experience it. I guess i'll come back to read your message when i'm doubting about which method is more appropriate.
In reply to Re^4: Developing a module, how do you do it ?
by mascip
in thread Developing a module, how do you do it ?
by mascip
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |