r50762 - in /branches/upstream/libtest-nobreakpoints-perl: ./ current/ current/lib/ current/lib/Test/ current/t/ current/t/baz/ current/t/baz/gzonk/ current/t/baz/quux/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Mon Jan 11 21:11:04 UTC 2010


Author: jawnsy-guest
Date: Mon Jan 11 21:10:57 2010
New Revision: 50762

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50762
Log:
[svn-inject] Installing original source of libtest-nobreakpoints-perl

Added:
    branches/upstream/libtest-nobreakpoints-perl/
    branches/upstream/libtest-nobreakpoints-perl/current/
    branches/upstream/libtest-nobreakpoints-perl/current/Build.PL
    branches/upstream/libtest-nobreakpoints-perl/current/ChangeLog
    branches/upstream/libtest-nobreakpoints-perl/current/MANIFEST
    branches/upstream/libtest-nobreakpoints-perl/current/META.yml
    branches/upstream/libtest-nobreakpoints-perl/current/Makefile.PL
    branches/upstream/libtest-nobreakpoints-perl/current/README
    branches/upstream/libtest-nobreakpoints-perl/current/lib/
    branches/upstream/libtest-nobreakpoints-perl/current/lib/Test/
    branches/upstream/libtest-nobreakpoints-perl/current/lib/Test/NoBreakpoints.pm
    branches/upstream/libtest-nobreakpoints-perl/current/t/
    branches/upstream/libtest-nobreakpoints-perl/current/t/01_use.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/02_pod.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/04_all_perl_files.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/05_no_breakpoints_ok.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/06_all_files_no_breakpoints_ok.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/07_deprecated_warnings.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/08_deprecated.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/bar1
    branches/upstream/libtest-nobreakpoints-perl/current/t/bar2
    branches/upstream/libtest-nobreakpoints-perl/current/t/bar3
    branches/upstream/libtest-nobreakpoints-perl/current/t/bar4
    branches/upstream/libtest-nobreakpoints-perl/current/t/bar5
    branches/upstream/libtest-nobreakpoints-perl/current/t/bar6
    branches/upstream/libtest-nobreakpoints-perl/current/t/baz/
    branches/upstream/libtest-nobreakpoints-perl/current/t/baz/foo.t
    branches/upstream/libtest-nobreakpoints-perl/current/t/baz/gzonk/
    branches/upstream/libtest-nobreakpoints-perl/current/t/baz/gzonk/foo.pl
    branches/upstream/libtest-nobreakpoints-perl/current/t/baz/quux/
    branches/upstream/libtest-nobreakpoints-perl/current/t/baz/quux/Foo.pm
    branches/upstream/libtest-nobreakpoints-perl/current/t/foo

