r44557 - in /trunk/libtest-class-perl: ./ debian/ lib/Test/ lib/Test/Class/ t/

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Mon Sep 21 19:16:01 UTC 2009


Author: carnil-guest
Date: Mon Sep 21 19:15:55 2009
New Revision: 44557

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=44557
Log:
* New upstream release 
* debian/copyright: Update upstream Copyright years 

Added:
    trunk/libtest-class-perl/LICENSE
      - copied unchanged from r44554, branches/upstream/libtest-class-perl/current/LICENSE
    trunk/libtest-class-perl/t/97_meta.t
      - copied unchanged from r44554, branches/upstream/libtest-class-perl/current/t/97_meta.t
    trunk/libtest-class-perl/t/98_pod.t
      - copied unchanged from r44554, branches/upstream/libtest-class-perl/current/t/98_pod.t
    trunk/libtest-class-perl/t/99_pmv.t
      - copied unchanged from r44554, branches/upstream/libtest-class-perl/current/t/99_pmv.t
Modified:
    trunk/libtest-class-perl/Changes
    trunk/libtest-class-perl/MANIFEST
    trunk/libtest-class-perl/META.yml
    trunk/libtest-class-perl/README
    trunk/libtest-class-perl/debian/changelog
    trunk/libtest-class-perl/debian/copyright
    trunk/libtest-class-perl/lib/Test/Class.pm
    trunk/libtest-class-perl/lib/Test/Class/Load.pm
    trunk/libtest-class-perl/lib/Test/Class/MethodInfo.pm
    trunk/libtest-class-perl/t/bad-autoloads.t
    trunk/libtest-class-perl/t/fail2.t
    trunk/libtest-class-perl/t/runtests_die.t
    trunk/libtest-class-perl/t/skip1.t

Modified: trunk/libtest-class-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/Changes?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/Changes (original)
+++ trunk/libtest-class-perl/Changes Mon Sep 21 19:15:55 2009
@@ -1,3 +1,17 @@
+Changes for Perl extension Test-Class
+
+0.33 - or the "ZOMGIBROKECPAN" release
+    -   Make the test scripts adaptive to Test::More diagnostic changes in
+        version 0.88
+    -   Skip invalid package names in Test::Class::Load::_load so that we
+        don't try to load classes in .svn/et-al paths
+    -   Removed #! script invocation line from the MethodInfo.pm module
+
+0.32_1 - or the "Birmingham QA 2009" release
+    -   Removed pointless use of Test::Exception in t/bad-autoloads.t to stop
+        bogus warnings that were confusing some folk
+    -   Added add_testinfo for Test::Class::Sugar (thanks Piers Cawley)
+
 0.31 - or the "good god adrian is still alive" release
     -   Downgraded IO::File dependancy to 1.09 (RT#38424 - thanks Mark Stosberg)
 

Modified: trunk/libtest-class-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/MANIFEST?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/MANIFEST (original)
+++ trunk/libtest-class-perl/MANIFEST Mon Sep 21 19:15:55 2009
@@ -3,13 +3,15 @@
 lib/Test/Class.pm
 lib/Test/Class/Load.pm
 lib/Test/Class/MethodInfo.pm
-Makefile.PL
+LICENSE
 MANIFEST			This list of files
-META.yml
 README
 t/00-load.t
 t/20-load-classes.t
 t/21-load-subclassed.t
+t/97_meta.t
+t/98_pod.t
+t/99_pmv.t
 t/_new.t
 t/bad-autoloads.t
 t/bailout.t
@@ -69,3 +71,5 @@
 t/TestClassLoadSubclass.pm
 t/Tests.t
 t/todo.t
+Makefile.PL
+META.yml

Modified: trunk/libtest-class-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/META.yml?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/META.yml (original)
+++ trunk/libtest-class-perl/META.yml Mon Sep 21 19:15:55 2009
@@ -1,6 +1,6 @@
 ---
 name: Test-Class
-version: 0.31
+version: 0.33
 author:
   - 'Adrian Howard <adrianh at quietstars.com>'
 abstract: Easily create test classes in an xUnit/JUnit style
@@ -22,13 +22,13 @@
 provides:
   Test::Class:
     file: lib/Test/Class.pm
-    version: 0.31
+    version: 0.33
   Test::Class::Load:
     file: lib/Test/Class/Load.pm
-    version: 0.03
+    version: 0.04
   Test::Class::MethodInfo:
     file: lib/Test/Class/MethodInfo.pm
-    version: 0.02
+    version: 0.03
 generated_by: Module::Build version 0.280801
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html

Modified: trunk/libtest-class-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/README?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/README (original)
+++ trunk/libtest-class-perl/README Mon Sep 21 19:15:55 2009
@@ -650,6 +650,16 @@
     will work just fine. For more information on CHECK blocks see "BEGIN,
     CHECK, INIT and END" in perlmod.
 
+    If you still can't arrange for your classes to be loaded at runtime, you
+    could use an alternative mechanism for adding your tests:
+
+      # sub test_something : Test(3) {...}
+      # becomes
+      sub test_something {...}
+      __PACKAGE__->add_testinfo('test_something', test => 3);
+
+    See the add_testinfo method for more details.
+
 METHODS
   Creating and running tests
     Test
@@ -1047,6 +1057,18 @@
               my $self = shift;
               $self->SKIP_ALL("darwin only") unless $^O eq "darwin";    
           };
