Re: [Perlunit-users] Testing module validity with test::Unit
Status: Beta
Brought to you by:
mca1001
From: Adam S. <ad...@sp...> - 2003-09-17 12:57:46
|
Dmitry Diskin (dd...@ic...) wrote: > Adam Spiers wrote: > >Dmitry Diskin (dd...@ic...) wrote: > > > >>Hello All! > >> > >>>From the Test::More documentation I learned about use_ok() and > >>require_ok() test functions. They recommend to use them as follows: > >> > >> BEGIN { use_ok('Some::Module') } > >> BEGIN { ...some code that depends on the use... } > >> > >>In the case of failure to 'use' some module test will report it. Is > >>there any way (or need?) to do something similar with Test::Unit? Say, I > >>want to test my class methods, but the whole module is broken. I will > >>get standard perl compile error in that case? > > > > > >It's been a long time since I looked at it, but I think you probably > >should see errors - ISTR working on Test::Unit::Loader to make sure > >the right errors were generated. Have a look at that module, and > >quite simply try it and see what happens! > > Thank you for replying. I'm not sure if I can handle it myself. I looked > to Test::Unit::Loader and did not find any suitable method. Probably it > is not needed to test module loading at all, because if it doesn't load, > no tests can be run on it? That's right. When I said "try it and see", I meant: try running some tests on a module which has (say) syntax errors. Hopefully T::U::Loader will spot the compile failure and your test runner will show it. > BTW, your answer came from ad...@sp... - no sign of mailing list > here. I was thinking that since I wrote to maillist, discussion thread > should be there as well.. Whoops, pressed the wrong button. Am now cc'ing to list. |