Change 26752 by [EMAIL PROTECTED] on 2006/01/09 13:44:20
Upgrade to Sys::Syslog 0.12
Affected files ...
... //depot/perl/ext/Sys/Syslog/Changes#3 edit
... //depot/perl/ext/Sys/Syslog/README#3 edit
... //depot/perl/ext/Sys/Syslog/Syslog.pm#37 edit
... //depot/perl/ext/Sys/Syslog/t/constants.t#2 edit
... //depot/perl/ext/Sys/Syslog/t/podspell.t#3 edit
Differences ...
==== //depot/perl/ext/Sys/Syslog/Changes#3 (text) ====
Index: perl/ext/Sys/Syslog/Changes
--- perl/ext/Sys/Syslog/Changes#2~26515~ 2005-12-28 05:31:02.000000000
-0800
+++ perl/ext/Sys/Syslog/Changes 2006-01-09 05:44:20.000000000 -0800
@@ -1,7 +1,16 @@
Revision history for Sys-Syslog
+0.12 2006.01.07
+ [CODE] Merged some modifications from bleadperl.
+ [DOC] Added a link to an article about Sys::Syslog.
+ [TESTS] Removed optional dependency on Test::Exception.
+ [TESTS] Improved t/constant.t
+ [TESTS] Rewrote t/constants.t because future versions of
+ ExtUtils::Constant will prevent the constant() function from
+ being directly called.
+
0.11 2005.12.28
- [BUGFIX] setlogmask() now behaves liek its C counterpart.
+ [BUGFIX] setlogmask() now behaves like its C counterpart.
[CODE] Can now export and use the macros.
[CODE] Support for three Exporter tags.
[CODE] XSLoader is now optional.
==== //depot/perl/ext/Sys/Syslog/README#3 (text) ====
Index: perl/ext/Sys/Syslog/README
--- perl/ext/Sys/Syslog/README#2~26515~ 2005-12-28 05:31:02.000000000 -0800
+++ perl/ext/Sys/Syslog/README 2006-01-09 05:44:20.000000000 -0800
@@ -26,7 +26,7 @@
- Linux 2.6, gcc 3.4.1
- FreeBSD 4.7, gcc 2.95.4
- - Mac OS X 10.2.6, gcc 3.1
+ - Mac OS X 10.4, gcc 4.0.1
Sys::Syslog should on any Perl since 5.6.0. This module has been
tested by the author to check that it works with the following
@@ -36,11 +36,10 @@
- Perl 5.8.5 i386-linux-thread-multi (vendor build)
- Perl 5.6.1 i386-freebsd (custom build)
- Perl 5.8.7 i386-freebsd (custom build)
- - Perl 5.6.0 darwin (vendor build)
- - Perl 5.8.7 cygwin-thread-multi-64int (vendor build)
+ - Perl 5.8.6 darwin-thread-multi-2level (vendor build)
See also the corresponding CPAN Testers page:
- http://testers.cpan.org/show/Net-Pcap.html
+ http://testers.cpan.org/show/Sys-Syslog.html
SUPPORT AND DOCUMENTATION
==== //depot/perl/ext/Sys/Syslog/Syslog.pm#37 (text) ====
Index: perl/ext/Sys/Syslog/Syslog.pm
--- perl/ext/Sys/Syslog/Syslog.pm#36~26515~ 2005-12-28 05:31:02.000000000
-0800
+++ perl/ext/Sys/Syslog/Syslog.pm 2006-01-09 05:44:20.000000000 -0800
@@ -4,7 +4,7 @@
require 5.006;
require Exporter;
-our $VERSION = '0.11';
+our $VERSION = '0.12';
our @ISA = qw(Exporter);
our %EXPORT_TAGS = (
@@ -53,7 +53,7 @@
=head1 VERSION
-Version 0.11
+Version 0.12
=head1 SYNOPSIS
@@ -436,6 +436,8 @@
L<syslog(3)>
+I<Syslogging with Perl>, L<http://lexington.pm.org/meetings/022001.html>
+
=head1 AUTHOR
==== //depot/perl/ext/Sys/Syslog/t/constants.t#2 (text) ====
Index: perl/ext/Sys/Syslog/t/constants.t
--- perl/ext/Sys/Syslog/t/constants.t#1~26309~ 2005-12-08 18:07:32.000000000
-0800
+++ perl/ext/Sys/Syslog/t/constants.t 2006-01-09 05:44:20.000000000 -0800
@@ -1,46 +1,41 @@
#!/usr/bin/perl -T
use strict;
+use File::Spec;
use Test::More;
-my @names;
-BEGIN {
- if(open(MACROS, 'macros.all')) {
- @names = map {chomp;$_} <MACROS>;
- close(MACROS);
- plan tests => @names + 3;
- } else {
- plan skip_all => "can't read 'macros.all': $!"
- }
-}
-use Sys::Syslog;
-eval "use Test::Exception"; my $has_test_exception = !$@;
+my $macrosall = $ENV{PERL_CORE} ? File::Spec->catfile(qw(.. ext Sys Syslog
macros.all))
+ : 'macros.all';
+open(MACROS, $macrosall) or plan skip_all => "can't read '$macrosall': $!";
+my @names = map {chomp;$_} <MACROS>;
+close(MACROS);
+plan tests => @names * 2 + 2;
-# Testing error messages
-SKIP: {
- skip "Test::Exception not available", 1 unless $has_test_exception;
-
- # constant() errors
- throws_ok(sub {
- Sys::Syslog::constant()
- }, '/^Usage: Sys::Syslog::constant\(sv\)/',
- "calling constant() with no argument");
-}
+my $callpack = my $testpack = 'Sys::Syslog';
+eval "use $callpack";
-# Testing constant()
-like( Sys::Syslog::constant('This'),
- '/^This is not a valid Sys::Syslog macro/',
- "calling constant() with a non existing name" );
-
-like( Sys::Syslog::constant('NOSUCHNAME'),
- '/^NOSUCHNAME is not a valid Sys::Syslog macro/',
- "calling constant() with a non existing name" );
+eval "${callpack}::This()";
+like( $@, "/^This is not a valid $testpack macro/", "trying a non-existing
macro");
+
+eval "${callpack}::NOSUCHNAME()";
+like( $@, "/^NOSUCHNAME is not a valid $testpack macro/", "trying a
non-existing macro");
# Testing all macros
if(@names) {
for my $name (@names) {
- like( Sys::Syslog::constant($name),
- '/^(?:\d+|Your vendor has not defined Sys::Syslog macro
'.$name.', used)$/',
- "checking that $name is a number
(".Sys::Syslog::constant($name).")" );
+ SKIP: {
+ $name =~ /^(\w+)$/ or skip "invalid name '$name'", 2;
+ $name = $1;
+ my $v = eval "${callpack}::$name()";
+
+ if($v =~ /^\d+$/) {
+ is( $@, '', "calling the constant $name as a function" );
+ like( $v, '/^\d+$/', "checking that $name is a number ($v)" );
+
+ } else {
+ like( $@, "/^Your vendor has not defined $testpack macro
$name/",
+ "calling the constant via its name" );
+ skip "irrelevant test in this case", 1
+ }
+ }
}
}
-
==== //depot/perl/ext/Sys/Syslog/t/podspell.t#3 (text) ====
Index: perl/ext/Sys/Syslog/t/podspell.t
--- perl/ext/Sys/Syslog/t/podspell.t#2~26515~ 2005-12-28 05:31:02.000000000
-0800
+++ perl/ext/Sys/Syslog/t/podspell.t 2006-01-09 05:44:20.000000000 -0800
@@ -53,4 +53,5 @@
logopts
pathname
syslogd
+Syslogging
logmask
End of Patch.