Hello community, here is the log from the commit of package perl-Test-Command for openSUSE:Factory checked in at 2013-06-06 12:43:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Command (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Command.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Command" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Command/perl-Test-Command.changes 2011-09-23 12:39:03.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Test-Command.new/perl-Test-Command.changes 2013-06-06 12:43:35.000000000 +0200 @@ -1,0 +2,10 @@ +Tue Jun 4 15:01:16 UTC 2013 - [email protected] + +- updated to 0.11 + - fix determination of diagnostic test name in signal_is_undef() + - fix signal tests on Win32 platforms + - added exit_value(), signal_value(), stdout_value(), stdout_file(), + stderr_value() and stderr_file() (these provide access to raw value + for arbitrary testing not covered by this module) + +------------------------------------------------------------------- Old: ---- Test-Command-0.08.tar.gz New: ---- Test-Command-0.11.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Command.spec ++++++ --- /var/tmp/diff_new_pack.p8Xjyb/_old 2013-06-06 12:43:35.000000000 +0200 +++ /var/tmp/diff_new_pack.p8Xjyb/_new 2013-06-06 12:43:35.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Test-Command # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 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,21 +16,21 @@ # - Name: perl-Test-Command -Version: 0.08 -Release: 3 -License: GPL-1.0+ or Artistic-1.0 +Version: 0.11 +Release: 0 %define cpan_name Test-Command Summary: Test routines for external commands -Url: http://search.cpan.org/dist/Test-Command/ +License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl +Url: http://search.cpan.org/dist/Test-Command/ Source: http://www.cpan.org/authors/id/D/DA/DANBOO/%{cpan_name}-%{version}.tar.gz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros BuildRequires: perl(Module::Build) +#BuildRequires: perl(Test::Command) %{perl_requires} %description @@ -94,9 +94,6 @@ ./Build install destdir=%{buildroot} create_packlist=0 %perl_gen_filelist -%clean -%{__rm} -rf %{buildroot} - %files -f %{name}.files %defattr(-,root,root,755) %doc Changes README ++++++ Test-Command-0.08.tar.gz -> Test-Command-0.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/Build.PL new/Test-Command-0.11/Build.PL --- old/Test-Command-0.08/Build.PL 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/Build.PL 2013-04-29 20:40:18.000000000 +0200 @@ -11,6 +11,14 @@ 'Test::Simple' => 0.62, }, add_to_cleanup => [ 'Test-Command-*' ], + create_makefile_pl => 'traditional', + meta_merge => { + resources => { + repository => 'https://github.com/danboo/perl-test-command', + homepage => 'https://metacpan.org/release/Test-Command', + bugtracker => 'http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Command', + }, + }, ); $builder->create_build_script(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/Changes new/Test-Command-0.11/Changes --- old/Test-Command-0.08/Changes 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/Changes 2013-04-29 20:40:18.000000000 +0200 @@ -1,5 +1,16 @@ Revision history for Test-Command +0.11 4/29/2013 + - fix determination of diagnostic test name in signal_is_undef() + +0.10 2/8/2013 + - fix signal tests on Win32 platforms + +0.09 2/1/2013 + - added exit_value(), signal_value(), stdout_value(), stdout_file(), + stderr_value() and stderr_file() (these provide access to raw value + for arbitrary testing not covered by this module) + 0.08 Wed May 13 23:04 2009 - removed use of POSIX module (need a better understanding of how to use it on BSD systems), reverted back to hand-rolled exit and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/META.yml new/Test-Command-0.11/META.yml --- old/Test-Command-0.08/META.yml 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/META.yml 2013-04-29 20:40:18.000000000 +0200 @@ -1,18 +1,21 @@ --- name: Test-Command -version: 0.08 +version: 0.11 author: - 'Daniel B. Boorstein <[email protected]>' abstract: Test routines for external commands license: perl resources: + bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Command + homepage: https://metacpan.org/release/Test-Command license: http://dev.perl.org/licenses/ + repository: https://github.com/danboo/perl-test-command build_requires: Test::Simple: 0.62 provides: Test::Command: file: lib/Test/Command.pm - version: 0.08 + version: 0.11 generated_by: Module::Build version 0.280802 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/Makefile.PL new/Test-Command-0.11/Makefile.PL --- old/Test-Command-0.08/Makefile.PL 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/Makefile.PL 2013-04-29 20:40:18.000000000 +0200 @@ -1,16 +1,14 @@ -use strict; -use warnings; +# Note: this file was auto-generated by Module::Build::Compat version 0.2808_01 use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'Test::Command', - AUTHOR => 'Daniel B. Boorstein <[email protected]>', - VERSION_FROM => 'lib/Test/Command.pm', - ABSTRACT_FROM => 'lib/Test/Command.pm', - PL_FILES => {}, - PREREQ_PM => { - 'Test::Simple' => 0.62, - }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'Test-Command-*' }, -); +WriteMakefile +( + 'PL_FILES' => {}, + 'INSTALLDIRS' => 'site', + 'NAME' => 'Test::Command', + 'EXE_FILES' => [], + 'VERSION_FROM' => 'lib/Test/Command.pm', + 'PREREQ_PM' => { + 'Test::Simple' => '0.62' + } + ) +; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/lib/Test/Command.pm new/Test-Command-0.11/lib/Test/Command.pm --- old/Test-Command-0.08/lib/Test/Command.pm 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/lib/Test/Command.pm 2013-04-29 20:40:18.000000000 +0200 @@ -9,37 +9,43 @@ use base 'Test::Builder::Module'; our @EXPORT = qw( - exit_is_num - exit_isnt_num - exit_cmp_ok - exit_is_defined - exit_is_undef - - signal_is_num - signal_isnt_num - signal_cmp_ok - signal_is_defined - signal_is_undef - - stdout_is_eq - stdout_isnt_eq - stdout_is_num - stdout_isnt_num - stdout_like - stdout_unlike - stdout_cmp_ok - stdout_is_file - - stderr_is_eq - stderr_isnt_eq - stderr_is_num - stderr_isnt_num - stderr_like - stderr_unlike - stderr_cmp_ok - stderr_is_file + exit_value + exit_is_num + exit_isnt_num + exit_cmp_ok + exit_is_defined + exit_is_undef + + signal_value + signal_is_num + signal_isnt_num + signal_cmp_ok + signal_is_defined + signal_is_undef + + stdout_value + stdout_file + stdout_is_eq + stdout_isnt_eq + stdout_is_num + stdout_isnt_num + stdout_like + stdout_unlike + stdout_cmp_ok + stdout_is_file + + stderr_value + stderr_file + stderr_is_eq + stderr_isnt_eq + stderr_is_num + stderr_isnt_num + stderr_like + stderr_unlike + stderr_cmp_ok + stderr_is_file - ); + ); =head1 NAME @@ -47,11 +53,11 @@ =head1 VERSION -Version 0.08 +Version 0.11 =cut -our $VERSION = '0.08'; +our $VERSION = '0.11'; =head1 SYNOPSIS @@ -107,6 +113,15 @@ $echo_test->run; + ## arbitrary results inspection + + is( $echo_test->exit_value, 0, 'echo exit' ); + is( $echo_test->signal_value, undef, 'echo signal' ); + is( $echo_test->stdout_value, "out\n", 'echo stdout' ); + is( $echo_test->stderr_value, '', 'echo stderr' ); + is( -s $echo_test->stdout_file, 4, 'echo stdout file size' ); + is( -s $echo_test->stderr_file, 0, 'echo stderr file size' ); + =head1 DESCRIPTION C<Test::Command> intends to bridge the gap between the well tested functions and @@ -421,9 +436,9 @@ open STDERR, '>&' . fileno $saved_stderr or confess 'Cannot restore STDERR'; return { exit_status => $exit_status, - term_signal => $term_signal, - stdout_file => $temp_stdout_file, - stderr_file => $temp_stderr_file }; + term_signal => $term_signal, + stdout_file => $temp_stdout_file, + stderr_file => $temp_stderr_file }; } @@ -432,6 +447,24 @@ The test routines below compare against the exit status of the executed command right shifted by 8 (that is, C<$? E<gt>E<gt> 8>). +=head3 exit_value + + exit_value($cmd) + +Return the exit status of the command. Useful for performing arbitrary tests +not covered by this module. + +=cut + +sub exit_value + { + my ($cmd) = @_; + + my $result = _get_result($cmd); + + return $result->{'exit_status'}; + } + =head3 exit_is_num exit_is_num($cmd, $exp_num, $name) @@ -540,6 +573,24 @@ The test routines below compare against the lower 8 bits of the exit status of the executed command. +=head3 signal_value + + signal_value($cmd) + +Return the signal code of the command. Useful for performing arbitrary tests +not covered by this module. + +=cut + +sub signal_value + { + my ($cmd) = @_; + + my $result = _get_result($cmd); + + return $result->{'term_signal'}; + } + =head3 signal_is_num signal_is_num($cmd, $exp_num, $name) @@ -634,7 +685,7 @@ sub signal_is_undef { - my ($cmd, $op, $exp, $name) = @_; + my ($cmd, $name) = @_; my $result = _get_result($cmd); @@ -648,6 +699,43 @@ Except where specified, the test routines below treat STDOUT as a single slurped string. +=head3 stdout_value + + stdout_value($cmd) + +Return the STDOUT of the command. Useful for performing arbitrary tests +not covered by this module. + +=cut + +sub stdout_value + { + my ($cmd) = @_; + + my $result = _get_result($cmd); + my $stdout_text = _slurp($result->{'stdout_file'}); + + return $stdout_text; + } + +=head3 stdout_file + + stdout_file($cmd) + +Return the file name containing the STDOUT of the command. Useful for +performing arbitrary tests not covered by this module. + +=cut + +sub stdout_file + { + my ($cmd) = @_; + + my $result = _get_result($cmd); + + return $result->{'stdout_file'}; + } + =head3 stdout_is_eq stdout_is_eq($cmd, $exp_string, $name) @@ -845,6 +933,43 @@ Except where specified, the test routines below treat STDERR as a single slurped string. +=head3 stderr_value + + stderr_value($cmd) + +Return the STDERR of the command. Useful for performing arbitrary tests +not covered by this module. + +=cut + +sub stderr_value + { + my ($cmd) = @_; + + my $result = _get_result($cmd); + my $stderr_text = _slurp($result->{'stderr_file'}); + + return $stderr_text; + } + +=head3 stderr_file + + stderr_file($cmd) + +Return the file name containing the STDERR of the command. Useful for +performing arbitrary tests not covered by this module. + +=cut + +sub stderr_file + { + my ($cmd) = @_; + + my $result = _get_result($cmd); + + return $result->{'stderr_file'}; + } + =head3 stderr_is_eq stderr_is_eq($cmd, $exp_string, $name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/t/02-exit.t new/Test-Command-0.11/t/02-exit.t --- old/Test-Command-0.08/t/02-exit.t 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/t/02-exit.t 2013-04-29 20:40:18.000000000 +0200 @@ -1,6 +1,6 @@ #!perl -use Test::Command tests => 6; +use Test::Command tests => 8; use Test::More; @@ -8,6 +8,9 @@ system qq($^X -e 1) and BAIL_OUT('error calling perl via system'); +is( exit_value(qq($^X -e "1")), 0, "exit_value 0"); +is( exit_value(qq($^X -e "exit 1")), 1, "exit_value 1"); + exit_is_num(qq($^X -e "exit 1"), 1); exit_is_num(qq($^X -e "exit 255"), 255); exit_is_defined(qq($^X -e "exit 255")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/t/03-stdout.t new/Test-Command-0.11/t/03-stdout.t --- old/Test-Command-0.08/t/03-stdout.t 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/t/03-stdout.t 2013-04-29 20:40:18.000000000 +0200 @@ -1,6 +1,6 @@ #!perl -use Test::Command tests => 13; +use Test::Command tests => 15; use Test::More; @@ -10,6 +10,10 @@ system qq($^X -e 1) and BAIL_OUT('error calling perl via system'); +is( stdout_value(qq($^X -e "print 'foo'")), "foo", "stdout_value is foo"); +is( Test::Command::_slurp(stdout_file(qq($^X -e "print 'foo'"))), + "foo", "stdout_file contains foo"); + stdout_is_eq(qq($^X -e "print 'foo'"), "foo"); stderr_is_eq(qq($^X -e "print 'foo'"), ""); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/t/04-stderr.t new/Test-Command-0.11/t/04-stderr.t --- old/Test-Command-0.08/t/04-stderr.t 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/t/04-stderr.t 2013-04-29 20:40:18.000000000 +0200 @@ -1,6 +1,6 @@ #!perl -use Test::Command tests => 13; +use Test::Command tests => 15; use Test::More; @@ -10,6 +10,11 @@ system qq($^X -e 1) and BAIL_OUT('error calling perl via system'); +is( stderr_value(qq($^X -e "print STDERR 'foo'")), + "foo", "stderr_value is foo"); +is( Test::Command::_slurp(stderr_file(qq($^X -e "print STDERR 'foo'"))), + "foo", "stderr_file contains foo"); + stderr_is_eq(qq($^X -e "print STDERR 'foo'"), "foo"); stdout_is_eq(qq($^X -e "print STDERR 'foo'"), ""); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/t/05-object.t new/Test-Command-0.11/t/05-object.t --- old/Test-Command-0.08/t/05-object.t 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/t/05-object.t 2013-04-29 20:40:18.000000000 +0200 @@ -1,6 +1,6 @@ #!perl -use Test::More tests => 32; +use Test::More tests => 38; use Test::Command; @@ -18,16 +18,21 @@ $test_perl->run; +is( $test_perl->exit_value, 0, "exit_value" ); + $test_perl->exit_is_num(0); $test_perl->exit_isnt_num(1); $test_perl->exit_cmp_ok('<', 1); SKIP: { - skip("not sure about Win32 signal support", 1) if $^O eq 'MSWin32'; + skip("not sure about Win32 signal support", 2) if $^O eq 'MSWin32'; + is( $test_perl->signal_value, undef, "signal_value" ); $test_perl->signal_is_undef; } +is( $test_perl->stdout_value, "foo\nbar\n", "stdout_value" ); +is( Test::Command::_slurp($test_perl->stdout_file), "foo\nbar\n", "stdout_file" ); $test_perl->stdout_is_eq("foo\nbar\n"); $test_perl->stdout_isnt_eq("bar\nfoo\n"); { @@ -40,6 +45,8 @@ $test_perl->stdout_cmp_ok('ne', "bar\nfoo\n"); $test_perl->stdout_is_file("$FindBin::Bin/stdout.txt"); +is( $test_perl->stderr_value, "bar\nfoo\n", "stderr_value" ); +is( Test::Command::_slurp($test_perl->stderr_file), "bar\nfoo\n", "stderr_file" ); $test_perl->stderr_is_eq("bar\nfoo\n"); $test_perl->stderr_isnt_eq("foo\nbar\n"); { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Command-0.08/t/06-signal.t new/Test-Command-0.11/t/06-signal.t --- old/Test-Command-0.08/t/06-signal.t 2009-05-14 05:21:05.000000000 +0200 +++ new/Test-Command-0.11/t/06-signal.t 2013-04-29 20:40:18.000000000 +0200 @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::Command tests => 8; +use Test::Command tests => 9; use Test::More; @@ -19,12 +19,14 @@ SKIP: { - skip("not sure about Win32 signal support", 8) if $^O eq 'MSWin32'; + skip("not sure about Win32 signal support", 9) if $^O eq 'MSWin32'; signal_is_undef(qq($^X -e "exit 0")); signal_is_undef(qq($^X -e "exit 1")); signal_is_undef(qq($^X -e "exit 255")); signal_is_undef([$^X, '-e', 1]); - skip("no SIGTERM found", 4) if ! exists $sig{'TERM'}; + skip("no SIGTERM found", 5) if ! exists $sig{'TERM'}; + is(signal_value([$^X, '-e', 'kill ' . $sig{'TERM'} . ', $$']), $sig{'TERM'}, + "signal_value is SIGTERM" );; signal_is_defined([$^X, '-e', 'kill ' . $sig{'TERM'} . ', $$']); signal_cmp_ok([$^X, '-e', 'kill ' . $sig{'TERM'} . ', $$'], '>', -1 ); signal_isnt_num([$^X, '-e', 'kill ' . $sig{'TERM'} . ', $$'], $sig{'TERM'} + 1 ); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