+
+    add_testinfo
+          CLASS->add_test($name, $type, $num_tests)
+
+        Chiefly for use by libraries like Test::Class::Sugar, which can't
+        use the ":Test(...)" interfaces make test methods. "add_testinfo"
+        informs the class about a test method that has been defined without
+        a "Test", "Tests" or other attribute.
+
+        $name is the name of the method, $type must be one of "startup",
+        "setup", "test", "teardown" or "shutdown", and $num_tests has the
+        same meaning as "N" in the description of the Test attribute.
 
 HELP FOR CONFUSED JUNIT USERS
     This section is for people who have used JUnit (or similar) and are
@@ -1278,7 +1300,7 @@
         A very simple unit testing framework.
 
 LICENCE
-    Copyright 2002-2007 Adrian Howard, All Rights Reserved.
+    Copyright 2002-2009 Adrian Howard, All Rights Reserved.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.

Modified: trunk/libtest-class-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/debian/changelog?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/debian/changelog (original)
+++ trunk/libtest-class-perl/debian/changelog Mon Sep 21 19:15:55 2009
@@ -1,8 +1,13 @@
-libtest-class-perl (0.31-3) UNRELEASED; urgency=low
-
+libtest-class-perl (0.33-1) UNRELEASED; urgency=low
+
+  [ gregor herrmann ]
   * Change my email address.
 
- -- gregor herrmann <gregoa at debian.org>  Thu, 03 Sep 2009 22:44:31 +0200
+  [ Salvatore Bonaccorso ]
+  * New upstream release 
+  * debian/copyright: Update upstream Copyright years 
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Mon, 21 Sep 2009 19:11:20 +0000
 
 libtest-class-perl (0.31-2) unstable; urgency=low
 

Modified: trunk/libtest-class-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/debian/copyright?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/debian/copyright (original)
+++ trunk/libtest-class-perl/debian/copyright Mon Sep 21 19:15:55 2009
@@ -4,7 +4,7 @@
 Upstream-Source: http://search.cpan.org/dist/Test-Class/
 
 Files: *
-Copyright: © 2002-2007 Adrian Howard, All Rights Reserved.
+Copyright: © 2002-2009 Adrian Howard, All Rights Reserved.
 License: GPL-1+ | Artistic
  This program is free software; you can redistribute it and/or modify
  it under the same terms as Perl itself.

Modified: trunk/libtest-class-perl/lib/Test/Class.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/lib/Test/Class.pm?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/lib/Test/Class.pm (original)
+++ trunk/libtest-class-perl/lib/Test/Class.pm Mon Sep 21 19:15:55 2009
@@ -12,7 +12,7 @@
 use Test::Builder;
 use Test::Class::MethodInfo;
 
