Re: [Module-build-general] RFC: Build test test_dirs=(list)
Status: Beta
Brought to you by:
kwilliams
|
From: David C. <dl...@ha...> - 2003-08-12 21:38:37
|
On Tue, Aug 12, 2003 at 10:03:03PM +0100, Steve Purkis wrote:
> A flag passed to new() would be a good idea, methinks. Perhaps
> 'test_recursive', 'rscan_tests' or 'scan_test_subdirs'?
>
> Speaking of flexibility, a common request I've heard is to be able to
> run a subset of tests. So what about letting the user run test scripts
> that match a regex:
>
> ./Build tests "/.*foo.*/"
> ./Build tests matching=".*foo.*"
Easily running subsets of tests is exactly what prompted me to start this
discussion. With my test_dirs hack to my subclassed builders, I accomplish
this by making stubs off of a directory tree. For example, if I have the following
class heirarchy in my package:
Foo::Bar
Foo::Bar::One
Foo::Bar::One::A
Foo::Bar::One::B
Then tests for Foo::Bar::One::A live in t/Foo/Bar/One/A/t,
tests for private methods of Foo::Bar::One live in t/Foo/Bar/One/t,
and high-level tests for the entire distribution live in t/Foo/Bar.
If I want to test only the methods in the parent class Foo::Bar::One,
I run "Build test test_dirs=t/Foo/Bar/One/t". If I want to run
the tests for that class and all it's children, I run
"Build test test_dirs=t/Foo/Bar/One". If I'm fixing a bug in Foo::Bar::One::B,
I run "Build test test_dirs=t/Foo/Bar/One/B/t" over and over, and then when I'm
satisfied I run a full regression test with "Build test".
|