Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Test-Script for openSUSE:Factory checked in at 2021-05-17 18:45:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Script (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Script.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Script" Mon May 17 18:45:18 2021 rev:30 rq:893687 version:1.29 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Script/perl-Test-Script.changes 2021-02-18 20:53:09.847481818 +0100 +++ /work/SRC/openSUSE:Factory/.perl-Test-Script.new.2988/perl-Test-Script.changes 2021-05-17 18:45:46.096508145 +0200 @@ -1,0 +2,12 @@ +Fri May 14 03:10:03 UTC 2021 - Tina M??ller <timueller+p...@suse.de> + +- updated to 1.29 + see /usr/share/doc/packages/perl-Test-Script/Changes + + 1.29 2021-05-13 09:17:30 -0600 + - Production release identical to 1.28_01 release. + + 1.28_01 2021-05-10 10:12:22 -0600 + - Added script_fails and program_fails functions (brainbuz++ gh#34, gh#38) + +------------------------------------------------------------------- Old: ---- Test-Script-1.27.tar.gz New: ---- Test-Script-1.29.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Script.spec ++++++ --- /var/tmp/diff_new_pack.icIbGH/_old 2021-05-17 18:45:46.660505752 +0200 +++ /var/tmp/diff_new_pack.icIbGH/_new 2021-05-17 18:45:46.664505735 +0200 @@ -18,7 +18,7 @@ %define cpan_name Test-Script Name: perl-Test-Script -Version: 1.27 +Version: 1.29 Release: 0 Summary: Basic cross-platform tests for scripts License: Artistic-1.0 OR GPL-1.0-or-later ++++++ Test-Script-1.27.tar.gz -> Test-Script-1.29.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/Changes new/Test-Script-1.29/Changes --- old/Test-Script-1.27/Changes 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/Changes 2021-05-13 17:17:32.000000000 +0200 @@ -1,5 +1,11 @@ Revision history for Perl extension Test-Script +1.29 2021-05-13 09:17:30 -0600 + - Production release identical to 1.28_01 release. + +1.28_01 2021-05-10 10:12:22 -0600 + - Added script_fails and program_fails functions (brainbuz++ gh#34, gh#38) + 1.27 2021-02-17 13:15:57 -0700 - Documentation improvements (RRWO++ gh#31, gh#30) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/LICENSE new/Test-Script-1.29/LICENSE --- old/Test-Script-1.27/LICENSE 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/LICENSE 2021-05-13 17:17:32.000000000 +0200 @@ -1,4 +1,4 @@ -This software is copyright (c) 2019 by Adam Kennedy. +This software is copyright (c) 2006-2021 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2019 by Adam Kennedy. +This software is Copyright (c) 2006-2021 by Adam Kennedy. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2019 by Adam Kennedy. +This software is Copyright (c) 2006-2021 by Adam Kennedy. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/MANIFEST new/Test-Script-1.29/MANIFEST --- old/Test-Script-1.27/MANIFEST 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/MANIFEST 2021-05-13 17:17:32.000000000 +0200 @@ -15,6 +15,7 @@ t/bin/bad.pl t/bin/four.pl t/bin/good.pl +t/bin/liveordie.pl t/bin/print.pl t/bin/signal.pl t/bin/stdin.pl @@ -23,6 +24,7 @@ t/bin/warnon.pl t/bug_gh9.t t/test_script__exports.t +t/test_script__fails.t t/test_script__import.t t/test_script__program_runs.t t/test_script__program_stderr.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/META.json new/Test-Script-1.29/META.json --- old/Test-Script-1.27/META.json 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/META.json 2021-05-13 17:17:32.000000000 +0200 @@ -56,30 +56,31 @@ "provides" : { "Test::Script" : { "file" : "lib/Test/Script.pm", - "version" : "1.27" + "version" : "1.29" } }, "release_status" : "stable", "resources" : { "bugtracker" : { - "web" : "https://github.com/plicease/Test-Script/issues" + "web" : "https://github.com/uperl/Test-Script/issues" }, "homepage" : "https://metacpan.org/pod/Test::Script", "repository" : { "type" : "git", - "url" : "git://github.com/plicease/Test-Script.git", - "web" : "https://github.com/plicease/Test-Script" + "url" : "git://github.com/uperl/Test-Script.git", + "web" : "https://github.com/uperl/Test-Script" } }, - "version" : "1.27", + "version" : "1.29", "x_contributors" : [ "Adam Kennedy", "Graham Ollis <plice...@cpan.org>", "Brendan Byrd", - "Chris White <c...@cpan.org>" + "Chris White <c...@cpan.org>", + "John Karr (BRAINBUZ)" ], - "x_generated_by_perl" : "v5.33.6", - "x_serialization_backend" : "Cpanel::JSON::XS version 4.25", + "x_generated_by_perl" : "v5.33.9", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.26", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_use_unsafe_inc" : 0 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/META.yml new/Test-Script-1.29/META.yml --- old/Test-Script-1.27/META.yml 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/META.yml 2021-05-13 17:17:32.000000000 +0200 @@ -19,7 +19,7 @@ provides: Test::Script: file: lib/Test/Script.pm - version: '1.27' + version: '1.29' requires: Capture::Tiny: '0' File::Spec: '0.80' @@ -29,16 +29,17 @@ Text::ParseWords: '0' perl: '5.008001' resources: - bugtracker: https://github.com/plicease/Test-Script/issues + bugtracker: https://github.com/uperl/Test-Script/issues homepage: https://metacpan.org/pod/Test::Script - repository: git://github.com/plicease/Test-Script.git -version: '1.27' + repository: git://github.com/uperl/Test-Script.git +version: '1.29' x_contributors: - 'Adam Kennedy' - 'Graham Ollis <plice...@cpan.org>' - 'Brendan Byrd' - 'Chris White <c...@cpan.org>' -x_generated_by_perl: v5.33.6 + - 'John Karr (BRAINBUZ)' +x_generated_by_perl: v5.33.9 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_use_unsafe_inc: 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/Makefile.PL new/Test-Script-1.29/Makefile.PL --- old/Test-Script-1.27/Makefile.PL 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/Makefile.PL 2021-05-13 17:17:32.000000000 +0200 @@ -5,7 +5,7 @@ exit; } } -# This file was automatically generated by Dist::Zilla::Plugin::Author::Plicease::MakeMaker v2.59. +# This file was automatically generated by Dist::Zilla::Plugin::Author::Plicease::MakeMaker v2.63. use strict; use warnings; use 5.008001; @@ -35,7 +35,7 @@ "TEST_REQUIRES" => { "Test2::V0" => "0.000060" }, - "VERSION" => "1.27", + "VERSION" => "1.29", "test" => { "TESTS" => "t/*.t" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/README new/Test-Script-1.29/README --- old/Test-Script-1.27/README 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/README 2021-05-13 17:17:32.000000000 +0200 @@ -4,7 +4,7 @@ VERSION - version 1.27 + version 1.29 SYNOPSIS @@ -46,6 +46,8 @@ script_compiles + [version 1.05] + script_compiles( $script, $test_name ); The "script_compiles" test calls the script with "perl -c script.pl", @@ -59,10 +61,10 @@ is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. - This function was added in version 1.05. - script_runs + [version 1.05] + script_runs( $script, $test_name ); script_runs( \@script_and_arguments, $test_name ); script_runs( $script, \%options, $test_name ); @@ -79,7 +81,7 @@ test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. - This function was added in version 1.05. + [version 1.09] You may pass in options as a hash as the second argument (as of version 1.09). @@ -91,12 +93,12 @@ interpreter_options + [version 1.25] + Array reference of Perl options to be passed to the interpreter. Things like -w or -x can be passed this way. This may be either a single string or an array reference. - This option was added in version 1.25. - signal The expected signal. The default is 0. Use with care! This may not be @@ -142,80 +144,96 @@ Same as stdout above, except for stderr. + script_fails + + [ version 1.28 ] + + script_fails $script, { exit => $expected_exit }, $test_name ); + script_fails $script, \%options, $test_name; + + "script_runs" may be invoked as "script_fails". The exit option is + mandatory when used this way. Since Perl 5.12, die usually returns 255, + but does not promise to do so. Fatal errors like divide by 0 also + return 255 often so it is not the best error code for a trapped + exception. script_runs needs an exit code it considers success, use + warn; exit; instead of die. + script_stdout_is + [version 1.09] + script_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous "script_runs" matches the expected value exactly. - This function was added in version 1.09. - script_stdout_isnt + [version 1.09] + script_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous "script_runs" does NOT match the expected value exactly. - This function was added in version 1.09. - script_stdout_like + [version 1.09] + script_stdout_like $regex, $test_name; Tests if the output to stdout from the previous "script_runs" matches the regular expression. - This function was added in version 1.09. - script_stdout_unlike + [version 1.09] + script_stdout_unlike $regex, $test_name; Tests if the output to stdout from the previous "script_runs" does NOT match the regular expression. - This function was added in version 1.09. - script_stderr_is + [version 1.09] + script_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous "script_runs" matches the expected value exactly. - This function was added in version 1.09. - script_stderr_isnt + [version 1.09] + script_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous "script_runs" does NOT match the expected value exactly. - This function was added in version 1.09. - script_stderr_like + [version 1.09] + script_stderr_like $regex, $test_name; Tests if the output to stderr from the previous "script_runs" matches the regular expression. - This function was added in version 1.09. - script_stderr_unlike + [version 1.09] + script_stderr_unlike $regex, $test_name; Tests if the output to stderr from the previous "script_runs" does NOT match the regular expression. - This function was added in version 1.09. - program_runs + [version 1.26] + program_runs( $program, $test_name ); program_runs( \@program_and_arguments, $test_name ); program_runs( $program, \%options, $test_name ); @@ -233,10 +251,20 @@ See File::Spec or Path::Class for routines useful in building pathnames in a cross-platform way. - This function was added in version 1.26. + program_fails + + [ version 1.28 ] + + program_fails $program, { exit => $expected_exit }, $test_name; + program_fails $program, \%options, $test_name; + + "program_runs" may be invoked as "program_fails". "program_fails" needs + to know the expected exit value, so exit becomes a required option. program_stdout_is + [version 1.26] + program_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous "program_runs" matches @@ -244,6 +272,8 @@ program_stdout_isnt + [version 1.26] + program_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous "program_runs" does NOT @@ -251,6 +281,8 @@ program_stdout_like + [version 1.26] + program_stdout_like $regex, $test_name; Tests if the output to stdout from the previous "program_runs" matches @@ -258,6 +290,8 @@ program_stdout_unlike + [version 1.26] + program_stdout_unlike $regex, $test_name; Tests if the output to stdout from the previous "program_runs" does NOT @@ -265,6 +299,8 @@ program_stderr_is + [version 1.26] + program_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous "program_runs" matches @@ -272,6 +308,8 @@ program_stderr_isnt + [version 1.26] + program_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous "program_runs" does NOT @@ -279,6 +317,8 @@ program_stderr_like + [version 1.26] + program_stderr_like $regex, $test_name; Tests if the output to stderr from the previous "program_runs" matches @@ -286,6 +326,8 @@ program_stderr_unlike + [version 1.26] + program_stderr_unlike $regex, $test_name; Tests if the output to stderr from the previous "program_runs" does NOT @@ -317,9 +359,11 @@ Chris White <c...@cpan.org> + John Karr (BRAINBUZ) + COPYRIGHT AND LICENSE - This software is copyright (c) 2019 by Adam Kennedy. + This software is copyright (c) 2006-2021 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/author.yml new/Test-Script-1.29/author.yml --- old/Test-Script-1.27/author.yml 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/author.yml 2021-05-13 17:17:32.000000000 +0200 @@ -6,6 +6,8 @@ stopwords: # australian spelling. - localised + - BRAINBUZ + - Karr pod_coverage: skip: 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/dist.ini new/Test-Script-1.29/dist.ini --- old/Test-Script-1.27/dist.ini 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/dist.ini 2021-05-13 17:17:32.000000000 +0200 @@ -3,17 +3,20 @@ author = Adam Kennedy license = Perl_5 copyright_holder = Adam Kennedy -copyright_year = 2019 -version = 1.27 +copyright_year = 2006-2021 +version = 1.29 [@Author::Plicease] -:version = 2.44 -travis_status = 1 -release_tests = 1 -test2_v0 = 1 -travis_com = 1 -workflow = windows -workflow = macos +:version = 2.61 +release_tests = 1 +test2_v0 = 1 +github_user = uperl + +workflow = linux +workflow = macos +workflow = windows +workflow = cygwin +workflow = msys2-mingw [RemovePrereqs] remove = strict @@ -46,6 +49,7 @@ original = Adam Kennedy contributor = Brendan Byrd contributor = Chris White <c...@cpan.org> +contributor = John Karr (BRAINBUZ) [PruneFiles] filename = xt/release/changes.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/lib/Test/Script.pm new/Test-Script-1.29/lib/Test/Script.pm --- old/Test-Script-1.27/lib/Test/Script.pm 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/lib/Test/Script.pm 2021-05-13 17:17:32.000000000 +0200 @@ -1,7 +1,7 @@ package Test::Script; # ABSTRACT: Basic cross-platform tests for scripts -our $VERSION = '1.27'; # VERSION +our $VERSION = '1.29'; # VERSION use 5.008001; @@ -21,6 +21,7 @@ our @EXPORT = qw{ script_compiles script_compiles_ok + script_fails script_runs script_stdout_is script_stdout_isnt @@ -30,6 +31,7 @@ script_stderr_isnt script_stderr_like script_stderr_unlike + program_fails program_runs program_stdout_is program_stdout_isnt @@ -167,6 +169,17 @@ goto &_run; } + +sub script_fails { + my $args = _script(shift); + my ( $opt, $testname ) = @_; + $testname = "Script $args->[0] fails" unless defined $testname; + die "exit is a mandatory option for script_fails" + unless eval{ defined $opt->{exit} }; + my $ctx = context(); + return release $ctx, script_runs( $args, $opt, $testname ); +} + # Run a script or program and provide test events corresponding to the results. # Call as _run(\@cmd, \%opt, "Test description") sub _run { @@ -325,6 +338,17 @@ } +sub program_fails { + my $cmd = _script(shift); + my ( $opt, $testname ) = @_; + $testname = 'program_fails' unless defined $testname; + die "exit is a mandatory option for program_fails" + unless eval{ defined $opt->{exit} }; + my $ctx = context(); + return release $ctx, program_runs( $cmd, $opt, $testname ); +} + + sub program_stdout_is { my($pattern, $name) = @_; @@ -480,7 +504,7 @@ =head1 VERSION -version 1.27 +version 1.29 =head1 SYNOPSIS @@ -521,6 +545,8 @@ =head2 script_compiles +[version 1.05] + script_compiles( $script, $test_name ); The L</script_compiles> test calls the script with "perl -c script.pl", @@ -534,10 +560,10 @@ is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. -This function was added in version 1.05. - =head2 script_runs +[version 1.05] + script_runs( $script, $test_name ); script_runs( \@script_and_arguments, $test_name ); script_runs( $script, \%options, $test_name ); @@ -554,7 +580,7 @@ test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. -This function was added in version 1.05. +[version 1.09] You may pass in options as a hash as the second argument (as of version 1.09). @@ -567,12 +593,12 @@ =item interpreter_options +[version 1.25] + Array reference of Perl options to be passed to the interpreter. Things like C<-w> or C<-x> can be passed this way. This may be either a single string or an array reference. -This option was added in version 1.25. - =item signal The expected signal. The default is 0. Use with care! This may not be @@ -625,80 +651,96 @@ =back +=head2 script_fails + +[ version 1.28 ] + + script_fails $script, { exit => $expected_exit }, $test_name ); + script_fails $script, \%options, $test_name; + +L</script_runs> may be invoked as L</script_fails>. The exit option is +mandatory when used this way. Since Perl 5.12, C<die> usually returns 255, +but does not promise to do so. Fatal errors like divide by 0 also return +255 often so it is not the best error code for a trapped exception. +L<script_runs> needs an exit code it considers success, use C<warn; exit;> +instead of die. + =head2 script_stdout_is +[version 1.09] + script_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous L</script_runs> matches the expected value exactly. -This function was added in version 1.09. - =head2 script_stdout_isnt +[version 1.09] + script_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous L</script_runs> does NOT match the expected value exactly. -This function was added in version 1.09. - =head2 script_stdout_like +[version 1.09] + script_stdout_like $regex, $test_name; Tests if the output to stdout from the previous L</script_runs> matches the regular expression. -This function was added in version 1.09. - =head2 script_stdout_unlike +[version 1.09] + script_stdout_unlike $regex, $test_name; Tests if the output to stdout from the previous L</script_runs> does NOT match the regular expression. -This function was added in version 1.09. - =head2 script_stderr_is +[version 1.09] + script_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous L</script_runs> matches the expected value exactly. -This function was added in version 1.09. - =head2 script_stderr_isnt +[version 1.09] + script_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous L</script_runs> does NOT match the expected value exactly. -This function was added in version 1.09. - =head2 script_stderr_like +[version 1.09] + script_stderr_like $regex, $test_name; Tests if the output to stderr from the previous L</script_runs> matches the regular expression. -This function was added in version 1.09. - =head2 script_stderr_unlike +[version 1.09] + script_stderr_unlike $regex, $test_name; Tests if the output to stderr from the previous L</script_runs> does NOT match the regular expression. -This function was added in version 1.09. - =head2 program_runs +[version 1.26] + program_runs( $program, $test_name ); program_runs( \@program_and_arguments, $test_name ); program_runs( $program, \%options, $test_name ); @@ -724,10 +766,20 @@ See L<File::Spec> or L<Path::Class> for routines useful in building pathnames in a cross-platform way. -This function was added in version 1.26. +=head2 program_fails + +[ version 1.28 ] + + program_fails $program, { exit => $expected_exit }, $test_name; + program_fails $program, \%options, $test_name; + +L</program_runs> may be invoked as L</program_fails>. L</program_fails> +needs to know the expected exit value, so exit becomes a required option. =head2 program_stdout_is +[version 1.26] + program_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous L</program_runs> matches the @@ -735,6 +787,8 @@ =head2 program_stdout_isnt +[version 1.26] + program_stdout_is $expected_stdout, $test_name; Tests if the output to stdout from the previous L</program_runs> does NOT match the @@ -742,6 +796,8 @@ =head2 program_stdout_like +[version 1.26] + program_stdout_like $regex, $test_name; Tests if the output to stdout from the previous L</program_runs> matches the regular @@ -749,6 +805,8 @@ =head2 program_stdout_unlike +[version 1.26] + program_stdout_unlike $regex, $test_name; Tests if the output to stdout from the previous L</program_runs> does NOT match the regular @@ -756,6 +814,8 @@ =head2 program_stderr_is +[version 1.26] + program_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous L</program_runs> matches the @@ -763,6 +823,8 @@ =head2 program_stderr_isnt +[version 1.26] + program_stderr_is $expected_stderr, $test_name; Tests if the output to stderr from the previous L</program_runs> does NOT match the @@ -770,6 +832,8 @@ =head2 program_stderr_like +[version 1.26] + program_stderr_like $regex, $test_name; Tests if the output to stderr from the previous L</program_runs> matches the regular @@ -777,6 +841,8 @@ =head2 program_stderr_unlike +[version 1.26] + program_stderr_unlike $regex, $test_name; Tests if the output to stderr from the previous L</program_runs> does NOT match the regular @@ -807,9 +873,11 @@ Chris White E<lt>c...@cpan.orge<gt> +John Karr (BRAINBUZ) + =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2019 by Adam Kennedy. +This software is copyright (c) 2006-2021 by Adam Kennedy. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/t/bin/liveordie.pl new/Test-Script-1.29/t/bin/liveordie.pl --- old/Test-Script-1.27/t/bin/liveordie.pl 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Script-1.29/t/bin/liveordie.pl 2021-05-13 17:17:32.000000000 +0200 @@ -0,0 +1,15 @@ +#!perl + +use strict; + +my ( $dothis, $code ) = @ARGV; + +if ( $dothis eq 'die' ) { + die 'Instructed to DIE!'; +} elsif ( $dothis eq 'fail' ) { + print STDERR "Exit: $code\n"; + exit( $code ); +} else { + print STDOUT "I lived\n"; + exit(0); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/t/test_script__fails.t new/Test-Script-1.29/t/test_script__fails.t --- old/Test-Script-1.27/t/test_script__fails.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Test-Script-1.29/t/test_script__fails.t 2021-05-13 17:17:32.000000000 +0200 @@ -0,0 +1,87 @@ +use Test2::V0 -no_srand => 1; +use Test::Script; +use File::Temp qw( tempdir ); +use Data::Dumper qw( Dumper ); +use Probe::Perl; + +# Use the Perl interpreter as the program since it's the only one we know +# exists. The files in t/bin do not use any modules, so we don't have +# to worry about passing @INC down. +my $perl = Probe::Perl->find_perl_interpreter() or die "Can't find perl"; + +subtest 'script_fails' => sub { + my $rv; + my $events; + + is( + $events = intercept { + $rv = script_fails( ['t/bin/liveordie.pl', 'fail', 111 ], { exit => 111 }) }, + array { + event Ok => sub { + call pass => T(); + call name => 'Script t/bin/liveordie.pl fails'; + }; + end; + }, + 'script that failes with expected exit code passes .', + ); + + $events = intercept { + $rv = script_fails('t/bin/liveordie.pl', {exit=>255})}; + is( $events->[0]{pass}, 0, 'script that lives fails script_fails'); + +}; + +subtest exception => sub { + my $events; + + $events = intercept { program_fails( [$perl, 't/bin/missing.pl'],{ exit => 255 } ) }; + is( $events->[0]{pass}, 0, 'missing program failed for program_fails'); + + like ( + dies { + script_fails( ['t/bin/liveordie.pl', 'die' ], undef, 'test named X') }, + qr/exit is a mandatory option/, + 'exit is a mandatory option for script_fails' + ); + + like ( + dies { program_fails( [$perl, 't/bin/missing.pl'], 'test named X' ) }, + # dies sub { program_fails( [$perl, 't/bin/missing.pl'], 'test named X'}, + qr/exit is a mandatory option for program_fails/, + 'exit is a mandatory option for program_fails' + ); +}; + +subtest 'program_fails' => sub { + my $events; + + $events = intercept { + program_fails( [ $perl, 't/bin/missing.pl' ], { exit => 0 } ) + }; + is( $events->[0]{pass}, 0, 'missing program failed for program_fails' ); + is( $events->[0]{name}, + 'program_fails', 'testname set to program_fails when none provided', + ); + program_fails( + [ $perl, 't/bin/liveordie.pl', 'fail', 16 ], + { exit => 16 }, + 'parameters in array' + ); + + program_fails( + ["$perl t/bin/liveordie.pl fail 17"], + { exit => 17 }, + 'parameters in string with program name' + ); + + $events = intercept { + program_fails( [ $perl, 't/bin/liveordie.pl', 'fail', 18 ], + { exit => 17 } ) + }; + is( $events->[0]{pass}, + 0, 'program had wrong exit code is marked failure' ); + +}; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/xt/author/pod_coverage.t new/Test-Script-1.29/xt/author/pod_coverage.t --- old/Test-Script-1.27/xt/author/pod_coverage.t 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/xt/author/pod_coverage.t 2021-05-13 17:17:32.000000000 +0200 @@ -31,10 +31,10 @@ my @private_classes; my %private_methods; -push @{ $config->{pod_coverage}->{private} }, +push $config->{pod_coverage}->{private}->@*, 'Alien::.*::Install::Files#Inline'; -foreach my $private (@{ $config->{pod_coverage}->{private} }) +foreach my $private ($config->{pod_coverage}->{private}->@*) { my($class,$method) = split /#/, $private; if(defined $class && $class ne '') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Script-1.27/xt/author/pod_spelling_system.t new/Test-Script-1.29/xt/author/pod_spelling_system.t --- old/Test-Script-1.27/xt/author/pod_spelling_system.t 2021-02-17 21:16:00.000000000 +0100 +++ new/Test-Script-1.29/xt/author/pod_spelling_system.t 2021-05-13 17:17:32.000000000 +0200 @@ -24,7 +24,7 @@ chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir)); -add_stopwords(@{ $config->{pod_spelling_system}->{stopwords} }); +add_stopwords($config->{pod_spelling_system}->{stopwords}->@*); add_stopwords(qw( Plicease stdout