-our $VERSION = '0.31';
+our $VERSION = '0.33';
 
 my $Check_block_has_run;
 {
@@ -98,14 +98,8 @@
         my $name = *{$symbol}{NAME};
         warn "overriding public method $name with a test method in $class\n"
                 if _is_public_method( $class, $name );
-        eval { 
-            my ($type, $num_tests) = _parse_attribute_args($args);        
-            $Tests->{$class}->{$name} = Test::Class::MethodInfo->new(
-                name => $name, 
-                num_tests => $num_tests,
-                type => $type,
-            );	
-        } || warn "bad test definition '$args' in $class->$name\n";	
+        eval { $class->add_testinfo($name, _parse_attribute_args($args)) } 
+            || warn "bad test definition '$args' in $class->$name\n";	
     };
 };
 
@@ -114,6 +108,15 @@
     $args ||= 'no_plan';
     Test( $class, $symbol, $code_ref, $attr, $args );
 };
+
+sub add_testinfo {
+    my($class, $name, $type, $num_tests) = @_;
+    $Tests->{$class}->{$name} = Test::Class::MethodInfo->new(
+        name => $name,
+        num_tests => $num_tests,
+        type => $type,
+    );
+}
 
 sub _class_of {
     my $self = shift;
@@ -1027,7 +1030,17 @@
 
   BEGIN { require $some_test_class };
   
-will work just fine. For more information on CHECK blocks see L<perlmod/"BEGIN, CHECK, INIT and END">. 
+will work just fine. For more information on CHECK blocks see L<perlmod/"BEGIN, CHECK, INIT and END">.
+
+If you still can't arrange for your classes to be loaded at runtime, you could use an alternative mechanism for adding your tests:
+
+  # sub test_something : Test(3) {...}
+  # becomes
+  sub test_something {...}
+  __PACKAGE__->add_testinfo('test_something', test => 3);
+
+See the L<add_testinfo|/"add_testinfo"> method for more details.
+
 
 =head1 METHODS
 
@@ -1394,6 +1407,15 @@
       my $self = shift;
       $self->SKIP_ALL("darwin only") unless $^O eq "darwin";    
   };
+
+
+=item B<add_testinfo>
+
+  CLASS->add_test($name, $type, $num_tests)
+
+Chiefly for use by libraries like L<Test::Class::Sugar>, which can't use the C<:Test(...)> interfaces make test methods. C<add_testinfo> informs the class about a test method that has been defined without a C<Test>, C<Tests> or other attribute.
+
+C<$name> is the name of the method, C<$type> must be one of C<startup>, C<setup>, C<test>, C<teardown> or C<shutdown>, and C<$num_tests> has the same meaning as C<N> in the description of the L<Test|/"Test"> attribute.
 
 
 =back
@@ -1656,6 +1678,6 @@
 
 =head1 LICENCE
 
-Copyright 2002-2007 Adrian Howard, All Rights Reserved.
+Copyright 2002-2009 Adrian Howard, All Rights Reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Modified: trunk/libtest-class-perl/lib/Test/Class/Load.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/lib/Test/Class/Load.pm?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/lib/Test/Class/Load.pm (original)
+++ trunk/libtest-class-perl/lib/Test/Class/Load.pm Mon Sep 21 19:15:55 2009
@@ -7,7 +7,7 @@
 use File::Find;
 use File::Spec;
 
