Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge commit 'obra/master' into fixes-from-obra

  • Loading branch information...
commit eb70da12d086160d0d73e0dc872d72cab8c67891 2 parents 6cff645 + 73f239e
@gugod gugod authored
Showing with 100 additions and 25 deletions.
  1. +91 −22 README
  2. +9 −3 lib/Test/Continuous.pm
View
113 README
@@ -1,38 +1,107 @@
-Test-Continuously version 0.0.1
+NAME
+ Test::Continuous - Run your tests suite continusouly when developing.
-This module is inspired by "Continuous Testing"
+VERSION
+ This document describes Test::Continuous version 0.61
- http://groups.csail.mit.edu/pag/continuoustesting/
+SYNOPSIS
+ Very simple usage:
-Perl module developers can use this module to keep testing their work
-at the same moment they are coding. It keeps polling if any code is
-changed, and run tests if so.
+ % cd MyModule/
+ % perl -MTest::Continuous -e runtests
-INSTALLATION
+ If you want to provide prove arguments:
-To install this module, run the following commands:
+ % perl -MTest::Continuous -e runtests -- --verbose --shuffle
- perl Makefile.PL
- make
- make test
- make install
+DESCRIPTION
+ *Continuous Testing* is a concept and tool to re-run software tests as
+ soon as the developer saved the source code.
-USAGE
+ See also <http://groups.csail.mit.edu/pag/continuoustesting/> for the
+ original implementation of Continuous Testing as a Eclipse plugin.
-To use this, run this at your module directory (where a t/ lives):
+ See also Zentest <http://www.zenspider.com/ZSS/Products/ZenTest/> for
+ the same concept of implementation in Ruby's world.
- perl -MTest::Continuously -e runtests
+INTERFACE
+ runtests
+ This is the only function that you should be calling, directly from
+ command line:
-Then just switch to your editor and start coding. You shall be
-notified when a round of test is finished.
+ perl -MTest::Continuous -e runtests
+
+ It'll start monitoring the mtime of all files under current working
+ directy. If there's any update, it'll run your module test under t/
+ directory with App::Prove.
+
+ Test result are displayed on terminal. Also dispatched to Growl if
+ "Log::Dispatch::MacGrowl" is installed. Big plus for perl
+ programmers on Mac.
+
+ "Test::Continuous" will auto detect the subset of tests to run. For
+ example, say you have two test files "feature-foo.t" and
+ "feature-bar.t" which test ,and use, your module "Feature::Foo" and
+ "Feature::Bar" respectively. "Test::Continuous" can catch this
+ static dependency and only run "feature-foo.t" when "Feature::Foo"
+ is modified, "feature-bar.t" will only be ran if "Feature::Bar" is
+ modified.
+
+ If a ".t" file is modified, only that test file will be ran.
+
+ Dynamic module dependency is more difficult to detect and needs
+ further research.
+
+CONFIGURATION AND ENVIRONMENT
+ Test::Continuous requires no configuration files or environment
+ variables.
DEPENDENCIES
+ App::Prove, Log::Dispatch, Log::Dispatch::MacGrowl, Module::ExtractUse
+
+INCOMPATIBILITIES
+ None reported.
+
+BUGS AND LIMITATIONS
+ No bugs have been reported.
+
+ Please report any bugs or feature requests to
+ "bug-test-continuous@rt.cpan.org", or through the web interface at
+ <http://rt.cpan.org>.
+
+TODO
+ A good name for executable.
+ Accept a per-module config file to tweak different parameters to prove
+ command.
+
+AUTHOR
+ Kang-min Liu "<gugod@gugod.org>"
+
+LICENCE AND COPYRIGHT
+ Copyright (c) 2008, Kang-min Liu "<gugod@gugod.org>".
-Mac::Growl
+ This module is free software; you can redistribute it and/or modify it
+ under the same terms as Perl itself. See perlartistic.
-COPYRIGHT AND LICENCE
+DISCLAIMER OF WARRANTY
+ BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+ FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+ PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+ EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
+ YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+ NECESSARY SERVICING, REPAIR, OR CORRECTION.
-Copyright (C) 2008, Kang-min Liu
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+ REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
+ TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+ SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+ FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGES.
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
View
12 lib/Test/Continuous.pm
@@ -38,8 +38,9 @@ sub _files {
return @files if @files;
find sub {
my $filename = $File::Find::name;
+
return if ! -f $filename;
- return unless $filename =~ /\.(p[lm]|t)$/ && -f $filename;
+ return unless $filename =~ /\.(p[lm]|t)$/;
push @files, $filename;
}, getcwd;
return @files;
@@ -139,12 +140,17 @@ sub _analyze_tap_archive {
sub runtests {
if (@ARGV) {
# print "ARGV: " . join ",",@ARGV, "\n";
- while (-f $ARGV[-1]) {
+ while ($ARGV[-1] && -f $ARGV[-1]) {
push @tests, pop @ARGV;
}
@prove_args = @ARGV;
} else {
- @tests = <t/*.t>;
+
+ find sub {
+ my $filename = $File::Find::name;
+ return unless $filename =~ /\.t$/ && -f $filename;
+ push @tests, $filename;
+ }, getcwd;
}
print "[MSG] Will run continuously test $_\n" for @tests;
Please sign in to comment.
Something went wrong with that request. Please try again.