Le mercredi 04 avril 2007 à 13:58, Andy Armstrong écrivait: > > If you're running more than one test script with runtests / prove > you'll presumably be sending the same arguments to all of them. So it > might make sense to think about a standard(ish) vocabulary for args - > so that: > > runtests t/*.t --select regression,docs > > Would select only regression and documentation tests. That's just an > example plucked out of the ether of course - it wouldn't /have/ to > work like that.
Our tests live in a different directory that the code. The tree is the same as the code tree, but we have one more directory level: a directory for each .pm file, that contains the tests scripts for that file. So what the wrapper does is 1) find where the test directory is, based on cwd 2) find which tests you want to run based on the parameters and cwd 3) run prove on them A short example (assume my wrapper is named 'wprove'), assuming the source live in ~/src and the tests in ~/test: # cwd = ~/src/lib/Foo $ ls Bar.pm Baz.pm # run prove -r ~/test/lib/Foo/Bar.pm/ $ wprove Bar # run prove -r ~/test/lib/Foo/Baz.pm/ $ wprove Baz # run prove -r ~/test/lib/Foo/ (both commands work) $ wprove Foo $ wprove # run prove -r ~/test/pod # the test scripts in ~/test/pod look for pod files under cwd $ wprove pod But I'd like to be able to test the pod only for Bar.pm, like this: # run prove -r ~/test/pod -- Bar.pm $ wprove pod -- Bar.pm That is, assuming that the usual double dash (--) lets prove distinguish targets from parameters. And that all the scripts in test/pod know what to do with a list of files in @ARGV. The prove usage line would be: prove [options] [targets] [ -- args] And the args would be passed to each and every test script run by prove. > More generally you might want to investigate TAP::Parser|Harness for > your 'wrapper around prove' work. I skipped reading perl-qa for a few months, and I'm confused, now. I found out that TAPx::Parser was renamed TAP::Parser, but the TAP-Parser distribution contains a prove utility, which looks like the one included in Test::Harness. Is everything the same, or just slightly different in confusing ways? -- Philippe "BooK" Bruhat When you run from your problem, you make it that much harder for good fortune to catch you, as well. (Moral from Groo The Wanderer #14 (Epic))