-our $VERSION = '0.03';
+our $VERSION = '0.04';
 
 # Override to get your own filter
 sub is_test_class {
@@ -30,6 +30,9 @@
 
     # untaint that puppy!
     my ( $package ) = $_package =~ /^([[:word:]]+(?:::[[:word:]]+)*)$/;
+   
+    # Filter out bad classes (mainly this means things in .svn and similar)
+    return unless defined $package;
 
     unshift @INC => $dir unless $Added_to_INC{ $dir }++;
     eval "require $package"; ## no critic

Modified: trunk/libtest-class-perl/lib/Test/Class/MethodInfo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/lib/Test/Class/MethodInfo.pm?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/lib/Test/Class/MethodInfo.pm (original)
+++ trunk/libtest-class-perl/lib/Test/Class/MethodInfo.pm Mon Sep 21 19:15:55 2009
@@ -1,12 +1,10 @@
-#! /usr/bin/perl -Tw
-
 use strict;
 use warnings;
 
 package Test::Class::MethodInfo;
 use Carp;
 
-our $VERSION = '0.02';
+our $VERSION = '0.03';
 
 sub new {
     my ( $class, %param ) = @_;

Modified: trunk/libtest-class-perl/t/bad-autoloads.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/t/bad-autoloads.t?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/t/bad-autoloads.t (original)
+++ trunk/libtest-class-perl/t/bad-autoloads.t Mon Sep 21 19:15:55 2009
@@ -3,9 +3,9 @@
 use strict;
 use warnings FATAL => 'all';
 use Test::More;
-use Test::Exception;
 
 BEGIN {
+    no warnings;
     eval "use Contextual::Return";
     if ($@ ) {
         plan skip_all => "need Contextual::Return" if $@;

Modified: trunk/libtest-class-perl/t/fail2.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/t/fail2.t?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/t/fail2.t (original)
+++ trunk/libtest-class-perl/t/fail2.t Mon Sep 21 19:15:55 2009
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -T
+#!/usr/bin/perl -T
 
 use strict;
 use warnings;
@@ -23,18 +23,19 @@
 package main;
 $ENV{TEST_VERBOSE}=0;
 
+my $identifier = ($Test::More::VERSION < 0.88) ? 'object' : 'thing';
 
-test_out("not ok 1 - The object isa Object");
+test_out("not ok 1 - The $identifier isa Object");
 test_out("not ok 2 - cannot create Objects");
-test_fail(-11);
+test_fail(-12);
 test_err( "#   (in Object::Test->_test_new)" );
-test_err(qr/#\s+The object isn't defined\n/);
-test_fail(-14);
+test_err(qr/#\s+The $identifier isn't defined\n/);
+test_fail(-15);
 test_err( "#   (in Object::Test->_test_new)" );
 
 Object::Test->runtests;
 END {
 	test_test("fail2");
 	is($?, 2, "exit value okay");
-	$?=0;
+	$? = 0;
 }

Modified: trunk/libtest-class-perl/t/runtests_die.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/t/runtests_die.t?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/t/runtests_die.t (original)
+++ trunk/libtest-class-perl/t/runtests_die.t Mon Sep 21 19:15:55 2009
@@ -21,13 +21,14 @@
 $ENV{TEST_VERBOSE}=0;
 
 my $filename = sub { return (caller)[1] }->();
+my $identifier = ($Test::More::VERSION < 0.88) ? 'object' : 'thing';
 
-test_out( "not ok 1 - The object isa Object");
+test_out( "not ok 1 - The $identifier isa Object");
 test_err( "#     Failed test ($filename at line 15)");
 test_err( "#   (in Foo->test_object)" );
-test_err( "#     The object isn't defined");
+test_err( "#     The $identifier isn't defined");
 test_out( "not ok 2 - test_object died (could not create object)");
-test_err( "#     Failed test ($filename at line 32)");
+test_err( "#     Failed test ($filename at line 33)");
 test_err( "#   (in Foo->test_object)" );
 Foo->runtests;
 test_test("early die handled");

Modified: trunk/libtest-class-perl/t/skip1.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-class-perl/t/skip1.t?rev=44557&op=diff
==============================================================================
--- trunk/libtest-class-perl/t/skip1.t (original)
+++ trunk/libtest-class-perl/t/skip1.t Mon Sep 21 19:15:55 2009
@@ -1,4 +1,4 @@
-#! /usr/bin/perl -T
+#!/usr/bin/perl
 
 use strict;
 use warnings;
@@ -20,7 +20,7 @@
 	print "1..1\n";
 	my $output = <$io>;
 	chomp($output);
-	my $ok = $output eq "1..0 # Skip skipping";
+	my $ok = $output =~ /^1..0 # Skip skipping$/i;
 	print "not " unless $ok;
 	print "ok 1 - SKIP_ALL called skip_all\n";
 };




More information about the Pkg-perl-cvs-commits mailing list