Hello community, here is the log from the commit of package perl-Test-NoWarnings for openSUSE:Factory checked in at 2012-02-20 16:16:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-NoWarnings (Old) and /work/SRC/openSUSE:Factory/.perl-Test-NoWarnings.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-NoWarnings", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-NoWarnings/perl-Test-NoWarnings.changes 2011-09-23 12:39:06.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Test-NoWarnings.new/perl-Test-NoWarnings.changes 2012-02-20 16:16:46.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Feb 20 08:38:18 UTC 2012 - co...@suse.com + +- updated to 1.04 + - Added the experimental :early debugging pragma to cause warnings + to be emitted immediately. This should stay off otherwise (ADAMK) + +------------------------------------------------------------------- Old: ---- Test-NoWarnings-1.03.tar.gz New: ---- Test-NoWarnings-1.04.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-NoWarnings.spec ++++++ --- /var/tmp/diff_new_pack.6uvTsF/_old 2012-02-20 16:16:47.000000000 +0100 +++ /var/tmp/diff_new_pack.6uvTsF/_new 2012-02-20 16:16:47.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Test-NoWarnings # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,15 +16,15 @@ # - Name: perl-Test-NoWarnings -Version: 1.03 -Release: 1 -License: LGPL-2.1+ +Version: 1.04 +Release: 0 %define cpan_name Test-NoWarnings Summary: Make sure you didn't emit any warnings while testing -Url: http://search.cpan.org/dist/Test-NoWarnings/ +License: LGPL-2.1+ Group: Development/Libraries/Perl +# MANUAL +Url: http://search.cpan.org/dist/Test-NoWarnings/ Source: http://www.cpan.org/authors/id/A/AD/ADAMK/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -49,7 +49,7 @@ capturing and checking them with the Test::Warn manpage, that way the Test::NoWarnings manpage will not see them and so not complain. -The test is run by an END block in Test::NoWarnings. It will not be run +The test is run by an 'END' block in Test::NoWarnings. It will not be run when any forked children exit. %prep @@ -69,6 +69,6 @@ %files -f %{name}.files %defattr(-,root,root,755) -%doc Changes LICENSE README +%doc Changes LICENSE MYMETA.json README %changelog ++++++ Test-NoWarnings-1.03.tar.gz -> Test-NoWarnings-1.04.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/Changes new/Test-NoWarnings-1.04/Changes --- old/Test-NoWarnings-1.03/Changes 2011-08-02 15:22:15.000000000 +0200 +++ new/Test-NoWarnings-1.04/Changes 2011-12-01 02:18:48.000000000 +0100 @@ -1,5 +1,9 @@ Changes for Perl extension Test-NoWarnings +1.04 Thu 1 Dec 2011 - Adam Kennedy + - Added the experimental :early debugging pragma to cause warnings + to be emitted immediately. This should stay off otherwise (ADAMK) + 1.03 Tue 2 Aug 2011 - Adam Kennedy - Test::Builder and Test::Tester dependencies were the wrong way around, corrected (ADAMK) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/MANIFEST new/Test-NoWarnings-1.04/MANIFEST --- old/Test-NoWarnings-1.03/MANIFEST 2011-08-02 15:22:51.000000000 +0200 +++ new/Test-NoWarnings-1.04/MANIFEST 2011-12-01 02:18:58.000000000 +0100 @@ -4,6 +4,7 @@ LICENSE Makefile.PL MANIFEST This list of files +MYMETA.json README t/01_compile.t t/02_none.t @@ -14,4 +15,5 @@ xt/meta.t xt/pmv.t xt/pod.t -META.yml Module meta-data (added by MakeMaker) +META.yml Module YAML meta-data (added by MakeMaker) +META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/META.json new/Test-NoWarnings-1.04/META.json --- old/Test-NoWarnings-1.03/META.json 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-NoWarnings-1.04/META.json 2011-12-01 02:18:57.000000000 +0100 @@ -0,0 +1,48 @@ +{ + "abstract" : "Make sure you didn't emit any warnings while testing", + "author" : [ + "Fergal Daly <fer...@esatclear.ie>" + ], + "dynamic_config" : 1, + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621", + "license" : [ + "open_source" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Test-NoWarnings", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "Test::More" : "0.47", + "Test::Tester" : "0.107" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "runtime" : { + "requires" : { + "Test::Builder" : "0.86", + "perl" : "5.006" + } + } + }, + "release_status" : "stable", + "resources" : { + "repository" : { + "url" : "http://svn.ali.as/cpan/trunk/Test-NoWarnings" + } + }, + "version" : "1.04" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/META.yml new/Test-NoWarnings-1.04/META.yml --- old/Test-NoWarnings-1.03/META.yml 2011-08-02 15:22:51.000000000 +0200 +++ new/Test-NoWarnings-1.04/META.yml 2011-12-01 02:18:57.000000000 +0100 @@ -1,26 +1,26 @@ ---- #YAML:1.0 -name: Test-NoWarnings -version: 1.03 -abstract: Make sure you didn't emit any warnings while testing +--- +abstract: "Make sure you didn't emit any warnings while testing" author: - - Fergal Daly <fer...@esatclear.ie> -license: lgpl -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 + - 'Fergal Daly <fer...@esatclear.ie>' build_requires: - Test::More: 0.47 - Test::Tester: 0.107 + Test::More: 0.47 + Test::Tester: 0.107 +configure_requires: + ExtUtils::MakeMaker: 0 +dynamic_config: 1 +generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621' +license: open_source +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 +name: Test-NoWarnings +no_index: + directory: + - t + - inc requires: - perl: 5.006 - Test::Builder: 0.86 + Test::Builder: 0.86 + perl: 5.006 resources: - repository: http://svn.ali.as/cpan/trunk/Test-NoWarnings -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.56 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + repository: http://svn.ali.as/cpan/trunk/Test-NoWarnings +version: 1.04 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/MYMETA.json new/Test-NoWarnings-1.04/MYMETA.json --- old/Test-NoWarnings-1.03/MYMETA.json 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-NoWarnings-1.04/MYMETA.json 2011-12-01 02:18:56.000000000 +0100 @@ -0,0 +1,48 @@ +{ + "abstract" : "Make sure you didn't emit any warnings while testing", + "author" : [ + "Fergal Daly <fer...@esatclear.ie>" + ], + "dynamic_config" : 0, + "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112621", + "license" : [ + "open_source" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "Test-NoWarnings", + "no_index" : { + "directory" : [ + "t", + "inc" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "Test::More" : "0.47", + "Test::Tester" : "0.107" + } + }, + "configure" : { + "requires" : { + "ExtUtils::MakeMaker" : 0 + } + }, + "runtime" : { + "requires" : { + "Test::Builder" : "0.86", + "perl" : "5.006" + } + } + }, + "release_status" : "stable", + "resources" : { + "repository" : { + "url" : "http://svn.ali.as/cpan/trunk/Test-NoWarnings" + } + }, + "version" : "1.04" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/README new/Test-NoWarnings-1.04/README --- old/Test-NoWarnings-1.03/README 2011-08-02 15:22:15.000000000 +0200 +++ new/Test-NoWarnings-1.04/README 2011-12-01 02:18:48.000000000 +0100 @@ -29,28 +29,27 @@ be capturing and checking them with Test::Warn, that way Test::NoWarnings will not see them and so not complain. - The test is run by an END block in Test::NoWarnings. It will not be run - when any forked children exit. + The test is run by an "END" block in Test::NoWarnings. It will not be + run when any forked children exit. USAGE Simply by using the module, you automatically get an extra test at the end of your script that checks that no warnings were emitted. So just stick - use Test::NoWarnings + use Test::NoWarnings; at the top of your script and continue as normal. If you want more control you can invoke the test manually at any time - with "had_no_warnings()". + with "had_no_warnings". The warnings your test has generated so far are stored in an array. You can look inside and clear this whenever you want with "warnings()" and - "clear_warnings()", however, if you are doing this sort of thing then - you probably want to use Test::Warn in combination with - Test::NoWarnings. + "clear_warnings", however, if you are doing this sort of thing then you + probably want to use Test::Warn in combination with Test::NoWarnings. -USE vs REQUIRE + use vs require You will almost always want to do use Test::NoWarnings @@ -58,7 +57,7 @@ If you do a "require" rather than a "use", then there will be no automatic test at the end of your script. -OUTPUT + Output If warning is captured during your test then the details will output as part of the diagnostics. You will get: @@ -70,7 +69,27 @@ o a full dump of the stack when warn was called, courtesy of the "Carp" module -EXPORTABLE FUNCTIONS + By default, all warning messages will be emitted in one block at the end + of your test script. + + The :early pragma + One common complaint from people using Test::NoWarnings is that all of + the warnings are emitted in one go at the end. While this is the safest + and most correct time to emit these diagnostics, it can make debugging + these warnings difficult. + + As of Test::NoWarnings 1.04 you can provide an experimental ":early" + pragma when loading the module to force warnings to be thrown via diag + at the time that they actually occur. + + use Test::NoWarnings ':early'; + + As this will cause the diag to be emitted against the previous test and + not the one in which the warning actually occurred it is recommended + that the pragma be turned on only for debugging and left off when not + needed. + +FUNCTIONS had_no_warnings This checks that there have been warnings emitted by your test scripts. Usually you will not call this explicitly as it is called automatically diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/lib/Test/NoWarnings/Warning.pm new/Test-NoWarnings-1.04/lib/Test/NoWarnings/Warning.pm --- old/Test-NoWarnings-1.03/lib/Test/NoWarnings/Warning.pm 2011-08-02 15:22:15.000000000 +0200 +++ new/Test-NoWarnings-1.04/lib/Test/NoWarnings/Warning.pm 2011-12-01 02:18:48.000000000 +0100 @@ -6,7 +6,7 @@ use vars qw{$VERSION}; BEGIN { - $VERSION = '1.03'; + $VERSION = '1.04'; # Optional stacktrace support eval "require Devel::StackTrace"; @@ -56,7 +56,7 @@ $self->{Test} = $prev_test; my @tests = $builder->details; my $prev_test_name = $prev_test ? $tests[$prev_test - 1]->{name} : ""; - $self->{TestName} = $prev_test_name; + $self->{TestName} = $prev_test_name; } sub getTest { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-NoWarnings-1.03/lib/Test/NoWarnings.pm new/Test-NoWarnings-1.04/lib/Test/NoWarnings.pm --- old/Test-NoWarnings-1.03/lib/Test/NoWarnings.pm 2011-08-02 15:22:15.000000000 +0200 +++ new/Test-NoWarnings-1.04/lib/Test/NoWarnings.pm 2011-12-01 02:18:48.000000000 +0100 @@ -10,10 +10,12 @@ use vars qw( $VERSION @EXPORT_OK @ISA $do_end_test ); BEGIN { - $VERSION = '1.03'; + $VERSION = '1.04'; @ISA = 'Exporter'; @EXPORT_OK = qw( - clear_warnings had_no_warnings warnings + clear_warnings + had_no_warnings + warnings ); # Do we add the warning test at the end? @@ -23,11 +25,16 @@ my $TEST = Test::Builder->new; my $PID = $$; my @WARNINGS = (); +my $EARLY = 0; $SIG{__WARN__} = make_catcher(\@WARNINGS); sub import { $do_end_test = 1; + if ( grep { $_ eq ':early' } @_ ) { + @_ = grep { $_ ne ':early' } @_; + $EARLY = 1; + } goto &Exporter::import; } @@ -65,10 +72,16 @@ return sub { my $msg = shift; + # Generate the warning $Carp::Internal{__PACKAGE__.""}++; push(@$array, make_warning($msg)); $Carp::Internal{__PACKAGE__.""}--; + # Show the diag early rather than at the end + if ( $EARLY ) { + $TEST->diag( $array->[-1]->toString ); + } + return $msg; }; } @@ -85,8 +98,10 @@ $ok = 1; } else { $ok = 0; - $diag = "There were ".@WARNINGS." warning(s)\n"; - $diag .= join "----------\n", map { $_->toString } @WARNINGS; + $diag = "There were " . scalar(@WARNINGS) . " warning(s)\n"; + unless ( $EARLY ) { + $diag .= join "----------\n", map { $_->toString } @WARNINGS; + } } $TEST->ok($ok, $name) || $TEST->diag($diag); @@ -152,27 +167,27 @@ capturing and checking them with L<Test::Warn>, that way L<Test::NoWarnings> will not see them and so not complain. -The test is run by an END block in Test::NoWarnings. It will not be run when -any forked children exit. +The test is run by an C<END> block in Test::NoWarnings. It will not be run +when any forked children exit. =head1 USAGE Simply by using the module, you automatically get an extra test at the end of your script that checks that no warnings were emitted. So just stick - use Test::NoWarnings + use Test::NoWarnings; at the top of your script and continue as normal. If you want more control you can invoke the test manually at any time with -C<had_no_warnings()>. +C<had_no_warnings>. The warnings your test has generated so far are stored in an array. You can look inside and clear this whenever you want with C<warnings()> and -C<clear_warnings()>, however, if you are doing this sort of thing then you +C<clear_warnings>, however, if you are doing this sort of thing then you probably want to use L<Test::Warn> in combination with L<Test::NoWarnings>. -=head1 USE vs REQUIRE +=head2 use vs require You will almost always want to do @@ -181,7 +196,7 @@ If you do a C<require> rather than a C<use>, then there will be no automatic test at the end of your script. -=head1 OUTPUT +=head2 Output If warning is captured during your test then the details will output as part of the diagnostics. You will get: @@ -204,7 +219,27 @@ =back -=head1 EXPORTABLE FUNCTIONS +By default, all warning messages will be emitted in one block at the end of +your test script. + +=head2 The :early pragma + +One common complaint from people using Test::NoWarnings is that all of the +warnings are emitted in one go at the end. While this is the safest and +most correct time to emit these diagnostics, it can make debugging these +warnings difficult. + +As of Test::NoWarnings 1.04 you can provide an experimental C<:early> pragma +when loading the module to force warnings to be thrown via diag at the time +that they actually occur. + + use Test::NoWarnings ':early'; + +As this will cause the diag to be emitted against the previous test and not +the one in which the warning actually occurred it is recommended that the +pragma be turned on only for debugging and left off when not needed. + +=head1 FUNCTIONS =head2 had_no_warnings -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org