pileofrogs has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, Monks!
I'm writing up the tests for a module I'm writing, and having noticed that I was writing the same thing over and over in different test files, I factored them out and put them into a .pm file in the t/ directory.
Now I've got error messages with ./Build test that I don't have with prove -I lib t/testname.t.
I'm confidant I can make the error messages go away, so don't worry about that. What I'd really like is a solid grounding in how the environment is different, so any pointers to good docs would be appreciated.
My questions are:
UPDATE: Ah hah! I know why there are warnings under ./Build test and not under prove. While I had 'use warnings' on, I hadn't added the '-w' flag to prove. Running ./Build test runs the tests with the -w flag. Adding the '-w' flag to prove, makes it show the warnings just like ./Build test does. Apparently, I should have put 'use warnings' in a BEGIN block.
Yet Another UPDATE.. Okay, nix on the BEGIN block. Maybe $^W will do what I want...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tests in a module/package?
by gwadej (Chaplain) on Mar 11, 2009 at 20:15 UTC | |
by andreas1234567 (Vicar) on Mar 12, 2009 at 09:53 UTC | |
by doom (Deacon) on Mar 14, 2009 at 18:27 UTC | |
|
Re: Tests in a module/package?
by shmem (Chancellor) on Mar 11, 2009 at 22:11 UTC | |
by pileofrogs (Priest) on Mar 12, 2009 at 00:47 UTC | |
by shmem (Chancellor) on Mar 12, 2009 at 09:43 UTC |