Added: branches/upstream/libtest-nobreakpoints-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/Build.PL?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/Build.PL (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/Build.PL Mon Jan 11 21:10:57 2010
@@ -1,0 +1,37 @@
+#
+# $Id: Build.PL 163 2004-12-31 05:07:16Z james $
+#
+
+use Module::Build;
+
+Module::Build->new(
+
+	module_name         => 'Test::NoBreakpoints',
+
+    dist_version_from   => 'lib/Test/NoBreakpoints.pm',
+
+	license             => 'perl',
+
+    create_makefile_pl  => 'traditional',
+
+    create_readme       => 1,
+
+    requires            => {
+        Test::Builder         => 0,
+    },
+
+    build_requires      => {
+        Test::More            => 0,
+        Test::Exception       => 0,
+        Test::Tester          => 0.09,
+        Test::Warn            => 0,
+    },
+
+    add_to_cleanup      => [ qw|
+        Makefile
+    | ],
+
+)->create_build_script;
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/ChangeLog?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/ChangeLog (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/ChangeLog Mon Jan 11 21:10:57 2010
@@ -1,0 +1,34 @@
+#
+# $Id: ChangeLog 165 2005-01-13 18:00:45Z james $
+#
+
+2004-01-28  v0.10
+            - Initial release to CPAN
+
+2004-12-27  v0.11
+            - Fix $VERSION to be interpreted as a string.
+            - make t/baz/foo.t a usable do-nothing test script - it seems
+              that some versions of EU::MM recurse into the t directory,
+              trying to find all.t files.  Should fix the problem in
+              cpantesters failure report #170736.
+            - re-steal^H^H^H^H^Hborrow all_pod_files() from a newer version
+              of Test::Pod in an attempt to make it more robust and fix the
+              problem reported in cpantesters failure reports #170633 and
+              #120973.
+            - Switch from Test::Builder::Tester to Test::Tester, which has
+              a less arcane syntax and isn't as bothered about newline
+              differences.
+
+2004-12-30  v0.12
+            - require v0.09 of Test::Tester.  Should fix the blow-up
+              reported in cpantesters report #176356.
+
+2005-01-13  v0.13
+            - change 'brkpts' to 'breakpoints' on the advice of Andy Lester
+              The old names still exist, but will emit warnings unless
+              supressed using the warnings pragma.  The old names will
+              be removed after two releases or a reasonable period of time,
+              whichever is longer.
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/MANIFEST?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/MANIFEST (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/MANIFEST Mon Jan 11 21:10:57 2010
@@ -1,0 +1,24 @@
+Build.PL
+ChangeLog
+lib/Test/NoBreakpoints.pm
+Makefile.PL
+MANIFEST			This list of files
+META.yml
+README
+t/01_use.t
+t/02_pod.t
+t/04_all_perl_files.t
+t/05_no_breakpoints_ok.t
+t/06_all_files_no_breakpoints_ok.t
+t/07_deprecated_warnings.t
+t/08_deprecated.t
+t/bar1
+t/bar2
+t/bar3
+t/bar4
+t/bar5
+t/bar6
+t/baz/foo.t
+t/baz/gzonk/foo.pl
+t/baz/quux/Foo.pm
+t/foo

Added: branches/upstream/libtest-nobreakpoints-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/META.yml?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/META.yml (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/META.yml Mon Jan 11 21:10:57 2010
@@ -1,0 +1,19 @@
+--- #YAML:1.0
+name: Test-NoBreakpoints
+version: 0.13
+author:
+  - James FitzGibbon <jfitz at CPAN.org>
+abstract: test that files do not contain soft breakpoints
+license: perl
+requires:
+  Test::Builder: 0
+build_requires:
+  Test::Exception: 0
+  Test::More: 0
+  Test::Tester: 0.09
+  Test::Warn: 0
+provides:
+  Test::NoBreakpoints:
+    file: lib/Test/NoBreakpoints.pm
+    version: 0.13
+generated_by: Module::Build version 0.2607

Added: branches/upstream/libtest-nobreakpoints-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/Makefile.PL?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/Makefile.PL (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/Makefile.PL Mon Jan 11 21:10:57 2010
@@ -1,0 +1,17 @@
+# Note: this file was auto-generated by Module::Build::Compat version 0.03
+use ExtUtils::MakeMaker;
+WriteMakefile
+(
+          'NAME' => 'Test::NoBreakpoints',
+          'VERSION_FROM' => 'lib/Test/NoBreakpoints.pm',
+          'PREREQ_PM' => {
+                           'Test::Builder' => '0',
+                           'Test::Exception' => '0',
+                           'Test::More' => '0',
+                           'Test::Tester' => '0.09',
+                           'Test::Warn' => '0'
+                         },
+          'INSTALLDIRS' => 'site',
+          'PL_FILES' => {}
+        )
+;

Added: branches/upstream/libtest-nobreakpoints-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/README?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/README (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/README Mon Jan 11 21:10:57 2010
@@ -1,0 +1,138 @@
+NAME
+    Test::NoBreakpoints - test that files do not contain soft breakpoints
+
+SYNOPSIS
+     use Test::NoBreakpoints;
+     plan tests => $num_tests;
+     no_breakpoints_ok( $file, 'Contains no soft breakpoints' );
+
+    Module authors can include the following in a t/nobreakpoints.t file to
+    add such checking to a module distribution:
+
+      use Test::More;
+      eval "use Test::NoBreakpoints 0.10";
+      plan skip_all => "Test::NoBreakpoints 0.10 required for testing" if $@;
+      all_files_no_breakpoints_ok();
+
+DESCRIPTION
+    I love soft breakpoints ("$DB::single = 1") in the Perl debugger.
+    Unfortunately, I have a habit of putting them in my code during
+    development and forgetting to take them out before I upload it to CPAN,
+    necessitating a hasty fix/package/bundle cycle followed by much cursing.
+
+    Test::NoBreakpoints checks that files contain neither the string
+    "$DB::single = 1" nor "$DB::signal = 1". By adding such a test to all my
+    modules, I swear less and presumably lighten the load on the CPAN in
+    some small way.
+
+FUNCTIONS
+    Unless otherwise noted, all functions are tests built on top of
+    Test::Builder, so the standard admonition about having made a plan
+    before you run them apply.
+
+  no_breakpoints_ok($file, [$description] )
+    Checks that $file contains no breakpoints. If the optional $description
+    is not passed it defaults to "no breakpoint test of $file".
+
+    If the test fails, the line number of the file where the breakpoint was
+    found will be emitted.
+
+    For compatibility with old versions of this module, the deprecated name
+    "no_brkpts_ok" may also be used (but see "DEPRECATED FUNCTIONS").
+
+  all_perl_files( [@dirs] )
+    Returns a list of all *.pl, *.pm and *.t files in the directories
+    listed. If @dirs is not passed, defaults to "blib" and "t".
+
+    The order of the files returned is machine-dependent. If you want them
+    sorted, you'll have to sort them yourself.
+
+  all_files_no_breakpoints_ok( [@files] )
+    Checks all files that look like they contain Perl using
+    no_breakpoints_ok(). If @files is not provided, it defaults to the
+    return of all_perl_files().
+
+    For compatibility with old versions of this module, the deprecated name
+    "all_files_no_brkpts_ok" may also be used (but see "DEPRECATED
+    FUNCTIONS").
+
+EXPORTS
+    By default all_files_no_breakpoints_ok and no_breakpoints_ok.
+
+    For the time being, the deprecated forms the above
+    (all_files_no_brkpts_ok and no_brkpts_ok) are also exported (but see
+    "DEPRECATED FUNCTIONS").
+
+    On request, all_perl_files.
+
+    Everything with the tag :all.
+
+DEPRECATED FUNCTIONS
+    Prior to v0.13 of this module, no_breakpoints_ok was called no_brkpts_ok
+    and all_files_no_breakpoints_ok was similarly abbreviated.
+
+    In v0.13, these older names were deprecated. They are still exported by
+    default, but will emit a warning unless you disable the deprecated
+    lexical warning category:
+
+      {
+        no warnings 'deprecated';
+        no_brkpts_ok(...);
+      }
+  
+    In the next release, the deprecated functions will have to be pulled in
+    via an import tag. In the release after that, they will cease to be.
+
+ACKNOWLEDGEMENTS
+    Michael Schwern for Test::Builder.
+
+    Andy Lester for Test::Pod, which is where I got the idea and borrowed
+    the logic of all_perl_files from.
+
+BUGS
+    * doesn't catch some breakpoints
+        This is a valid breakpoint:
+
+          package DB;
+          $single = 1;
+          package main;
+
+        as is this:
+
+          my $break = \$DB::single;
+          $$break = 1;
+
+        but neither are currently caught.
+
+TODO
+    * enhance regex to find esoteric setting of breakpoints
+        If you have a legitimate breakpoint set that isn't caught, please
+        send me an example and I'll try to augment the regex to match it.
+
+    * only look at code rather than the entire file
+        This is not as easy as simply stripping out POD, because there might
+        be inline tests or examples that are code in there (using
+        Test::Inline). Granted, those should be caught when the generated .t
+        files are themselves tested, but I'd like to make it smarter.
+
+    * not use regular expressions
+        The ideal way to find a breakpoint would be to compile the code and
+        then walk the opcode tree to find places where the breakpoint is
+        set. B::FindAmpersand does something similar to this to find use of
+        the $& in regular expressions, so this is probably the direction I'm
+        going to head in.
+
+SEE ALSO
+    Test::Builder
+
+    Test::Pod
+
+AUTHOR
+    James FitzGibbon <jfitz at CPAN.org>
+
+COPYRIGHT
+    Copyright (c) 2004-2005, James FitzGibbon. All Rights Reserved.
+
+    This module is free software. You may use it under the same terms as
+    perl itself.
+

Added: branches/upstream/libtest-nobreakpoints-perl/current/lib/Test/NoBreakpoints.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/lib/Test/NoBreakpoints.pm?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/lib/Test/NoBreakpoints.pm (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/lib/Test/NoBreakpoints.pm Mon Jan 11 21:10:57 2010
@@ -1,0 +1,336 @@
+#
+# $Id: NoBreakpoints.pm 164 2005-01-13 18:00:20Z james $
+#
+
+=head1 NAME
+
+Test::NoBreakpoints - test that files do not contain soft breakpoints
+
+=head1 SYNOPSIS
+
+ use Test::NoBreakpoints;
+ plan tests => $num_tests;
+ no_breakpoints_ok( $file, 'Contains no soft breakpoints' );
+
+Module authors can include the following in a t/nobreakpoints.t file to add
+such checking to a module distribution:
+
+  use Test::More;
+  eval "use Test::NoBreakpoints 0.10";
+  plan skip_all => "Test::NoBreakpoints 0.10 required for testing" if $@;
+  all_files_no_breakpoints_ok();
+
+=head1 DESCRIPTION
+
+I love soft breakpoints (C<$DB::single = 1>) in the Perl debugger. 
+Unfortunately, I have a habit of putting them in my code during development
+and forgetting to take them out before I upload it to CPAN, necessitating a
+hasty fix/package/bundle cycle followed by much cursing.
+
+Test::NoBreakpoints checks that files contain neither the string
+C<$DB::single = 1> nor C<$DB::signal = 1>.  By adding such a test to all my
+modules, I swear less and presumably lighten the load on the CPAN in some
+small way.
+
+=cut
+
+package Test::NoBreakpoints;
+
+use strict;
+
+use File::Spec;
+use File::Find;
+use Test::Builder;
+
+require Exporter;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+
+$VERSION   = '0.13';
+ at ISA       = 'Exporter';
+ at EXPORT    = qw|
+    all_files_no_breakpoints_ok
+    all_files_no_brkpts_ok
+    no_breakpoints_ok
+    no_brkpts_ok
+|;
+ at EXPORT_OK = qw|all_perl_files|;
+%EXPORT_TAGS = (
+    all => [ @EXPORT, @EXPORT_OK ],
+);
+
+# get a Test singleton to use
+my $Test = Test::Builder->new;
+
+# a regular expression to find soft breakpoints
+my $brkpt_rx = qr/
+    (                   # match it
+        \$DB            # The DB package
+        (?:::|')        # Perl 4 or 5 package seperator
+        si(?:ngle|gnal) # signal or single
+        \s*=\s*         # an equal with optional whitespace
+        [1-9]           # a digit other than zero
+                        # (am I being stupid here?  Is there
+    )                   #  no easier way to say that?)
+/x;
+
+# check that there are no breakpoints in a file
+sub no_breakpoints_ok($;$)
+{
+    
+    my($file, $name) = @_;
+    $name ||= "no breakpoint test of $file";
+    
+    # slurp in the file
+    my $fh;
+    unless( open($fh, $file) ) {
+        $Test->ok(0, $name);
+        $Test->diag("could not open $file: $!");
+        return;
+    }
+    my $text = do { local( $/ ) ; <$fh> } ;
+    close($fh);
+    
+    # check the file against our regex
+    my($matched) = $text =~ m/$brkpt_rx/;
+    if( ! $matched ) {
+        $Test->ok(1, $name);
+    }
+    else {
+        $Test->ok(0, $name);
+        $Test->diag("breakpoint found in $file: $matched");
+    }
+    
+    return $matched ? 0 : 1;
+    
+}
+
+# deprecated name for the above
+sub no_brkpts_ok
+{
+
+    warnings::warnif('deprecated', "no_brkpts_ok is deprecated (use no_breakpoints_ok instead)");
+    goto &no_breakpoints_ok;
+
+}
+
+# find all perl files in a given directory
+# graciously borrwed from Test::Pod::all_pod_files by
+# Andy Lester / brian d foy
+sub all_perl_files
+{
+
+    my @queue = @_ ? @_ : _starting_points();
+    my @files = ();
+
+    while ( @queue ) {
+        my $file = shift @queue;
+        if ( -d $file ) {
+            local *DH;
+            opendir DH, $file or next;
+            my @newfiles = readdir DH;
+            closedir DH;
+
+            @newfiles = File::Spec->no_upwards( @newfiles );
+            @newfiles = grep { $_ ne "CVS" && $_ ne ".svn" } @newfiles;
+
+            push @queue, map "$file/$_", @newfiles;
+        }
+        if ( -f $file ) {
+            push @files, $file if _is_perl( $file );
+        }
+    } # while
+
+    return @files;
+
+}
+
+
+sub _starting_points {
+    return 'blib' if -e 'blib';
+    return 'lib';
+}
+
+sub _is_perl {
+    my $file = shift;
+
+    return 1 if $file =~ /\.PL$/;
+    return 1 if $file =~ /\.p(l|m)$/;
+    return 1 if $file =~ /\.t$/;
+
+    local *FH;
+    open FH, $file or return;
+    my $first = <FH>;
+    close FH;
+
+    return 1 if defined $first && ($first =~ /^#!.*perl/);
+
+    return;
+}        
+
+# run no_breakpoints_ok on all files in a given directory
+sub all_files_no_breakpoints_ok
+{
+
+    my @files = @_ ? @_ : all_perl_files();
+
+    my $ok = 1; # presume all succeed
+    for( @files ) {
+        no_breakpoints_ok($_) or $ok = 0;
+    }
+    return $ok;
+    
+}
+
+# deprecated name for the above
+sub all_files_no_brkpts_ok
+{
+
+    warnings::warnif('deprecated', "all_files_no_brkpts_ok is deprecated (use all_files_no_breakpoints_ok instead)");
+    goto &all_files_no_breakpoints_ok;
+
+}
+
+# keep require happy
+1;
+
+
+__END__
+
+=head1 FUNCTIONS
+
+Unless otherwise noted, all functions are tests built on top of
+Test::Builder, so the standard admonition about having made a plan before
+you run them apply.
+
+=head2 no_breakpoints_ok($file, [$description] )
+
+Checks that $file contains no breakpoints.  If the optional $description is
+not passed it defaults to "no breakpoint test of $file".
+
+If the test fails, the line number of the file where the breakpoint was
+found will be emitted.
+
+For compatibility with old versions of this module, the deprecated name
+C<no_brkpts_ok> may also be used (but see L</"DEPRECATED FUNCTIONS">).
+
+=head2 all_perl_files( [@dirs] )
+
+Returns a list of all F<*.pl>, F<*.pm> and F<*.t> files in the directories
+listed.  If C<@dirs> is not passed, defaults to C<blib> and C<t>.
+
+The order of the files returned is machine-dependent.  If you want them
+sorted, you'll have to sort them yourself.
+
+=head2 all_files_no_breakpoints_ok( [@files] )
+
+Checks all files that look like they contain Perl using no_breakpoints_ok(). If
+C<@files> is not provided, it defaults to the return of B<all_perl_files()>.
+
+For compatibility with old versions of this module, the deprecated name
+C<all_files_no_brkpts_ok> may also be used (but see L</"DEPRECATED
+FUNCTIONS">).
+
+=head1 EXPORTS
+
+By default B<all_files_no_breakpoints_ok> and B<no_breakpoints_ok>.
+
+For the time being, the deprecated forms the above
+(B<all_files_no_brkpts_ok> and B<no_brkpts_ok>) are also exported (but see
+L</"DEPRECATED FUNCTIONS">).
+
+On request, B<all_perl_files>.
+
+Everything with the tag B<:all>.
+
+=head1 DEPRECATED FUNCTIONS
+
+Prior to v0.13 of this module, no_breakpoints_ok was called no_brkpts_ok and
+all_files_no_breakpoints_ok was similarly abbreviated.
+
+In v0.13, these older names were deprecated.  They are still exported by
+default, but will emit a warning unless you disable the B<deprecated>
+lexical warning category:
+
+  {
+    no warnings 'deprecated';
+    no_brkpts_ok(...);
+  }
+  
+In the next release, the deprecated functions will have to be pulled in via
+an import tag.  In the release after that, they will cease to be.
+
+=head1 ACKNOWLEDGEMENTS
+
+Michael Schwern for Test::Builder.
+
+Andy Lester for Test::Pod, which is where I got the idea and borrowed the
+logic of B<all_perl_files> from.
+
+=head1 BUGS
+
+=over 4
+
+=item * doesn't catch some breakpoints
+
+This is a valid breakpoint:
+
+  package DB;
+  $single = 1;
+  package main;
+
+as is this:
+
+  my $break = \$DB::single;
+  $$break = 1;
+
+but neither are currently caught.
+
+=back
+
+=head1 TODO
+
+=over 4
+
+=item * enhance regex to find esoteric setting of breakpoints
+
+If you have a legitimate breakpoint set that isn't caught, please send me an
+example and I'll try to augment the regex to match it.
+
+=item * only look at code rather than the entire file
+
+This is not as easy as simply stripping out POD, because there might be
+inline tests or examples that are code in there (using Test::Inline).
+Granted, those should be caught when the generated .t files are themselves
+tested, but I'd like to make it smarter.
+
+=item * not use regular expressions
+
+The ideal way to find a breakpoint would be to compile the code and then
+walk the opcode tree to find places where the breakpoint is set. 
+B::FindAmpersand does something similar to this to find use of the C<$&> in
+regular expressions, so this is probably the direction I'm going to head in.
+
+=back
+
+=head1 SEE ALSO
+
+L<Test::Builder>
+
+L<Test::Pod>
+
+=head1 AUTHOR
+
+James FitzGibbon <jfitz at CPAN.org>
+
+=head1 COPYRIGHT
+
+Copyright (c) 2004-2005, James FitzGibbon.  All Rights Reserved.
+
+This module is free software. You may use it under the same terms as perl
+itself.
+
+=cut
+
+#
+# EOF
+

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/01_use.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/01_use.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/01_use.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/01_use.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,48 @@
+#
+# $Id: 01_use.t 163 2004-12-31 05:07:16Z james $
+#
+
+use strict;
+use warnings;
+
+use File::Find;
+
+# find the number of .pm files in the lib directory
+my $pms = 0;
+File::Find::find( sub { /\.pm$/ && $pms++ }, 'lib');
+
+my %expected;
+BEGIN {
+
+    %expected = (
+        'Test::NoBreakpoints' => '0.13',
+    );
+
+    use Test::More;
+    our $tests = ((keys %expected) * 2) + 1;
+    eval "use Test::NoWarnings";
+    $tests++ unless( $@ );
+    plan tests => $tests;
+}
+
+# make sure that we are testing the number of .pm files in lib
+is keys %expected, $pms, "$pms version tests planned";
+
+# check each package
+for my $package( keys %expected ) {
+
+    # pull in the package
+    use_ok($package);
+
+    # make sure the package version is correct
+    my $version_var;
+    {
+        no strict 'refs';
+        $version_var = ${$package . '::VERSION'};
+    }
+    is($version_var, $expected{$package},
+        "$package is at version $expected{$package}");
+}
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/02_pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/02_pod.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/02_pod.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/02_pod.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,12 @@
+#
+# $Id: 02_pod.t 137 2004-11-01 15:38:55Z james $
+#
+
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
+
+#
+# EOF
+

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/04_all_perl_files.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/04_all_perl_files.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/04_all_perl_files.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/04_all_perl_files.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,36 @@
+#
+# $Id: 04_all_perl_files.t 163 2004-12-31 05:07:16Z james $
+#
+
+BEGIN {
+    use Test::More;
+    our $tests = 1;
+    eval "use Test::NoWarnings";
+    $tests++ unless( $@ );
+    plan tests => $tests;
+    chdir 't' if -d 't';
+    use lib '../lib', '../blib/lib';
+}
+
+use Test::NoBreakpoints 'all_perl_files';
+use Test::Exception;
+
+# test that all files in the test directory are found properly
+my @expected = sort qw|
+   ./01_use.t
+   ./02_pod.t
+   ./04_all_perl_files.t
+   ./05_no_breakpoints_ok.t
+   ./06_all_files_no_breakpoints_ok.t
+   ./07_deprecated_warnings.t
+   ./08_deprecated.t
+   ./baz/foo.t
+   ./baz/gzonk/foo.pl
+   ./baz/quux/Foo.pm
+|;
+my @gotback = sort( all_perl_files('.') );
+
+is_deeply(\@gotback, \@expected, 'all perl files found');
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/05_no_breakpoints_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/05_no_breakpoints_ok.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/05_no_breakpoints_ok.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/05_no_breakpoints_ok.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,61 @@
+#
+# $Id: 05_no_breakpoints_ok.t 163 2004-12-31 05:07:16Z james $
+#
+
+BEGIN {
+    use Test::Tester 0.09;
+    use Test::More;
+    our $tests = 46;
+    eval "use Test::NoWarnings";
+    $tests++ unless( $@ );
+    plan tests => $tests;
+    chdir 't' if -d 't';
+    use lib '../lib', '../blib/lib';
+}
+
+use Test::NoBreakpoints;
+
+# test the tester for success
+check_test(
+    sub { no_breakpoints_ok('foo') },
+    {
+        ok   => 1,
+        name => 'no breakpoint test of foo',
+    },
+    'no_breakpoints_ok works with implicit name',
+);
+check_test(
+    sub { no_breakpoints_ok('foo', 'yes, we have no breakpoints!') },
+    {
+        ok   => 1,
+        name => 'yes, we have no breakpoints!',
+    },
+    'no_breakpoints_ok works with explicit name',
+);
+
+# test the tester for failure
+my @expected = (
+    '$DB::signal =1',
+    q{$DB'single=4},
+    '$DB::signal= 1',
+    '$DB::single = 3',
+    '$DB::single = 1',
+    q|$DB::single
+=
+1|,
+);
+for my $file( qw|bar1 bar2 bar3 bar4 bar5 bar6| ) {
+    check_test(
+        sub { no_breakpoints_ok($file) },
+        {
+            ok   => 0,
+            name => "no breakpoint test of $file",
+            diag => "breakpoint found in $file: " . shift(@expected) . "\n",
+        },
+        'no_breakpoints_ok finds simple breakpoint',
+    );
+}
+
+#
+# EOF
+

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/06_all_files_no_breakpoints_ok.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/06_all_files_no_breakpoints_ok.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/06_all_files_no_breakpoints_ok.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/06_all_files_no_breakpoints_ok.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,71 @@
+#
+# $Id: 06_all_files_no_breakpoints_ok.t 163 2004-12-31 05:07:16Z james $
+#
+
+BEGIN {
+    use Test::Tester 0.09;
+    use Test::More;
+    our $tests = 27;
+    eval "use Test::NoWarnings";
+    $tests++ unless( $@ );
+    plan tests => $tests;
+    chdir 't' if -d 't';
+    use lib '../lib', '../blib/lib';
+}
+
+use Test::NoBreakpoints ':all';
+
+# test the tester for failure
+check_tests(
+    sub { all_files_no_breakpoints_ok( sort(all_perl_files('.')) ) },
+    [
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./01_use.t',
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./02_pod.t',
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./04_all_perl_files.t',
+        },
+        {
+            ok   => 0,
+            name => 'no breakpoint test of ./05_no_breakpoints_ok.t',
+            diag => 'breakpoint found in ./05_no_breakpoints_ok.t: $DB::signal =1' . "\n",
+        },
+        {
+            ok   => 0,
+            name => 'no breakpoint test of ./06_all_files_no_breakpoints_ok.t',
+            diag => 'breakpoint found in ./06_all_files_no_breakpoints_ok.t: $DB::signal =1' . "\n",
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./07_deprecated_warnings.t',
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./08_deprecated.t',
+        },
+        {
+            ok   => 0,
+            name => 'no breakpoint test of ./baz/foo.t',
+            diag => 'breakpoint found in ./baz/foo.t: $DB::signal = 1' . "\n",
+        },
+        {
+            ok   => 0,
+            name => 'no breakpoint test of ./baz/gzonk/foo.pl',
+            diag => 'breakpoint found in ./baz/gzonk/foo.pl: $DB::single = 2' . "\n",
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./baz/quux/Foo.pm',
+        },
+    ],
+    'all_files_no_breakpoints_ok finds correct breakpoints',
+);
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/07_deprecated_warnings.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/07_deprecated_warnings.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/07_deprecated_warnings.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/07_deprecated_warnings.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,52 @@
+#!/usr/bin/perl
+#
+# $Id: 07_deprecated_warnings.t 163 2004-12-31 05:07:16Z james $
+#
+
+BEGIN {
+    use Test::More;
+    eval "use Test::Warn";
+    plan skip_all => "Test::Warn required for testing deprecation warnings"
+        if $@;
+    our $tests = 12;
+    eval "use Test::NoWarnings";
+    $tests++ unless( $@ );
+    plan tests => $tests;
+    chdir 't' if -d 't';
+    use lib '../lib', '../blib/lib';
+}
+
+use Test::NoBreakpoints ':all';
+
+# make sure our deprecated tests warn when they are used
+warning_like { no_brkpts_ok('foo') }
+    [ qw|deprecated| ],
+    "no_brkpts_ok gives a deprecated warning";
+warning_is { no_brkpts_ok('foo') }
+    "no_brkpts_ok is deprecated (use no_breakpoints_ok instead)",
+    "no_brkpts_ok deprecated warning matches expectations";
+warning_like { all_files_no_brkpts_ok('foo') }
+    [ qw|deprecated| ],
+    "all_files_no_brkpts_ok gives a deprecated warning";
+warning_is { all_files_no_brkpts_ok('foo') }
+    "all_files_no_brkpts_ok is deprecated (use all_files_no_breakpoints_ok instead)",
+    "all_files_no_brkpts_ok deprecated warning matches expectations";
+
+# unless we disable deprecation warnings
+{
+    no warnings 'deprecated';
+
+    warnings_are { no_brkpts_ok('foo') }
+        [],
+        "no_brkpts_ok gives no warnings if deprecated warnings " .
+        "are disabled";
+
+    warnings_are { all_files_no_brkpts_ok('foo') }
+        [],
+        "all_files_no_brkpts_ok gives no warnings if deprecated " .
+        "warnings are disabled";
+        
+}
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/08_deprecated.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/08_deprecated.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/08_deprecated.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/08_deprecated.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,57 @@
+#!/usr/bin/perl
+#
+# $Id: 08_deprecated.t 163 2004-12-31 05:07:16Z james $
+#
+
+use strict;
+use warnings;
+
+no warnings 'deprecated';
+
+BEGIN {
+    use Test::Tester 0.09;
+    use Test::More;
+    our $tests = 17;
+    eval "use Test::NoWarnings";
+    $tests++ unless( $@ );
+    plan tests => $tests;
+    chdir 't' if -d 't';
+    use lib '../lib', '../blib/lib';
+}
+
+use_ok('Test::NoBreakpoints');
+
+# make sure the deprecated names of our tests are exported
+ok( defined &no_brkpts_ok, "no_brkpts_ok defined");
+ok( defined &all_files_no_brkpts_ok, "all_files_no_brkpts_ok defined");
+
+# and that they indeed call the proper functions
+check_test(
+    sub { no_brkpts_ok('foo') },
+    {
+        ok   => 1,
+        name => 'no breakpoint test of foo',
+    },
+    'no_brkpts_ok works like no_breakpoints_ok',
+);
+check_tests(
+    sub { all_files_no_brkpts_ok( qw|./01_use.t ./02_pod.t ./04_all_perl_files.t| ) },
+    [
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./01_use.t',
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./02_pod.t',
+        },
+        {
+            ok   => 1,
+            name => 'no breakpoint test of ./04_all_perl_files.t',
+        },
+    ],
+    'all_fils_no_brkpts_ok works like all_files_no_breakpoints_ok',
+);
+
+#
+# EOF

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/bar1
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/bar1?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/bar1 (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/bar1 Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+$DB::signal =1

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/bar2
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/bar2?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/bar2 (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/bar2 Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+$DB'single=4

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/bar3
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/bar3?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/bar3 (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/bar3 Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+$DB::signal= 1

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/bar4
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/bar4?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/bar4 (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/bar4 Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+$DB::single = 3;

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/bar5
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/bar5?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/bar5 (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/bar5 Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+$DB::single = 1;

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/bar6
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/bar6?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/bar6 (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/bar6 Mon Jan 11 21:10:57 2010
@@ -1,0 +1,3 @@
+$DB::single
+=
+1;

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/baz/foo.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/baz/foo.t?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/baz/foo.t (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/baz/foo.t Mon Jan 11 21:10:57 2010
@@ -1,0 +1,5 @@
+# A sample file with a breakpoint on line 3
+
+$DB::signal = 1;
+
+use Test::More skip_all => 'just a placeholder';

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/baz/gzonk/foo.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/baz/gzonk/foo.pl?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/baz/gzonk/foo.pl (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/baz/gzonk/foo.pl Mon Jan 11 21:10:57 2010
@@ -1,0 +1,2 @@
+A pseudo-script with a breakpoint on line 2
+$DB::single = 2;

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/baz/quux/Foo.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/baz/quux/Foo.pm?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/baz/quux/Foo.pm (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/baz/quux/Foo.pm Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+a pseudo-package without a breakpoint in it.

Added: branches/upstream/libtest-nobreakpoints-perl/current/t/foo
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-nobreakpoints-perl/current/t/foo?rev=50762&op=file
==============================================================================
--- branches/upstream/libtest-nobreakpoints-perl/current/t/foo (added)
+++ branches/upstream/libtest-nobreakpoints-perl/current/t/foo Mon Jan 11 21:10:57 2010
@@ -1,0 +1,1 @@
+a sample file that has no soft breakpoints




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