On 29 Nov 2007, at 16:05, Adrian Howard wrote:
I like this coz my preferred way of working is to run all of the tests all of the time, rather than just the particular test script that I'm working on at the moment. That way if I have some dumb code that breaks something else in the system I get the feedback earlier.


Thanks for this suggestion Adrian. I've just implemented it as of r878 and

$ prove -b --state=hot,save

AKA "The Adrian" is my new favourite command :)

Eric: I *really* like have all the state selectors in a single switch. Please have a look at it and tell me if you find it awful.

Here's the appropriate fragment of prove's documentation:

=head2 C<--state>

You can ask C<prove> to remember the state of previous test runs and
select and/or order the tests to be run this time based on that
saved state.

The C<--state> switch requires an argument which must be a comma
separated list of one or more of the following options.

=over

=item C<last>

Run the same tests as the last time the state was saved. This makes it
possible to recreate the ordering of a shuffled test.

    # Run all tests in random order
    $ prove -b --state=save --shuffle

    # Run them again in the same order
    $ prove -b --state=last

=item C<failed>

Run only the tests that failed on the last run.

    # Run all tests
    $ prove -b --state=save

    # Run failures
    $ prove -b --state=failed

If you also specify the C<save> option newly passing tests will be
excluded from subsequent runs.

    # Repeat until no more failures
    $ prove -b --state=failed,save

=item C<passed>

Run only the passed tests from last time. Useful to make sure that no
new problems have been introduced.

=item C<all>

Run all tests in normal order. Multple options may be specified, so to
run all tests with the failures from last time first:

    $ prove -b --state=failed,all,save

=item C<hot>

Run the tests that most recently failed first. The last failure time of
each test is stored. The C<hot> switch causes tests to be run in most- recent-
failure order.

    $ prove -b --state=hot,save

=item C<save>

Save the state on exit. The state is stored in a file called F<.prove>
(F<_prove> on Windows and VMS) in the current directory.

=back


http://svn.hexten.net/tapx/trunk
http://hexten.net/tapx/r878/Test-Harness-3.04.tar.gz

--
Andy Armstrong, Hexten




Reply via email to