Hello community,
here is the log from the commit of package perl-Devel-Confess for
openSUSE:Factory checked in at 2015-06-30 10:18:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Devel-Confess (Old)
and /work/SRC/openSUSE:Factory/.perl-Devel-Confess.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Devel-Confess"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Devel-Confess/perl-Devel-Confess.changes
2015-04-18 10:40:16.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Devel-Confess.new/perl-Devel-Confess.changes
2015-06-30 10:18:23.000000000 +0200
@@ -1,0 +2,16 @@
+Sat Jun 27 08:29:54 UTC 2015 - [email protected]
+
+- updated to 0.008000
+ see /usr/share/doc/packages/perl-Devel-Confess/Changes
+
+ 0.008000 - 2015-06-26
+ - if dump option is used, bare references and objects without stringify
+ overloads will be dumpered when being output to the screen
+ - stack trace properly attached to bare references are rethrown and will be
+ output to the screen
+ - avoid Test::More in threads test to limit code run as much as possible
+ - other test cleanups
+ - fix DEBUGGING detection in newer perls
+ - protect tests against DEVEL_CONFESS_OPTIONS set in environment
+
+-------------------------------------------------------------------
Old:
----
Devel-Confess-0.007012.tar.gz
New:
----
Devel-Confess-0.008000.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Devel-Confess.spec ++++++
--- /var/tmp/diff_new_pack.vWgjBa/_old 2015-06-30 10:18:24.000000000 +0200
+++ /var/tmp/diff_new_pack.vWgjBa/_new 2015-06-30 10:18:24.000000000 +0200
@@ -17,7 +17,7 @@
Name: perl-Devel-Confess
-Version: 0.007012
+Version: 0.008000
Release: 0
%define cpan_name Devel-Confess
Summary: Include stack traces on all warnings and errors
@@ -43,13 +43,13 @@
will also be made to include stack traces.
# it works for explicit die's and warn's
- $ perl -MDevel::Confess -e 'sub f { die "arghh" }; sub g { f }; g'
+ $ perl -d:Confess -e 'sub f { die "arghh" }; sub g { f }; g'
arghh at -e line 1.
main::f() called at -e line 1
main::g() called at -e line 1
# it works for interpreter-thrown failures
- $ perl -MDevel::Confess -w -e 'sub f { $a = shift; @a = @$a };' \
+ $ perl -d:Confess -w -e 'sub f { $a = shift; @a = @$a };' \
-e 'sub g { f(undef) }; g'
Use of uninitialized value $a in array dereference at -e line 1.
main::f(undef) called at -e line 2
++++++ Devel-Confess-0.007012.tar.gz -> Devel-Confess-0.008000.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/Changes
new/Devel-Confess-0.008000/Changes
--- old/Devel-Confess-0.007012/Changes 2015-03-30 22:56:43.000000000 +0200
+++ new/Devel-Confess-0.008000/Changes 2015-06-26 08:53:47.000000000 +0200
@@ -1,5 +1,15 @@
Release history for Devel-Confess
+0.008000 - 2015-06-26
+ - if dump option is used, bare references and objects without stringify
+ overloads will be dumpered when being output to the screen
+ - stack trace properly attached to bare references are rethrown and will be
+ output to the screen
+ - avoid Test::More in threads test to limit code run as much as possible
+ - other test cleanups
+ - fix DEBUGGING detection in newer perls
+ - protect tests against DEVEL_CONFESS_OPTIONS set in environment
+
0.007012 - 2015-03-30
- avoid re-throwing errors during END on debugging perls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/MANIFEST
new/Devel-Confess-0.008000/MANIFEST
--- old/Devel-Confess-0.007012/MANIFEST 2015-03-30 22:57:07.000000000 +0200
+++ new/Devel-Confess-0.008000/MANIFEST 2015-06-26 08:54:08.000000000 +0200
@@ -14,6 +14,7 @@
t/global-destruct.t
t/leak.t
t/lib/capture.pm
+t/lib/test.pm
t/lib/threads_check.pm
t/names.t
t/safe.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/META.json
new/Devel-Confess-0.008000/META.json
--- old/Devel-Confess-0.007012/META.json 2015-03-30 22:57:07.000000000
+0200
+++ new/Devel-Confess-0.008000/META.json 2015-06-26 08:54:08.000000000
+0200
@@ -4,7 +4,7 @@
"haarg - Graham Knop (cpan:HAARG) <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter
version 2.143240",
+ "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150001",
"license" : [
"perl_5"
],
@@ -65,5 +65,5 @@
"web" : "https://github.com/haarg/Devel-Confess"
}
},
- "version" : "0.007012"
+ "version" : "0.008000"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/META.yml
new/Devel-Confess-0.008000/META.yml
--- old/Devel-Confess-0.007012/META.yml 2015-03-30 22:57:07.000000000 +0200
+++ new/Devel-Confess-0.008000/META.yml 2015-06-26 08:54:08.000000000 +0200
@@ -8,7 +8,7 @@
configure_requires:
ExtUtils::MakeMaker: '0'
dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.04, CPAN::Meta::Converter version
2.143240'
+generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter
version 2.150001'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -26,4 +26,4 @@
bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-Confess
license: http://dev.perl.org/licenses/
repository: git://github.com/haarg/Devel-Confess
-version: '0.007012'
+version: '0.008000'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/README
new/Devel-Confess-0.008000/README
--- old/Devel-Confess-0.007012/README 2015-03-30 22:57:07.000000000 +0200
+++ new/Devel-Confess-0.008000/README 2015-06-26 08:54:08.000000000 +0200
@@ -5,11 +5,11 @@
Use on the command line:
# Make every warning and error include a full stack trace
- perl -MDevel::Confess script.pl
-
- # equivalent short form
perl -d:Confess script.pl
+ # Also usable as a module
+ perl -MDevel::Confess script.pl
+
# display warnings in yellow and errors in red
perl -d:Confess=color script.pl
@@ -37,13 +37,13 @@
to include stack traces.
# it works for explicit die's and warn's
- $ perl -MDevel::Confess -e 'sub f { die "arghh" }; sub g { f }; g'
+ $ perl -d:Confess -e 'sub f { die "arghh" }; sub g { f }; g'
arghh at -e line 1.
main::f() called at -e line 1
main::g() called at -e line 1
# it works for interpreter-thrown failures
- $ perl -MDevel::Confess -w -e 'sub f { $a = shift; @a = @$a };' \
+ $ perl -d:Confess -w -e 'sub f { $a = shift; @a = @$a };' \
-e 'sub g { f(undef) }; g'
Use of uninitialized value $a in array dereference at -e line 1.
main::f(undef) called at -e line 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/lib/Devel/Confess/Builtin.pm
new/Devel-Confess-0.008000/lib/Devel/Confess/Builtin.pm
--- old/Devel-Confess-0.007012/lib/Devel/Confess/Builtin.pm 2015-03-30
22:56:34.000000000 +0200
+++ new/Devel-Confess-0.008000/lib/Devel/Confess/Builtin.pm 2015-06-26
08:53:20.000000000 +0200
@@ -3,7 +3,7 @@
use warnings FATAL => 'all';
no warnings 'once';
-our $VERSION = '0.007012';
+our $VERSION = '0.008000';
$VERSION = eval $VERSION;
use Devel::Confess::_Util ();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/lib/Devel/Confess/_Util.pm
new/Devel-Confess-0.008000/lib/Devel/Confess/_Util.pm
--- old/Devel-Confess-0.007012/lib/Devel/Confess/_Util.pm 2015-03-30
20:53:22.000000000 +0200
+++ new/Devel-Confess-0.008000/lib/Devel/Confess/_Util.pm 2015-06-26
08:08:53.000000000 +0200
@@ -6,7 +6,7 @@
use base 'Exporter';
-our @EXPORT = qw(blessed refaddr weaken longmess _str_val _in_END);
+our @EXPORT = qw(blessed refaddr weaken longmess _str_val _in_END
_can_stringify);
use Carp ();
use Carp::Heavy ();
@@ -88,9 +88,9 @@
};
} || eval q{
sub {
- my $class = blessed($_[0]);
+ my $class = &blessed;
return "$_[0]" unless defined $class;
- return sprintf("%s=%s(0x%x)", &blessed, &reftype, &refaddr);
+ return sprintf("%s=%s(0x%x)", $class, &reftype, &refaddr);
};
};
@@ -151,4 +151,30 @@
}
}
+if ($] < 5.008) {
+ eval q{
+ sub _can_stringify () {
+ my $i = 0;
+ while (my @caller = caller($i++)) {
+ if ($caller[3] eq '(eval)') {
+ return 0;
+ }
+ elsif ($caller[7]) {
+ return 0;
+ }
+ }
+ return 1;
+ }
+ 1;
+ } or die $@;
+}
+else {
+ eval q{
+ sub _can_stringify () {
+ defined $^S && !$^S;
+ }
+ 1;
+ } or die $@;
+}
+
1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/lib/Devel/Confess.pm
new/Devel-Confess-0.008000/lib/Devel/Confess.pm
--- old/Devel-Confess-0.007012/lib/Devel/Confess.pm 2015-03-30
22:56:34.000000000 +0200
+++ new/Devel-Confess-0.008000/lib/Devel/Confess.pm 2015-06-26
08:53:20.000000000 +0200
@@ -16,12 +16,12 @@
use warnings;
no warnings 'once';
-our $VERSION = '0.007012';
+our $VERSION = '0.008000';
$VERSION = eval $VERSION;
use Carp ();
use Symbol ();
-use Devel::Confess::_Util qw(blessed refaddr weaken longmess _str_val _in_END);
+use Devel::Confess::_Util qw(blessed refaddr weaken longmess _str_val _in_END
_can_stringify);
use Config ();
BEGIN {
*_can = \&UNIVERSAL::can;
@@ -32,11 +32,12 @@
= ($] > 5.008009 && $] <= 5.010000) ? sub () { 1 } : sub () { 0 };
*_BROKEN_SIG_DELETE
= ($] < 5.008008) ? sub () { 1 } : sub () { 0 };
- my $debugging = defined &Config::non_bincompat_options
- ? (Config::non_bincompat_options() =~ /\bDEBUGGING\b/)
- : ($Config::Config{ccflags} =~ /-DDEBUGGING\b/);
*_DEBUGGING
- = $debugging ? sub () { 1 } : sub () { 0 };
+ = (
+ defined &Config::non_bincompat_options
+ ? (grep $_ eq 'DEBUGGING', Config::non_bincompat_options())
+ : ($Config::Config{ccflags} =~ /-DDEBUGGING\b/)
+ ) ? sub () { 1 } : sub () { 0 };
}
$Carp::Internal{+__PACKAGE__}++;
@@ -155,6 +156,7 @@
my $sig = $_[0];
return undef
if !defined $sig;
+ local $@;
return $sig
if ref $sig && eval { \&{$sig} };
return undef
@@ -168,11 +170,12 @@
sub _warn {
local $SIG{__WARN__};
my @convert = _convert(@_);
- if (my $warn = _find_sig($OLD_SIG{__WARN__})) {
- $warn->(join('', @convert));
+ if (my $sig = _find_sig($OLD_SIG{__WARN__})) {
+ $sig->(ref $convert[0] ? $convert[0] : join('', @convert));
}
else {
- _colorize(\@convert, 33) if $OPTIONS{color};
+ @convert = _ex_as_strings(@convert);
+ @convert = _colorize(33, @convert) if $OPTIONS{color};
warn @convert;
}
}
@@ -180,32 +183,29 @@
local $SIG{__DIE__};
my @convert = _convert(@_);
if (my $sig = _find_sig($OLD_SIG{__DIE__})) {
- $sig->(join('', @convert));
+ $sig->(ref $convert[0] ? $convert[0] : join('', @convert));
}
- _colorize(\@convert, 31) if $OPTIONS{color} && !$^S;
+ @convert = _ex_as_strings(@convert) if _can_stringify;
+ @convert = _colorize(31, @convert) if $OPTIONS{color} && _can_stringify;
if (_DEBUGGING && _in_END) {
local $SIG{__WARN__};
warn @convert;
$! ||= 1;
return;
}
- die @convert;
+ die @convert unless ref $convert[0];
}
sub _colorize {
- my ($convert, $color) = @_;
+ my ($color, @convert) = @_;
if ($ENV{DEVEL_CONFESS_FORCE_COLOR} || -t *STDERR) {
- if (blessed $convert->[0]) {
- if ($convert->[0]->isa('Devel::Confess::_Attached')) {
- splice @$convert, 0, 1, _ex_as_strings($convert->[0]);
- }
- else {
- $convert->[0] =~ s/(.*)/\e[${color}m$1\e[m/;
- return;
- }
+ if (@convert == 1) {
+ $convert[0] = s/(.*)//;
+ unshift @convert, $1;
}
- $convert->[0] = "\e[${color}m$convert->[0]\e[m";
+ $convert[0] = "\e[${color}m$convert[0]\e[m";
}
+ return @convert;
}
sub _ref_formatter {
@@ -319,7 +319,7 @@
}
bless $ex, $newclass;
- $ex;
+ return $ex;
}
elsif (ref($ex = $_[0])) {
my $id = refaddr($ex);
@@ -330,7 +330,7 @@
$PACKAGES{$id} = undef;
$MESSAGES{$id} ||= $message;
- return ($^S ? @_ : ( @_, $message ));
+ return $ex;
}
elsif ((caller(1))[0] eq 'Carp') {
my $out = join('', @_);
@@ -359,13 +359,29 @@
sub _ex_as_strings {
my $ex = $_[0];
+ return @_
+ unless ref $ex;
my $id = refaddr($ex);
my $class = $PACKAGES{$id};
my $message = $MESSAGES{$id};
- my $newclass = ref $ex;
- bless $ex, $class;
- my $out = "$ex";
- bless $ex, $newclass;
+ my $out;
+ if (blessed $ex) {
+ my $newclass = ref $ex;
+ bless $ex, $class if $class;
+ if ($OPTIONS{dump} && !overload::OverloadedStringify($ex)) {
+ $out = _ref_formatter($ex);
+ }
+ else {
+ $out = "$ex";
+ }
+ bless $ex, $newclass if $class;
+ }
+ elsif ($OPTIONS{dump}) {
+ $out = _ref_formatter($ex);
+ }
+ else {
+ $out = "$ex";
+ }
return ($out, $message);
}
@@ -445,11 +461,11 @@
Use on the command line:
# Make every warning and error include a full stack trace
- perl -MDevel::Confess script.pl
-
- # equivalent short form
perl -d:Confess script.pl
+ # Also usable as a module
+ perl -MDevel::Confess script.pl
+
# display warnings in yellow and errors in red
perl -d:Confess=color script.pl
@@ -478,13 +494,13 @@
include stack traces.
# it works for explicit die's and warn's
- $ perl -MDevel::Confess -e 'sub f { die "arghh" }; sub g { f }; g'
+ $ perl -d:Confess -e 'sub f { die "arghh" }; sub g { f }; g'
arghh at -e line 1.
main::f() called at -e line 1
main::g() called at -e line 1
# it works for interpreter-thrown failures
- $ perl -MDevel::Confess -w -e 'sub f { $a = shift; @a = @$a };' \
+ $ perl -d:Confess -w -e 'sub f { $a = shift; @a = @$a };' \
-e 'sub g { f(undef) }; g'
Use of uninitialized value $a in array dereference at -e line 1.
main::f(undef) called at -e line 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/color.t
new/Devel-Confess-0.008000/t/color.t
--- old/Devel-Confess-0.007012/t/color.t 2014-12-21 07:30:59.000000000
+0100
+++ new/Devel-Confess-0.008000/t/color.t 2015-06-26 06:28:49.000000000
+0200
@@ -1,7 +1,10 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Test::More;
-use t::lib::capture;
+use t::lib::capture capture_color => ['-MDevel::Confess=color'];
if ($^O eq 'MSWin32') {
plan skip_all => 'color option requires Win32::Console::ANSI in Windows'
@@ -36,8 +39,7 @@
END_OUTPUT
{
- local @CAPTURE_OPTS = ('-MDevel::Confess=color');
- my $out = capture $code;
+ my $out = capture_color $code;
is $out, $expected, 'error message properly colorized';
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/confess.t
new/Devel-Confess-0.008000/t/confess.t
--- old/Devel-Confess-0.007012/t/confess.t 2014-07-16 00:58:05.000000000
+0200
+++ new/Devel-Confess-0.008000/t/confess.t 2015-06-26 08:09:37.000000000
+0200
@@ -1,9 +1,10 @@
use strict;
use warnings;
-use Test::More tests => 20;
-use t::lib::capture;
-
-@CAPTURE_OPTS = ('-MDevel::Confess');
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
+use Test::More tests => 32;
+use t::lib::capture capture => ['-MDevel::Confess'];
is capture <<'END_CODE', <<'END_OUTPUT', 'basic test';
package A;
@@ -96,7 +97,7 @@
main::bar() called at test-block.pl line 3
END_OUTPUT
- like capture <<"END_CODE", qr/${\<<'END_OUTPUT'}/, "$type with object";
+ like capture <<"END_CODE", qr/\A${\<<'END_OUTPUT'}\z/, "$type with object";
use Carp;
sub foo {
#line 1 test-block.pl
@@ -126,7 +127,56 @@
main::foo() called at test-block.pl line 2
END_OUTPUT
- like capture <<"END_CODE", qr/${\<<'END_OUTPUT'}/, "$type with non-object
ref";
+ {
+ local $ENV{DEVEL_CONFESS_OPTIONS} = 'dump';
+
+ like capture <<"END_CODE", qr/\A${\<<'END_OUTPUT'}\z/, "$type with object
+ dump";
+use Carp;
+sub foo {
+#line 1 test-block.pl
+ $type bless {}, 'NoOverload';
+}
+#line 2 test-block.pl
+foo();
+END_CODE
+bless\( \{\}, 'NoOverload' \) at test-block\.pl line 1\.
+ main::foo\(\) called at test-block\.pl line 2
+END_OUTPUT
+
+ is capture <<"END_CODE", <<'END_OUTPUT', "$type with object with overload
+ dump";
+use Carp;
+{
+ package HasOverload;
+ use overload '""' => sub { "message" };
+}
+sub foo {
+#line 1 test-block.pl
+ $type bless {}, 'HasOverload';
+}
+#line 2 test-block.pl
+foo();
+END_CODE
+message at test-block.pl line 1.
+ main::foo() called at test-block.pl line 2
+END_OUTPUT
+ }
+
+
+ like capture <<"END_CODE", qr/\A${\<<'END_OUTPUT'}\z/, "$type with
non-object ref";
+use Carp;
+sub foo {
+#line 1 test-block.pl
+ $type [1];
+}
+#line 2 test-block.pl
+foo();
+END_CODE
+ARRAY\(0x\w+\) at test-block\.pl line 1\.
+ main::foo\(\) called at test-block\.pl line 2
+END_OUTPUT
+
+ local $ENV{DEVEL_CONFESS_OPTIONS} = 'dump';
+ like capture <<"END_CODE", qr/\A${\<<'END_OUTPUT'}\z/, "$type with
non-object ref + dump";
use Carp;
sub foo {
#line 1 test-block.pl
@@ -135,8 +185,25 @@
#line 2 test-block.pl
foo();
END_CODE
-^ARRAY\(0x\w+\) at test-block\.pl line 1\.
+\[1\] at test-block\.pl line 1\.
+ main::foo\(\) called at test-block\.pl line 2
+END_OUTPUT
+
+ like capture <<"END_CODE", qr/\A${\<<'END_OUTPUT'}\z/, "$type rethrowing
non-object ref + dump";
+use Carp;
+sub foo {
+#line 1 test-block.pl
+ $type [1];
+}
+#line 2 test-block.pl
+eval { foo() };
+print STDERR \$@ . "\n";
+die;
+END_CODE
+ARRAY\(0x\w+\)
+\[1\] at test-block\.pl line 1\.
main::foo\(\) called at test-block\.pl line 2
+ eval \{...\} called at test-block.pl line 2
END_OUTPUT
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/devel.t
new/Devel-Confess-0.008000/t/devel.t
--- old/Devel-Confess-0.007012/t/devel.t 2014-07-16 00:58:05.000000000
+0200
+++ new/Devel-Confess-0.008000/t/devel.t 2015-06-26 06:28:33.000000000
+0200
@@ -1,7 +1,13 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Test::More tests => 2;
-use t::lib::capture;
+use t::lib::capture
+ capture_as_debugger => ['-d:Confess'],
+ capture_with_debugger => ['-d', '-MDevel::Confess'],
+;
use Cwd qw(cwd);
my $code = <<'END_CODE';
@@ -31,21 +37,18 @@
END_OUTPUT
{
- local @CAPTURE_OPTS = ('-d:Confess');
- my $out = capture $code;
+ my $out = capture_as_debugger $code;
$out =~ s/\A.*?^started\s+//ms;
is $out, $expected, 'Devel::Confess usable as a debugger';
}
{
- local @CAPTURE_OPTS = ('-d', '-MDevel::Confess');
-
local %ENV = %ENV;
delete $ENV{$_} for grep /^PERL5?DB/, keys %ENV;
delete $ENV{LOGDIR};
$ENV{HOME} = cwd;
$ENV{PERLDB_OPTS} = 'NonStop noTTY dieLevel=1';
- my $out = capture $code;
+ my $out = capture_with_debugger $code;
$out =~ s/\A.*?^started\s+//ms;
like $out, qr/^\Q$expected/, 'Devel::Confess usable with the debugger';
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/dump.t
new/Devel-Confess-0.008000/t/dump.t
--- old/Devel-Confess-0.007012/t/dump.t 2014-07-16 00:58:05.000000000 +0200
+++ new/Devel-Confess-0.008000/t/dump.t 2015-06-26 06:28:45.000000000 +0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Carp ();
use Test::More defined &Carp::format_arg
? (tests => 5)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/end-debugging.t
new/Devel-Confess-0.008000/t/end-debugging.t
--- old/Devel-Confess-0.007012/t/end-debugging.t 2015-03-30
20:53:22.000000000 +0200
+++ new/Devel-Confess-0.008000/t/end-debugging.t 2015-06-26
06:28:26.000000000 +0200
@@ -1,9 +1,10 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Test::More tests => 1;
-use t::lib::capture;
-
-@CAPTURE_OPTS = ('-MDevel::Confess');
+use t::lib::capture capture => ['-MDevel::Confess'];
unlike capture <<"END_CODE", qr/Assertion failed/, "die in END";
sub error {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/global-destruct.t
new/Devel-Confess-0.008000/t/global-destruct.t
--- old/Devel-Confess-0.007012/t/global-destruct.t 2015-01-19
19:35:20.000000000 +0100
+++ new/Devel-Confess-0.008000/t/global-destruct.t 2015-06-26
06:28:21.000000000 +0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
no warnings 'once';
use Devel::Confess;
use POSIX ();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/leak.t
new/Devel-Confess-0.008000/t/leak.t
--- old/Devel-Confess-0.007012/t/leak.t 2015-01-24 18:54:54.000000000 +0100
+++ new/Devel-Confess-0.008000/t/leak.t 2015-06-26 08:40:11.000000000 +0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Scalar::Util;
use Test::More
defined &Scalar::Util::weaken ? (tests => 4)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/lib/capture.pm
new/Devel-Confess-0.008000/t/lib/capture.pm
--- old/Devel-Confess-0.007012/t/lib/capture.pm 2015-03-10 17:20:51.000000000
+0100
+++ new/Devel-Confess-0.008000/t/lib/capture.pm 2015-05-28 06:49:19.000000000
+0200
@@ -5,15 +5,27 @@
use File::Temp qw(tempfile);
use IPC::Open3;
use File::Spec;
-use base qw(Exporter);
-our @EXPORT = qw(capture *CAPTURE_OPTS);
-
-our @CAPTURE_OPTS;
my @PERL5OPTS = map "-I$_", @INC;
-sub capture ($) {
- my ($code) = @_;
+sub import {
+ my $class = shift;
+ my $target = caller;
+ my @args = @_ ? @_ : 'capture';
+ while (my $sub = shift @args) {
+ die "bad option: $sub"
+ if ref $sub;
+ my @opts;
+ @opts = @{ shift @args }
+ if ref $args[0];
+ my $export = sub ($) { _capture($_[0], @opts) };
+ no strict 'refs';
+ *{"${target}::${sub}"} = $export;
+ }
+}
+
+sub _capture {
+ my ($code, @opts) = @_;
my ($fh, $filename) = tempfile()
or die "can't open temp file: $!";
@@ -21,7 +33,7 @@
close $fh;
open my $in, '<', File::Spec->devnull or die "can't open null: $!";
- open3( $in, my $out, undef, $^X, @PERL5OPTS, @CAPTURE_OPTS, $filename)
+ open3( $in, my $out, undef, $^X, @PERL5OPTS, @opts, $filename)
or die "Couldn't open subprocess: $!\n";
my $output = do { local $/; <$out> };
close $in;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/lib/test.pm
new/Devel-Confess-0.008000/t/lib/test.pm
--- old/Devel-Confess-0.007012/t/lib/test.pm 1970-01-01 01:00:00.000000000
+0100
+++ new/Devel-Confess-0.008000/t/lib/test.pm 2015-05-29 00:27:20.000000000
+0200
@@ -0,0 +1,61 @@
+package t::lib::test;
+use strict;
+use warnings;
+
+my $done;
+my $tests = 0;
+my $failed = 0;
+
+END {
+ die "done_testing not seen!"
+ if !$done;
+ $? ||= $failed;
+}
+
+sub is ($$;$) {
+ my ($got, $want, $message) = @_;
+
+ $_ = defined $_ ? qq{'$_'} : 'undef'
+ for $got, $want;
+
+ ok ($got eq $want, $message) or do {
+ s/\n/\n# /g
+ for $got, $want;
+ print STDERR "# Failed test" . ($message ? " '$message'" : '') . "\n";
+ print STDERR "# got: $got\n";
+ print STDERR "# expected: $want\n";
+ return !!0;
+ };
+}
+
+sub ok ($;$) {
+ my ($ok, $message) = @_;
+ $tests++;
+ if (!$ok) {
+ print 'not ';
+ $failed++;
+ }
+ print "ok $tests";
+ print " - $message"
+ if defined $message && length $message;
+ print "\n";
+ return $ok;
+}
+
+sub done_testing (;$) {
+ if (@_) {
+ die "tests done ($tests) doesn't match tests planned ($_[0])"
+ if $tests != $_[0];
+ }
+ $done = 1;
+ print "1..$tests\n";
+}
+
+sub import {
+ my $target = caller;
+ no strict 'refs';
+ *{"${target}::$_"} = \&$_
+ for qw(is ok done_testing);
+}
+
+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/names.t
new/Devel-Confess-0.008000/t/names.t
--- old/Devel-Confess-0.007012/t/names.t 2015-01-28 21:01:49.000000000
+0100
+++ new/Devel-Confess-0.008000/t/names.t 2015-06-26 06:28:06.000000000
+0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Devel::Confess ();
use Test::More
Devel::Confess::_CAN_USE_INFORMATIVE_NAMES ? (tests => 2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/safe.t
new/Devel-Confess-0.008000/t/safe.t
--- old/Devel-Confess-0.007012/t/safe.t 2015-01-26 05:23:44.000000000 +0100
+++ new/Devel-Confess-0.008000/t/safe.t 2015-06-26 06:28:13.000000000 +0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Test::More tests => 3;
use Safe;
use Devel::Confess ();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/sig.t
new/Devel-Confess-0.008000/t/sig.t
--- old/Devel-Confess-0.007012/t/sig.t 2015-01-28 17:31:56.000000000 +0100
+++ new/Devel-Confess-0.008000/t/sig.t 2015-06-26 06:29:28.000000000 +0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Test::More tests => 12;
use t::lib::capture;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/source.t
new/Devel-Confess-0.008000/t/source.t
--- old/Devel-Confess-0.007012/t/source.t 2014-07-16 00:58:05.000000000
+0200
+++ new/Devel-Confess-0.008000/t/source.t 2015-06-26 06:29:27.000000000
+0200
@@ -1,5 +1,8 @@
use strict;
use warnings;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
use Test::More tests => 3;
use Devel::Confess qw(source);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/t/threads.t
new/Devel-Confess-0.008000/t/threads.t
--- old/Devel-Confess-0.007012/t/threads.t 2015-01-26 04:20:41.000000000
+0100
+++ new/Devel-Confess-0.008000/t/threads.t 2015-06-26 06:29:24.000000000
+0200
@@ -2,7 +2,12 @@
use threads;
use strict;
use warnings;
-use Test::More tests => 3;
+BEGIN {
+ $ENV{DEVEL_CONFESS_OPTIONS} = '';
+}
+
+use t::lib::test;
+
use Devel::Confess;
my $gone = 0;
@@ -60,3 +65,5 @@
ok $cleared,
'cloned exception cleans up namespace when destroyed';
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Devel-Confess-0.007012/xt/builtin.t
new/Devel-Confess-0.008000/xt/builtin.t
--- old/Devel-Confess-0.007012/xt/builtin.t 2013-11-09 07:23:58.000000000
+0100
+++ new/Devel-Confess-0.008000/xt/builtin.t 2015-05-29 00:27:20.000000000
+0200
@@ -1,7 +1,10 @@
use strict;
use warnings;
use Test::More;
-use t::lib::capture;
+use t::lib::capture
+ 'capture',
+ capture_builtin => ['-MDevel::Confess::Builtin'],
+;
use Devel::Confess::Builtin ();
my @class = (
@@ -40,9 +43,7 @@
A::f();
}
END
- @CAPTURE_OPTS = ('-MDevel::Confess::Builtin');
- my $before = capture $code.'B::g();';
- @CAPTURE_OPTS = ();
+ my $before = capture_builtin $code.'B::g();';
my $after = capture $code.'require
Devel::Confess::Builtin;Devel::Confess::Builtin->import(); B::g();';
like $before, qr/B::g/, "verbose when loaded before $class";
like $after, qr/B::g/, "verbose when loaded after $class";