[RFC] Changes to 'selftest --starting-with'
Russ Brown
pickscrape at gmail.com
Wed Aug 20 19:55:05 BST 2008
John Arbash Meinel wrote:
> I've been using 'bzr selftest -s' a lot lately, and wanted to propose some
> updates. For starters I'd like to say it has been great to use so far. Thanks
> a lot to Vincent for implementing it. TDD is a lot easier when the
> startup+run+teardown time is seconds rather than almost a minute.
>
> There are a few small issues that I'd like to bring up:
>
> 1) Running 2 modules. For some commands I'd like to do something like:
>
> bzr selftest -s bzrlib.tests.test_command \
> -s bzrlib.tests.blackbox.test_command
>
> aka, run both the blackbox tests and the direct tests. At the moment, I just
> run it twice, which is ok. And I can do "foo ; blackboxfoo" so they chain but
> it isn't quite as nice.
>
> 2) The prefixes are rather long. Having to type out 'bzrlib.tests.' all the
> time. I know Vincent wanted to play with it a bit and see what worked for him.
> My proposal would be to use something like:
>
> bzr selftest -s B.T.test_command
>
> So the single capital letters would be used as abbreviations. The current
> supported ones would be:
> B. => bzrlib.
> B.T. => bzrlib.tests.
> B.P. => bzrlib.plugins.
> B.T.B. => bzrlib.tests.blackbox.
>
> I think that covers all the major prefixes. Obviously you can argue for stuff
> like "B.T.BI. => bzrlib.tests.branch_implementations."
>
> Another possible route is to make the whole thing an alias, and instead have:
>
> BT. => bzrlib.tests.
> BP. => bzrlib.plugins.
> BTB. => bzrlib.tests.blackbox.
>
> Either would be fine with me. Or if we wanted to do:
>
> :BT. => bzrlib.tests.
>
> To look something like the ":parent" that we use for other aliases.
>
> Anyone else have ideas?
>
Hopefully I'm not barking up the wrong tree here, but can't you just do
something like this instead:
bzr selftest test_command
which will run all tests that contain the string 'test_command'.
When I was writing tests for the diffstat plugin I just had to run bzr
selftest diffstat and it Just Worked.
> John
> =:->
More information about the bazaar
mailing list