r18155 - in /branches/upstream/libdevel-backtrace-perl/current: Build.PL Changes META.yml README examples/basic.pl examples/dollarat.pl examples/skipme.pl lib/Devel/Backtrace.pm lib/Devel/Backtrace/Point.pm t/examples.t
roberto at users.alioth.debian.org
roberto at users.alioth.debian.org
Sun Mar 30 19:21:17 UTC 2008
Author: roberto
Date: Sun Mar 30 19:21:16 2008
New Revision: 18155
URL: http://svn.debian.org/wsvn/?sc=1&rev=18155
Log:
[svn-upgrade] Integrating new upstream version, libdevel-backtrace-perl (0.09)
Modified:
branches/upstream/libdevel-backtrace-perl/current/Build.PL
branches/upstream/libdevel-backtrace-perl/current/Changes
branches/upstream/libdevel-backtrace-perl/current/META.yml
branches/upstream/libdevel-backtrace-perl/current/README
branches/upstream/libdevel-backtrace-perl/current/examples/basic.pl
branches/upstream/libdevel-backtrace-perl/current/examples/dollarat.pl
branches/upstream/libdevel-backtrace-perl/current/examples/skipme.pl
branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace.pm
branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace/Point.pm
branches/upstream/libdevel-backtrace-perl/current/t/examples.t
Modified: branches/upstream/libdevel-backtrace-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/Build.PL?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/Build.PL (original)
+++ branches/upstream/libdevel-backtrace-perl/current/Build.PL Sun Mar 30 19:21:16 2008
@@ -9,6 +9,9 @@
license => 'perl',
dist_author => 'Christoph Bussenius <pepe at cpan.org>',
dist_version_from => 'lib/Devel/Backtrace.pm',
+ no_index => {
+ directory => 'example',
+ },
requires => {
'String::Escape' => 0,
'Class::Accessor' => 0,
Modified: branches/upstream/libdevel-backtrace-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/Changes?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/Changes (original)
+++ branches/upstream/libdevel-backtrace-perl/current/Changes Sun Mar 30 19:21:16 2008
@@ -25,3 +25,15 @@
0.07 Thu Mar 27 16:14:03 CET 2008
Some minor changes (nothing in the code).
+
+0.08 Sat Mar 29 18:43:42 CET 2008
+ Added some documentation fixes.
+ Previously, some tests were skipped in perl 5.6. I made them work in
+ 5.6 and don't skip them any more.
+ Previously, a test failed in 5.10 because perl 5.8 and 5.10 sometimes
+ generate different line numbers in error messages. I made the test
+ work (see examples/dollarat.pl).
+
+0.09 Sun Mar 30 16:08:25 CEST 2008
+ Documentation fixes
+ Added version to Devel::Backtrace::Point
Modified: branches/upstream/libdevel-backtrace-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/META.yml?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/META.yml (original)
+++ branches/upstream/libdevel-backtrace-perl/current/META.yml Sun Mar 30 19:21:16 2008
@@ -1,6 +1,6 @@
---
name: Devel-Backtrace
-version: 0.07
+version: 0.09
author:
- 'Christoph Bussenius <pepe at cpan.org>'
abstract: Object-oriented backtrace
@@ -16,12 +16,15 @@
provides:
Devel::Backtrace:
file: lib/Devel/Backtrace.pm
- version: 0.07
+ version: 0.09
Devel::Backtrace::Point:
file: lib/Devel/Backtrace/Point.pm
+ version: 0.09
Devel::DollarAt:
file: lib/Devel/DollarAt.pm
version: 0.02
+no_index:
+ directory: example
generated_by: Module::Build version 0.2807
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
Modified: branches/upstream/libdevel-backtrace-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/README?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/README (original)
+++ branches/upstream/libdevel-backtrace-perl/current/README Sun Mar 30 19:21:16 2008
@@ -2,7 +2,7 @@
Devel::Backtrace - Object-oriented backtrace
VERSION
- This is version 0.07.
+ This is version 0.09.
SYNOPSIS
my $backtrace = Devel::Backtrace->new;
@@ -45,18 +45,19 @@
The effect is similar to what the Carp module does.
This module ships with an example "skipme.pl" that demonstrates how to
- use this method.
+ use this method. See also "EXAMPLES".
$backtrace->skipmysubs([$package])
This method is like "skipme" except that it deletes calls *to* the
- package rather than calls *from* the package. Usually this means that it
- deletes exactly one more tracepoint than "skipme".
+ package rather than calls *from* the package.
Before discarding those calls, "skipme" is called. This is because
usually the topmost call in the stack is to Devel::Backtrace->new, which
would not be catched by "skipmysubs" otherwise.
- See also the example "skipme.pl".
+ This means that skipmysubs usually deletes more lines than skipme would.
+
+ See also "EXAMPLES" and the example "skipme.pl".
$backtrace->to_string()
Returns a string that contains one line for each tracepoint. It will
@@ -78,9 +79,14 @@
EXAMPLES
A sample stringification might look like this:
- Devel::Backtrace::new called from main (foo.pl:10)
+ Devel::Backtrace::new called from MyPackage (foo.pl:30)
+ MyPackage::test2 called from MyPackage (foo.pl:28)
+ MyPackage::test1 called from main (foo.pl:18)
main::bar called from main (foo.pl:6)
main::foo called from main (foo.pl:13)
+
+ If MyPackage called skipme, the first two lines would be removed. If it
+ called skipmysubs, the first three lines would be removed.
SEE ALSO
Devel::StackTrace does mostly the same as this module. I'm afraid I
Modified: branches/upstream/libdevel-backtrace-perl/current/examples/basic.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/examples/basic.pl?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/examples/basic.pl (original)
+++ branches/upstream/libdevel-backtrace-perl/current/examples/basic.pl Sun Mar 30 19:21:16 2008
@@ -37,21 +37,21 @@
Output:
First backtrace:
-Devel::Backtrace::new called from main (basic.pl:12)
-main::bar called from main (basic.pl:8)
-main::foo called from main (basic.pl:33)
+Devel::Backtrace::new called from main (examples/basic.pl:12)
+main::bar called from main (examples/basic.pl:8)
+main::foo called from main (examples/basic.pl:33)
Second (shorter) backtrace:
-main::bar called from main (basic.pl:8)
-main::foo called from main (basic.pl:33)
+main::bar called from main (examples/basic.pl:8)
+main::foo called from main (examples/basic.pl:33)
Third (even shorter) backtrace:
-main::foo called from main (basic.pl:33)
+main::foo called from main (examples/basic.pl:33)
The third backtrace in a very long form:
(Note that the bitmask may depend on the perl version.)
package: main
-filename: basic.pl
+filename: examples/basic.pl
line: 33
subroutine: main::foo
hasargs: 1
Modified: branches/upstream/libdevel-backtrace-perl/current/examples/dollarat.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/examples/dollarat.pl?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/examples/dollarat.pl (original)
+++ branches/upstream/libdevel-backtrace-perl/current/examples/dollarat.pl Sun Mar 30 19:21:16 2008
@@ -3,7 +3,10 @@
use warnings;
use Devel::DollarAt;
-eval '0/0';
+eval '0/0; "foo"';
+
+# Don't worry about the "foo"; it serves to make perl 5.8 and 5.10 output the
+# same line number so I can use this example in the tests.
print "Error line is ", $@->line, "\n";
print "Error text is $@";
@@ -12,5 +15,5 @@
Output:
-Error line is 2
-Error text is Illegal division by zero at (eval 3) line 2.
+Error line is 1
+Error text is Illegal division by zero at (eval 3) line 1.
Modified: branches/upstream/libdevel-backtrace-perl/current/examples/skipme.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/examples/skipme.pl?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/examples/skipme.pl (original)
+++ branches/upstream/libdevel-backtrace-perl/current/examples/skipme.pl Sun Mar 30 19:21:16 2008
@@ -68,14 +68,14 @@
Output:
skipme result:
-Baz::baz1 called from Bar (skipme.pl:30)
-Bar::bar2 called from Bar (skipme.pl:26)
-Bar::bar1 called from Foo (skipme.pl:18)
-Foo::foo2 called from Foo (skipme.pl:14)
-Foo::foo1 called from main (skipme.pl:8)
+Baz::baz1 called from Bar (examples/skipme.pl:30)
+Bar::bar2 called from Bar (examples/skipme.pl:26)
+Bar::bar1 called from Foo (examples/skipme.pl:18)
+Foo::foo2 called from Foo (examples/skipme.pl:14)
+Foo::foo1 called from main (examples/skipme.pl:8)
skipmycalls result:
-Bar::bar2 called from Bar (skipme.pl:26)
-Bar::bar1 called from Foo (skipme.pl:18)
-Foo::foo2 called from Foo (skipme.pl:14)
-Foo::foo1 called from main (skipme.pl:8)
+Bar::bar2 called from Bar (examples/skipme.pl:26)
+Bar::bar1 called from Foo (examples/skipme.pl:18)
+Foo::foo2 called from Foo (examples/skipme.pl:14)
+Foo::foo1 called from main (examples/skipme.pl:8)
Modified: branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace.pm?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace.pm (original)
+++ branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace.pm Sun Mar 30 19:21:16 2008
@@ -11,11 +11,11 @@
=head1 VERSION
-This is version 0.07.
-
-=cut
-
-our $VERSION = '0.07';
+This is version 0.09.
+
+=cut
+
+our $VERSION = '0.09';
=head1 SYNOPSIS
@@ -96,7 +96,7 @@
The effect is similar to what the L<Carp> module does.
This module ships with an example "skipme.pl" that demonstrates how to use this
-method.
+method. See also L</EXAMPLES>.
=cut
@@ -114,14 +114,15 @@
=head2 $backtrace->skipmysubs([$package])
This method is like C<skipme> except that it deletes calls I<to> the package
-rather than calls I<from> the package. Usually this means that it deletes
-exactly one more tracepoint than C<skipme>.
+rather than calls I<from> the package.
Before discarding those calls, C<skipme> is called. This is because usually
the topmost call in the stack is to Devel::Backtrace->new, which would not be
catched by C<skipmysubs> otherwise.
-See also the example "skipme.pl".
+This means that skipmysubs usually deletes more lines than skipme would.
+
+See also L</EXAMPLES> and the example "skipme.pl".
=cut
@@ -178,9 +179,14 @@
A sample stringification might look like this:
- Devel::Backtrace::new called from main (foo.pl:10)
+ Devel::Backtrace::new called from MyPackage (foo.pl:30)
+ MyPackage::test2 called from MyPackage (foo.pl:28)
+ MyPackage::test1 called from main (foo.pl:18)
main::bar called from main (foo.pl:6)
main::foo called from main (foo.pl:13)
+
+If MyPackage called skipme, the first two lines would be removed. If it called
+skipmysubs, the first three lines would be removed.
=head1 SEE ALSO
Modified: branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace/Point.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace/Point.pm?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace/Point.pm (original)
+++ branches/upstream/libdevel-backtrace-perl/current/lib/Devel/Backtrace/Point.pm Sun Mar 30 19:21:16 2008
@@ -1,6 +1,7 @@
package Devel::Backtrace::Point;
use strict;
use warnings;
+our $VERSION = '0.09';
use Carp;
use String::Escape qw(printable);
Modified: branches/upstream/libdevel-backtrace-perl/current/t/examples.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdevel-backtrace-perl/current/t/examples.t?rev=18155&op=diff
==============================================================================
--- branches/upstream/libdevel-backtrace-perl/current/t/examples.t (original)
+++ branches/upstream/libdevel-backtrace-perl/current/t/examples.t Sun Mar 30 19:21:16 2008
@@ -10,11 +10,13 @@
BEGIN {
# Several arguments for open, "-|" needed.
# This will only work on non-windows, perl >= 5.8.0
+ # Update: Now I trick around that, thus making it work on perl 5.6. Dunno
+ # if it works on windows though.
$^O =~ /MSWin32/i
and plan skip_all => 'This test requires an operating system.';
- local $@;
- eval 'use 5.008_000; 1'
- or plan skip_all => "This test won't work on your perl version.";
+ #local $@;
+ #eval 'use 5.008_000; 1'
+ # or plan skip_all => "This test won't work on your perl version.";
}
use File::Spec;
@@ -23,15 +25,25 @@
if (! -d $exampledir) {
$exampledir = File::Spec->catfile('..', $exampledir);
}
-chdir($exampledir) or die "$exampledir: $!";
-my @examples = <*.pl>;
+my @examples = <$exampledir/*.pl>;
+
+die "No examples found in $exampledir." unless @examples;
plan tests => scalar(@examples);
for my $example (@examples) {
- open my $pipe, '-|', $^X, $example
- or die "run $example: $!";
+ # Won't work on perl 5.6:
+ # open my $pipe, '-|', $^X, $example
+ # or die "run $example: $!";
+
+ my $pid = open my $pipe, '-|';
+ die $! unless defined $pid;
+ if (0 == $pid) {
+ exec ($^X, $example);
+ die $!;
+ }
+
my $output = do {local $/; <$pipe>};
die $! unless defined $output;
close $pipe or die "$example: exited $?";
More information about the Pkg-perl-cvs-commits
mailing list