NAME

SmokeRunner::Multi::TestSet - Represents a set of tests

VERSION

version 0.21

SYNOPSIS

my $set = SmokeRunner::Multi::TestSet->new( set_dir => 'path/to/set' );

DESCRIPTION

This class provides methods for getting information about a test set.

A test set is simple any directory that contains a subdirectory named "t", which in turn should contain one or more test files ending in ".t". It can also contain various other directories or files. In typical usage, this would be a checkout of an application or module.

METHODS

This class provides the following methods:

SmokeRunner::Multi::Reporter->new(...)

This method creates a new test set object. It requires one parameter:

  • set_dir

    This should be a directory containing a subdirectory named "t".

Instead of simply returning an object of this class, the constructor looks at each test set subclass and tries to construct an object of the subclass's class. Subclasses will simply return if they cannot create an object. If no subclasses return an object, then the constructor will simply use this class (SmokeRunner::Multi::TestSet) as the object's class.

$set->name()

This is the name of the directory containing the test set, without the full path. So if you create a set with the path /home/checkouts/branches/trunk, the name of the set would be "trunk".

$set->set_dir()

This returns the path to the set directory, as passed to the constructor.

$set->test_dir()

This returns the path to the "t" subdirectory in the set directory.

$set->last_run_time()

Returns the time of the last test run for this set. If it has never been run, the time will be 0.

$set->is_prioritized()

Returns a boolean indicating whether the set has been prioritized.

$set->test_files()

Returns a sorted list of all the files in the set's test_dir().

$set->last_mod_time()

Returns the last modification time for the set. By default, this is simply the most recent last mod time for one of the test files, but subclasses may override this.

$set->is_out_of_date()

A convenience method which returns true if the last mod time of the set is greater than its last run time.

$set->seconds_out_of_date()

This returns the number of seconds by which the set is out of date. This number can be zero negative, in which case the set is not out of date, as the last run time is equal to or greater than the last mod time.

$set->update_last_run_time()

Updates the last run time of the set in the database.

$set->prioritize()

$set->unprioritize()

This methods flip the is_prioritized() flag for the set in the database.

$set->update_files()

By default, this method is a no-op, but subclasses can override it.

$set->remove()

This method deletes the set from the database and from the filesystem.

SmokeRunner::Multi::TestSet->All()

This returns a sorted list of all the test sets under the root directory specified in the config file.

Sets are sorted first by whether or not they are prioritized, then by how out of date they are, and finally by name.

AUTHOR

Dave Rolsky, <autarch@urth.org>

BUGS

Please report any bugs or feature requests to bug-smokerunner-multi@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007 LiveText, Inc., All Rights Reserved.

This program is free software; you can redistribute it and /or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

AUTHORS

  • Dave Rolsky <autarch@urth.org>

  • Yanick Champoux <yanick@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2007 by LiveText, Inc..

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.