This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Test-Harness to CPAN version 3.22
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 16 Aug 2010 16:04:27 +0000 (17:04 +0100)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Mon, 16 Aug 2010 16:06:29 +0000 (17:06 +0100)
  [DELTA]

  3.22    2010-08-14
        - Allow TAP::Parser to recognize a nested BAIL_OUT directive.
        - Add brief HOWTO for creating and running pgTAP tests to
          TAP::Parser::SourceHandler::pgTAP.
        - Fix trailing plan + embedded YAML + TAP 13 case. Thanks to
          Steffen Schwigon. #54518.
        - Numerous spelling fixes. Thanks to Ville Skytt<C3><A4>.
        - Add new option --tapversion for prove to set the default
          assumed TAP version. Thanks to Steffen Schwigon.
        - Fixed tests to run successfully under Devel::Cover. Thanks to
          Phillipe Bruhat.
        - Fixed injection of test args to work with general executables
          as well as Perl scripts (#59186).
        - Allow multiple --ext=.foo arguments to prove, to allow running
          different types of tests in the same prove run.
        - App::Prove::extension() is now App::Prove::extensions(), and
          returns an arrayref of extensions, rather than a single scalar.
          The same change has been made to App::Prove::State::extension().
        - Preserve old semantics for test scripts with a shebang line
          by favouring Perl as the intepreter for any file with a
          shebang (#59457).
        - Add --trap (summary on Ctrl-C) option to prove (#59427).
        - Removed TAP::Parser::SourceHandler::pgTAP. Find it in its own
          distribution on CPAN.
        - Source options to prove can now be specified so as to be passed to
          the source as a hash reference, eg:

              prove --source XYZ --xyz-option pset=foo=bar

          Ths "pset" option will be passed as a hash reference with the key
          "foo" and the value "bar".

89 files changed:
MANIFEST
Porting/Maintainers.pl
Porting/exec-bit.txt
cpan/Test-Harness/Changes
cpan/Test-Harness/MANIFEST
cpan/Test-Harness/MANIFEST.CUMMULATIVE
cpan/Test-Harness/bin/prove
cpan/Test-Harness/lib/App/Prove.pm
cpan/Test-Harness/lib/App/Prove/State.pm
cpan/Test-Harness/lib/App/Prove/State/Result.pm
cpan/Test-Harness/lib/App/Prove/State/Result/Test.pm
cpan/Test-Harness/lib/TAP/Base.pm
cpan/Test-Harness/lib/TAP/Formatter/Base.pm
cpan/Test-Harness/lib/TAP/Formatter/Color.pm
cpan/Test-Harness/lib/TAP/Formatter/Console.pm
cpan/Test-Harness/lib/TAP/Formatter/Console/ParallelSession.pm
cpan/Test-Harness/lib/TAP/Formatter/Console/Session.pm
cpan/Test-Harness/lib/TAP/Formatter/File.pm
cpan/Test-Harness/lib/TAP/Formatter/File/Session.pm
cpan/Test-Harness/lib/TAP/Formatter/Session.pm
cpan/Test-Harness/lib/TAP/Harness.pm
cpan/Test-Harness/lib/TAP/Harness/Beyond.pod
cpan/Test-Harness/lib/TAP/Object.pm
cpan/Test-Harness/lib/TAP/Parser.pm
cpan/Test-Harness/lib/TAP/Parser/Aggregator.pm
cpan/Test-Harness/lib/TAP/Parser/Grammar.pm
cpan/Test-Harness/lib/TAP/Parser/Iterator.pm
cpan/Test-Harness/lib/TAP/Parser/Iterator/Array.pm
cpan/Test-Harness/lib/TAP/Parser/Iterator/Process.pm
cpan/Test-Harness/lib/TAP/Parser/Iterator/Stream.pm
cpan/Test-Harness/lib/TAP/Parser/IteratorFactory.pm
cpan/Test-Harness/lib/TAP/Parser/Multiplexer.pm
cpan/Test-Harness/lib/TAP/Parser/Result.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Bailout.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Comment.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Plan.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Pragma.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Test.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Unknown.pm
cpan/Test-Harness/lib/TAP/Parser/Result/Version.pm
cpan/Test-Harness/lib/TAP/Parser/Result/YAML.pm
cpan/Test-Harness/lib/TAP/Parser/ResultFactory.pm
cpan/Test-Harness/lib/TAP/Parser/Scheduler.pm
cpan/Test-Harness/lib/TAP/Parser/Scheduler/Job.pm
cpan/Test-Harness/lib/TAP/Parser/Scheduler/Spinner.pm
cpan/Test-Harness/lib/TAP/Parser/Source.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm
cpan/Test-Harness/lib/TAP/Parser/SourceHandler/pgTAP.pm [deleted file]
cpan/Test-Harness/lib/TAP/Parser/Utils.pm
cpan/Test-Harness/lib/TAP/Parser/YAMLish/Reader.pm
cpan/Test-Harness/lib/TAP/Parser/YAMLish/Writer.pm
cpan/Test-Harness/lib/Test/Harness.pm
cpan/Test-Harness/t/compat/inc-propagation.t
cpan/Test-Harness/t/compat/inc_taint.t
cpan/Test-Harness/t/compat/test-harness-compat.t
cpan/Test-Harness/t/file.t
cpan/Test-Harness/t/grammar.t
cpan/Test-Harness/t/harness-subclass.t
cpan/Test-Harness/t/harness.t
cpan/Test-Harness/t/iterator_factory.t
cpan/Test-Harness/t/lib/MyShebangger.pm [deleted file]
cpan/Test-Harness/t/nested.t [new file with mode: 0644]
cpan/Test-Harness/t/nofork-mux.t
cpan/Test-Harness/t/nofork.t
cpan/Test-Harness/t/parse.t
cpan/Test-Harness/t/parser-config.t
cpan/Test-Harness/t/parser-subclass.t
cpan/Test-Harness/t/prove.t
cpan/Test-Harness/t/proverc.t
cpan/Test-Harness/t/proverun.t
cpan/Test-Harness/t/proveversion.t [new file with mode: 0644]
cpan/Test-Harness/t/regression.t
cpan/Test-Harness/t/sample-tests/simple_yaml_missing_version13 [new file with mode: 0644]
cpan/Test-Harness/t/sample-tests/yaml_late_plan [new file with mode: 0644]
cpan/Test-Harness/t/source.t
cpan/Test-Harness/t/source_handler.t
cpan/Test-Harness/t/source_tests/psql [deleted file]
cpan/Test-Harness/t/source_tests/psql.bat
cpan/Test-Harness/t/source_tests/source_args.sh [new file with mode: 0755]
cpan/Test-Harness/t/spool.t
cpan/Test-Harness/t/state.t
cpan/Test-Harness/t/state_results.t
cpan/Test-Harness/t/taint.t
cpan/Test-Harness/t/testargs.t

index 4744efd..3036d73 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2060,7 +2060,6 @@ cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Executable.pm
 cpan/Test-Harness/lib/TAP/Parser/SourceHandler/File.pm
 cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Handle.pm
 cpan/Test-Harness/lib/TAP/Parser/SourceHandler/Perl.pm
-cpan/Test-Harness/lib/TAP/Parser/SourceHandler/pgTAP.pm
 cpan/Test-Harness/lib/TAP/Parser/SourceHandler.pm              A parser for Test Anything Protocol
 cpan/Test-Harness/lib/TAP/Parser/SourceHandler/RawTAP.pm
 cpan/Test-Harness/lib/TAP/Parser/Source.pm             A parser for Test Anything Protocol
@@ -2110,13 +2109,13 @@ cpan/Test-Harness/t/lib/MyIterator.pm                   Module for testing Test::Harness
 cpan/Test-Harness/t/lib/MyPerlSourceHandler.pm                         Test::Harness test
 cpan/Test-Harness/t/lib/MyResultFactory.pm             Module for testing Test::Harness
 cpan/Test-Harness/t/lib/MyResult.pm                    Module for testing Test::Harness
-cpan/Test-Harness/t/lib/MyShebangger.pm                                Test::Harness test
 cpan/Test-Harness/t/lib/MySourceHandler.pm                             Test::Harness test
 cpan/Test-Harness/t/lib/NoFork.pm                      Module for testing Test::Harness
 cpan/Test-Harness/t/lib/NOP.pm                         Module for testing Test::Harness
 cpan/Test-Harness/t/lib/TAP/Harness/TestSubclass.pm
 cpan/Test-Harness/t/lib/TAP/Parser/SubclassTest.pm     Module for testing Test::Harness
 cpan/Test-Harness/t/multiplexer.t                      Test::Harness test
+cpan/Test-Harness/t/nested.t                           Test::Harness test
 cpan/Test-Harness/t/nofork-mux.t                       Test::Harness test
 cpan/Test-Harness/t/nofork.t                           Test::Harness test
 cpan/Test-Harness/t/object.t                           Test::Harness test
@@ -2131,6 +2130,7 @@ cpan/Test-Harness/t/proverc/emptyexec                     Test data for Test::Harness
 cpan/Test-Harness/t/proverc.t                          Test::Harness test
 cpan/Test-Harness/t/proverun.t                         Test::Harness test
 cpan/Test-Harness/t/prove.t                            Test::Harness test
+cpan/Test-Harness/t/proveversion.t                             Test::Harness test
 cpan/Test-Harness/t/regression.t                       Test::Harness test
 cpan/Test-Harness/t/results.t                          Test::Harness test
 cpan/Test-Harness/t/sample-tests/bailout               Test data for Test::Harness
@@ -2167,6 +2167,7 @@ cpan/Test-Harness/t/sample-tests/shbang_misparse  Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/simple                        Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/simple_fail           Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/simple_yaml           Test data for Test::Harness
+cpan/Test-Harness/t/sample-tests/simple_yaml_missing_version13         Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/skip                  Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/skipall               Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/skipall_nomsg         Test data for Test::Harness
@@ -2187,6 +2188,7 @@ cpan/Test-Harness/t/sample-tests/version_late             Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/version_old           Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/vms_nit               Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/with_comments         Test data for Test::Harness
+cpan/Test-Harness/t/sample-tests/yaml_late_plan                Test data for Test::Harness
 cpan/Test-Harness/t/sample-tests/zero_valid            Test data for Test::Harness
 cpan/Test-Harness/t/scheduler.t                                Test::Harness test
 cpan/Test-Harness/t/source_handler.t                           Test::Harness test
@@ -2196,10 +2198,10 @@ cpan/Test-Harness/t/source_tests/harness_badtap         Test data for Test::Harness
 cpan/Test-Harness/t/source_tests/harness_complain      Test data for Test::Harness
 cpan/Test-Harness/t/source_tests/harness_directives    Test data for Test::Harness
 cpan/Test-Harness/t/source_tests/harness_failure       Test data for Test::Harness
-cpan/Test-Harness/t/source_tests/psql                          Test::Harness test
 cpan/Test-Harness/t/source_tests/psql.bat                              Test::Harness test
 cpan/Test-Harness/t/source_tests/source                        Test data for Test::Harness
 cpan/Test-Harness/t/source_tests/source.1                              Test::Harness test
+cpan/Test-Harness/t/source_tests/source_args.sh                                Test::Harness test
 cpan/Test-Harness/t/source_tests/source.bat                            Test::Harness test
 cpan/Test-Harness/t/source_tests/source.pl                             Test::Harness test
 cpan/Test-Harness/t/source_tests/source.sh                             Test::Harness test
index 8d09aa9..9b839d9 100644 (file)
@@ -1328,7 +1328,7 @@ use File::Glob qw(:case);
     'Test::Harness' =>
        {
        'MAINTAINER'    => 'andya',
-       'DISTRIBUTION'  => 'ANDYA/Test-Harness-3.21.tar.gz',
+       'DISTRIBUTION'  => 'ANDYA/Test-Harness-3.22.tar.gz',
        'FILES'         => q[cpan/Test-Harness],
        'EXCLUDED'      => [ qr{^examples/},
                             qr{^inc/},
index b50517d..4b27afd 100644 (file)
@@ -7,6 +7,7 @@ Configure
 configpm
 configure.gnu
 cpan/Test-Harness/t/source_tests/source.sh
+cpan/Test-Harness/t/source_tests/source_args.sh
 embed.pl
 installperl
 installman
index 098853a..bb75821 100644 (file)
@@ -1,5 +1,37 @@
 Revision history for Test-Harness
 
+3.22    2010-08-14
+        - Allow TAP::Parser to recognize a nested BAIL_OUT directive.
+        - Add brief HOWTO for creating and running pgTAP tests to
+          TAP::Parser::SourceHandler::pgTAP.
+        - Fix trailing plan + embedded YAML + TAP 13 case. Thanks to
+          Steffen Schwigon. #54518.
+        - Numerous spelling fixes. Thanks to Ville Skyttä.
+        - Add new option --tapversion for prove to set the default
+          assumed TAP version. Thanks to Steffen Schwigon.
+        - Fixed tests to run successfully under Devel::Cover. Thanks to
+          Phillipe Bruhat.
+        - Fixed injection of test args to work with general executables
+          as well as Perl scripts (#59186).
+        - Allow multiple --ext=.foo arguments to prove, to allow running
+          different types of tests in the same prove run.
+        - App::Prove::extension() is now App::Prove::extensions(), and
+          returns an arrayref of extensions, rather than a single scalar.
+          The same change has been made to App::Prove::State::extension().
+        - Preserve old semantics for test scripts with a shebang line
+          by favouring Perl as the intepreter for any file with a
+          shebang (#59457).
+        - Add --trap (summary on Ctrl-C) option to prove (#59427).
+        - Removed TAP::Parser::SourceHandler::pgTAP. Find it in its own
+          distribution on CPAN.
+        - Source options to prove can now be specified so as to be passed to
+          the source as a hash reference, eg:
+
+              prove --source XYZ --xyz-option pset=foo=bar
+
+          Ths "pset" option will be passed as a hash reference with the key
+          "foo" and the value "bar".
+
 3.21    2010-01-30
         - Add test to ensure we're not depending on a module we no
           longer ship.
index b3aa2f8..ee35512 100644 (file)
@@ -1,5 +1,4 @@
 bin/prove
-Build.PL
 Changes
 Changes-2.64
 examples/analyze_tests.pl
@@ -60,15 +59,16 @@ lib/TAP/Parser/SourceHandler/Executable.pm
 lib/TAP/Parser/SourceHandler/File.pm
 lib/TAP/Parser/SourceHandler/Handle.pm
 lib/TAP/Parser/SourceHandler/Perl.pm
-lib/TAP/Parser/SourceHandler/pgTAP.pm
 lib/TAP/Parser/SourceHandler/RawTAP.pm
 lib/TAP/Parser/Utils.pm
 lib/TAP/Parser/YAMLish/Reader.pm
 lib/TAP/Parser/YAMLish/Writer.pm
 lib/Test/Harness.pm
+Makefile.PL
 MANIFEST
 MANIFEST.CUMMULATIVE
 META.yml
+NotBuild.PL
 perlcriticrc
 README
 t/000-load.t
@@ -112,7 +112,6 @@ t/lib/MyIterator.pm
 t/lib/MyPerlSourceHandler.pm
 t/lib/MyResult.pm
 t/lib/MyResultFactory.pm
-t/lib/MyShebangger.pm
 t/lib/MySourceHandler.pm
 t/lib/NoFork.pm
 t/lib/NOP.pm
@@ -123,6 +122,7 @@ t/lib/Test/Builder/Module.pm
 t/lib/Test/More.pm
 t/lib/Test/Simple.pm
 t/multiplexer.t
+t/nested.t
 t/nofork-mux.t
 t/nofork.t
 t/object.t
@@ -137,6 +137,7 @@ t/proveenv.t
 t/proverc.t
 t/proverc/emptyexec
 t/proverun.t
+t/proveversion.t
 t/regression.t
 t/results.t
 t/sample-tests/bailout
@@ -173,6 +174,7 @@ t/sample-tests/shbang_misparse
 t/sample-tests/simple
 t/sample-tests/simple_fail
 t/sample-tests/simple_yaml
+t/sample-tests/simple_yaml_missing_version13
 t/sample-tests/skip
 t/sample-tests/skip_nomsg
 t/sample-tests/skipall
@@ -193,6 +195,7 @@ t/sample-tests/version_late
 t/sample-tests/version_old
 t/sample-tests/vms_nit
 t/sample-tests/with_comments
+t/sample-tests/yaml_late_plan
 t/sample-tests/zero_valid
 t/scheduler.t
 t/source.t
@@ -202,7 +205,6 @@ t/source_tests/harness_badtap
 t/source_tests/harness_complain
 t/source_tests/harness_directives
 t/source_tests/harness_failure
-t/source_tests/psql
 t/source_tests/psql.bat
 t/source_tests/source
 t/source_tests/source.1
@@ -211,6 +213,7 @@ t/source_tests/source.pl
 t/source_tests/source.sh
 t/source_tests/source.t
 t/source_tests/source.tap
+t/source_tests/source_args.sh
 t/spool.t
 t/state.t
 t/state_results.t
index bce47c4..4b7059a 100644 (file)
@@ -7,8 +7,243 @@ MANIFEST
 MANIFEST.CUMMULATIVE
 META.yml
 Makefile.PL
+NotBuild.PL
 README
 TODO
+Test-Harness-3.22/Changes
+Test-Harness-3.22/Changes-2.64
+Test-Harness-3.22/HACKING.pod
+Test-Harness-3.22/MANIFEST
+Test-Harness-3.22/MANIFEST.CUMMULATIVE
+Test-Harness-3.22/META.yml
+Test-Harness-3.22/Makefile.PL
+Test-Harness-3.22/NotBuild.PL
+Test-Harness-3.22/README
+Test-Harness-3.22/bin/prove
+Test-Harness-3.22/examples/README
+Test-Harness-3.22/examples/analyze_tests.pl
+Test-Harness-3.22/examples/bin/forked_tests.pl
+Test-Harness-3.22/examples/bin/test_html.pl
+Test-Harness-3.22/examples/bin/tprove_gtk
+Test-Harness-3.22/examples/harness-hook/hook.pl
+Test-Harness-3.22/examples/harness-hook/lib/Harness/Hook.pm
+Test-Harness-3.22/examples/my_exec
+Test-Harness-3.22/examples/silent-harness.pl
+Test-Harness-3.22/examples/t/10-stuff.t
+Test-Harness-3.22/examples/t/ruby.t
+Test-Harness-3.22/examples/test_urls.txt
+Test-Harness-3.22/inc/MyBuilder.pm
+Test-Harness-3.22/lib/App/Prove.pm
+Test-Harness-3.22/lib/App/Prove/State.pm
+Test-Harness-3.22/lib/App/Prove/State/Result.pm
+Test-Harness-3.22/lib/App/Prove/State/Result/Test.pm
+Test-Harness-3.22/lib/TAP/Base.pm
+Test-Harness-3.22/lib/TAP/Formatter/Base.pm
+Test-Harness-3.22/lib/TAP/Formatter/Color.pm
+Test-Harness-3.22/lib/TAP/Formatter/Console.pm
+Test-Harness-3.22/lib/TAP/Formatter/Console/ParallelSession.pm
+Test-Harness-3.22/lib/TAP/Formatter/Console/Session.pm
+Test-Harness-3.22/lib/TAP/Formatter/File.pm
+Test-Harness-3.22/lib/TAP/Formatter/File/Session.pm
+Test-Harness-3.22/lib/TAP/Formatter/Session.pm
+Test-Harness-3.22/lib/TAP/Harness.pm
+Test-Harness-3.22/lib/TAP/Harness/Beyond.pod
+Test-Harness-3.22/lib/TAP/Object.pm
+Test-Harness-3.22/lib/TAP/Parser.pm
+Test-Harness-3.22/lib/TAP/Parser/Aggregator.pm
+Test-Harness-3.22/lib/TAP/Parser/Grammar.pm
+Test-Harness-3.22/lib/TAP/Parser/Iterator.pm
+Test-Harness-3.22/lib/TAP/Parser/Iterator/Array.pm
+Test-Harness-3.22/lib/TAP/Parser/Iterator/Process.pm
+Test-Harness-3.22/lib/TAP/Parser/Iterator/Stream.pm
+Test-Harness-3.22/lib/TAP/Parser/IteratorFactory.pm
+Test-Harness-3.22/lib/TAP/Parser/Multiplexer.pm
+Test-Harness-3.22/lib/TAP/Parser/Result.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Bailout.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Comment.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Plan.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Pragma.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Test.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Unknown.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/Version.pm
+Test-Harness-3.22/lib/TAP/Parser/Result/YAML.pm
+Test-Harness-3.22/lib/TAP/Parser/ResultFactory.pm
+Test-Harness-3.22/lib/TAP/Parser/Scheduler.pm
+Test-Harness-3.22/lib/TAP/Parser/Scheduler/Job.pm
+Test-Harness-3.22/lib/TAP/Parser/Scheduler/Spinner.pm
+Test-Harness-3.22/lib/TAP/Parser/Source.pm
+Test-Harness-3.22/lib/TAP/Parser/SourceHandler.pm
+Test-Harness-3.22/lib/TAP/Parser/SourceHandler/Executable.pm
+Test-Harness-3.22/lib/TAP/Parser/SourceHandler/File.pm
+Test-Harness-3.22/lib/TAP/Parser/SourceHandler/Handle.pm
+Test-Harness-3.22/lib/TAP/Parser/SourceHandler/Perl.pm
+Test-Harness-3.22/lib/TAP/Parser/SourceHandler/RawTAP.pm
+Test-Harness-3.22/lib/TAP/Parser/Utils.pm
+Test-Harness-3.22/lib/TAP/Parser/YAMLish/Reader.pm
+Test-Harness-3.22/lib/TAP/Parser/YAMLish/Writer.pm
+Test-Harness-3.22/lib/Test/Harness.pm
+Test-Harness-3.22/perlcriticrc
+Test-Harness-3.22/t/000-load.t
+Test-Harness-3.22/t/aggregator.t
+Test-Harness-3.22/t/bailout.t
+Test-Harness-3.22/t/base.t
+Test-Harness-3.22/t/callbacks.t
+Test-Harness-3.22/t/compat/env.t
+Test-Harness-3.22/t/compat/failure.t
+Test-Harness-3.22/t/compat/inc-propagation.t
+Test-Harness-3.22/t/compat/inc_taint.t
+Test-Harness-3.22/t/compat/nonumbers.t
+Test-Harness-3.22/t/compat/regression.t
+Test-Harness-3.22/t/compat/subclass.t
+Test-Harness-3.22/t/compat/switches.t
+Test-Harness-3.22/t/compat/test-harness-compat.t
+Test-Harness-3.22/t/compat/version.t
+Test-Harness-3.22/t/console.t
+Test-Harness-3.22/t/data/catme.1
+Test-Harness-3.22/t/data/proverc
+Test-Harness-3.22/t/data/sample.yml
+Test-Harness-3.22/t/errors.t
+Test-Harness-3.22/t/file.t
+Test-Harness-3.22/t/glob-to-regexp.t
+Test-Harness-3.22/t/grammar.t
+Test-Harness-3.22/t/harness-bailout.t
+Test-Harness-3.22/t/harness-subclass.t
+Test-Harness-3.22/t/harness.t
+Test-Harness-3.22/t/iterator_factory.t
+Test-Harness-3.22/t/iterators.t
+Test-Harness-3.22/t/lib/App/Prove/Plugin/Dummy.pm
+Test-Harness-3.22/t/lib/App/Prove/Plugin/Dummy2.pm
+Test-Harness-3.22/t/lib/Dev/Null.pm
+Test-Harness-3.22/t/lib/EmptyParser.pm
+Test-Harness-3.22/t/lib/IO/c55Capture.pm
+Test-Harness-3.22/t/lib/MyCustom.pm
+Test-Harness-3.22/t/lib/MyFileSourceHandler.pm
+Test-Harness-3.22/t/lib/MyGrammar.pm
+Test-Harness-3.22/t/lib/MyIterator.pm
+Test-Harness-3.22/t/lib/MyPerlSourceHandler.pm
+Test-Harness-3.22/t/lib/MyResult.pm
+Test-Harness-3.22/t/lib/MyResultFactory.pm
+Test-Harness-3.22/t/lib/MySourceHandler.pm
+Test-Harness-3.22/t/lib/NOP.pm
+Test-Harness-3.22/t/lib/NoFork.pm
+Test-Harness-3.22/t/lib/TAP/Harness/TestSubclass.pm
+Test-Harness-3.22/t/lib/TAP/Parser/SubclassTest.pm
+Test-Harness-3.22/t/lib/Test/Builder.pm
+Test-Harness-3.22/t/lib/Test/Builder/Module.pm
+Test-Harness-3.22/t/lib/Test/More.pm
+Test-Harness-3.22/t/lib/Test/Simple.pm
+Test-Harness-3.22/t/lib/if.pm
+Test-Harness-3.22/t/multiplexer.t
+Test-Harness-3.22/t/nested.t
+Test-Harness-3.22/t/nofork-mux.t
+Test-Harness-3.22/t/nofork.t
+Test-Harness-3.22/t/object.t
+Test-Harness-3.22/t/parse.t
+Test-Harness-3.22/t/parser-config.t
+Test-Harness-3.22/t/parser-subclass.t
+Test-Harness-3.22/t/perl5lib.t
+Test-Harness-3.22/t/premature-bailout.t
+Test-Harness-3.22/t/process.t
+Test-Harness-3.22/t/prove.t
+Test-Harness-3.22/t/proveenv.t
+Test-Harness-3.22/t/proverc.t
+Test-Harness-3.22/t/proverc/emptyexec
+Test-Harness-3.22/t/proverun.t
+Test-Harness-3.22/t/proveversion.t
+Test-Harness-3.22/t/regression.t
+Test-Harness-3.22/t/results.t
+Test-Harness-3.22/t/sample-tests/bailout
+Test-Harness-3.22/t/sample-tests/bignum
+Test-Harness-3.22/t/sample-tests/bignum_many
+Test-Harness-3.22/t/sample-tests/combined
+Test-Harness-3.22/t/sample-tests/combined_compat
+Test-Harness-3.22/t/sample-tests/delayed
+Test-Harness-3.22/t/sample-tests/descriptive
+Test-Harness-3.22/t/sample-tests/descriptive_trailing
+Test-Harness-3.22/t/sample-tests/die
+Test-Harness-3.22/t/sample-tests/die_head_end
+Test-Harness-3.22/t/sample-tests/die_last_minute
+Test-Harness-3.22/t/sample-tests/die_unfinished
+Test-Harness-3.22/t/sample-tests/duplicates
+Test-Harness-3.22/t/sample-tests/echo
+Test-Harness-3.22/t/sample-tests/empty
+Test-Harness-3.22/t/sample-tests/escape_eol
+Test-Harness-3.22/t/sample-tests/escape_hash
+Test-Harness-3.22/t/sample-tests/head_end
+Test-Harness-3.22/t/sample-tests/head_fail
+Test-Harness-3.22/t/sample-tests/inc_taint
+Test-Harness-3.22/t/sample-tests/junk_before_plan
+Test-Harness-3.22/t/sample-tests/lone_not_bug
+Test-Harness-3.22/t/sample-tests/no_nums
+Test-Harness-3.22/t/sample-tests/no_output
+Test-Harness-3.22/t/sample-tests/out_err_mix
+Test-Harness-3.22/t/sample-tests/out_of_order
+Test-Harness-3.22/t/sample-tests/schwern
+Test-Harness-3.22/t/sample-tests/schwern-todo-quiet
+Test-Harness-3.22/t/sample-tests/segfault
+Test-Harness-3.22/t/sample-tests/sequence_misparse
+Test-Harness-3.22/t/sample-tests/shbang_misparse
+Test-Harness-3.22/t/sample-tests/simple
+Test-Harness-3.22/t/sample-tests/simple_fail
+Test-Harness-3.22/t/sample-tests/simple_yaml
+Test-Harness-3.22/t/sample-tests/simple_yaml_missing_version13
+Test-Harness-3.22/t/sample-tests/skip
+Test-Harness-3.22/t/sample-tests/skip_nomsg
+Test-Harness-3.22/t/sample-tests/skipall
+Test-Harness-3.22/t/sample-tests/skipall_nomsg
+Test-Harness-3.22/t/sample-tests/skipall_v13
+Test-Harness-3.22/t/sample-tests/space_after_plan
+Test-Harness-3.22/t/sample-tests/stdout_stderr
+Test-Harness-3.22/t/sample-tests/strict
+Test-Harness-3.22/t/sample-tests/switches
+Test-Harness-3.22/t/sample-tests/taint
+Test-Harness-3.22/t/sample-tests/taint_warn
+Test-Harness-3.22/t/sample-tests/todo
+Test-Harness-3.22/t/sample-tests/todo_inline
+Test-Harness-3.22/t/sample-tests/todo_misparse
+Test-Harness-3.22/t/sample-tests/too_many
+Test-Harness-3.22/t/sample-tests/version_good
+Test-Harness-3.22/t/sample-tests/version_late
+Test-Harness-3.22/t/sample-tests/version_old
+Test-Harness-3.22/t/sample-tests/vms_nit
+Test-Harness-3.22/t/sample-tests/with_comments
+Test-Harness-3.22/t/sample-tests/yaml_late_plan
+Test-Harness-3.22/t/sample-tests/zero_valid
+Test-Harness-3.22/t/scheduler.t
+Test-Harness-3.22/t/source.t
+Test-Harness-3.22/t/source_handler.t
+Test-Harness-3.22/t/source_tests/harness
+Test-Harness-3.22/t/source_tests/harness_badtap
+Test-Harness-3.22/t/source_tests/harness_complain
+Test-Harness-3.22/t/source_tests/harness_directives
+Test-Harness-3.22/t/source_tests/harness_failure
+Test-Harness-3.22/t/source_tests/psql.bat
+Test-Harness-3.22/t/source_tests/source
+Test-Harness-3.22/t/source_tests/source.1
+Test-Harness-3.22/t/source_tests/source.bat
+Test-Harness-3.22/t/source_tests/source.pl
+Test-Harness-3.22/t/source_tests/source.sh
+Test-Harness-3.22/t/source_tests/source.t
+Test-Harness-3.22/t/source_tests/source.tap
+Test-Harness-3.22/t/source_tests/source_args.sh
+Test-Harness-3.22/t/spool.t
+Test-Harness-3.22/t/state.t
+Test-Harness-3.22/t/state_results.t
+Test-Harness-3.22/t/streams.t
+Test-Harness-3.22/t/subclass_tests/non_perl_source
+Test-Harness-3.22/t/subclass_tests/perl_source
+Test-Harness-3.22/t/taint.t
+Test-Harness-3.22/t/testargs.t
+Test-Harness-3.22/t/unicode.t
+Test-Harness-3.22/t/utils.t
+Test-Harness-3.22/t/yamlish-output.t
+Test-Harness-3.22/t/yamlish-writer.t
+Test-Harness-3.22/t/yamlish.t
+Test-Harness-3.22/xt/author/pod-coverage.t
+Test-Harness-3.22/xt/author/pod.t
+Test-Harness-3.22/xt/author/stdin.t
+Test-Harness-3.22/xt/perls/harness_perl.t
+Test-Harness-3.22/xt/perls/sample-tests/perl_version
 bin/prove
 bin/runtests
 examples/README
@@ -76,7 +311,6 @@ lib/TAP/Parser/SourceHandler/File.pm
 lib/TAP/Parser/SourceHandler/Handle.pm
 lib/TAP/Parser/SourceHandler/Perl.pm
 lib/TAP/Parser/SourceHandler/RawTAP.pm
-lib/TAP/Parser/SourceHandler/pgTAP.pm
 lib/TAP/Parser/Utils.pm
 lib/TAP/Parser/YAML.pm
 lib/TAP/Parser/YAMLish/Reader.pm
@@ -205,7 +439,6 @@ t/lib/MyPerlSource.pm
 t/lib/MyPerlSourceHandler.pm
 t/lib/MyResult.pm
 t/lib/MyResultFactory.pm
-t/lib/MyShebangger.pm
 t/lib/MySource.pm
 t/lib/MySourceHandler.pm
 t/lib/NOP.pm
@@ -218,6 +451,7 @@ t/lib/Test/More.pm
 t/lib/Test/Simple.pm
 t/lib/if.pm
 t/multiplexer.t
+t/nested.t
 t/nofork-mux.t
 t/nofork.t
 t/object.t
@@ -234,6 +468,7 @@ t/proveenv.t
 t/proverc.t
 t/proverc/emptyexec
 t/proverun.t
+t/proveversion.t
 t/regression.t
 t/results.t
 t/sample-tests/bailout
@@ -270,6 +505,7 @@ t/sample-tests/shbang_misparse
 t/sample-tests/simple
 t/sample-tests/simple_fail
 t/sample-tests/simple_yaml
+t/sample-tests/simple_yaml_missing_version13
 t/sample-tests/skip
 t/sample-tests/skip_nomsg
 t/sample-tests/skipall
@@ -290,6 +526,7 @@ t/sample-tests/version_late
 t/sample-tests/version_old
 t/sample-tests/vms_nit
 t/sample-tests/with_comments
+t/sample-tests/yaml_late_plan
 t/sample-tests/zero_valid
 t/scheduler.t
 t/source.t
@@ -308,6 +545,7 @@ t/source_tests/source.pl
 t/source_tests/source.sh
 t/source_tests/source.t
 t/source_tests/source.tap
+t/source_tests/source_args.sh
 t/source_tests/varsource
 t/spool.t
 t/state.t
index 8264171..7c2d5e6 100644 (file)
@@ -44,6 +44,7 @@ Boolean options:
  -p,  --parse           Show full list of TAP parse errors, if any.
       --directives      Only show results with TODO or SKIP directives.
       --timer           Print elapsed time after each test.
+      --trap            Trap Ctrl-C and print summary on interrupt.
       --normalize       Normalize TAP output in verbose output
  -T                     Enable tainting checks.
  -t                     Enable tainting warnings.
@@ -152,6 +153,11 @@ that appears on STDERR looks like a test result the test harness will
 get confused. Use this option only if you understand the consequences
 and can live with the risk.
 
+=head2 C<--trap>
+
+The C<--trap> option will attempt to trap SIGINT (Ctrl-C) during a test
+run and display the test summary even if the run is interrupted
+
 =head2 C<--state>
 
 You can ask C<prove> to remember the state of previous test runs and
@@ -296,10 +302,13 @@ If you want to provide config to the source you can use:
   prove --source MyCustom \
         --source Perl --perl-option 'foo=bar baz' --perl-option avg=0.278 \
         --source File --file-option extensions=.txt --file-option extensions=.tmp t
+        --source pgTAP --pgtap-option pset=format=html --pgtap-option pset=border=2
 
 Each C<--$source-option> option must specify a key/value pair separated by an
 C<=>. If an option can take multiple values, just specify it multiple times,
-as with the C<extensions=> examples above.
+as with the C<extensions=> examples above. If the option should be a hash
+reference, specify the value as a second pair separated by a C<=>, as in the
+C<pset=> examples above (escape C<=> with a backslash).
 
 All C<--sources> are combined into a hash, and passed to L<TAP::Harness/new>'s
 C<sources> parameter.
index ca1dbda..156b05d 100644 (file)
@@ -17,11 +17,11 @@ App::Prove - Implements the C<prove> command.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
@@ -58,8 +58,8 @@ BEGIN {
       formatter harness includes modules plugins jobs lib merge parse quiet
       really_quiet recurse backwards shuffle taint_fail taint_warn timer
       verbose warnings_fail warnings_warn show_help show_man show_version
-      state_class test_args state dry extension ignore_exit rules state_manager
-      normalize sources
+      state_class test_args state dry extensions ignore_exit rules state_manager
+      normalize sources tapversion trap
     );
     __PACKAGE__->mk_methods(@ATTR);
 }
@@ -203,46 +203,48 @@ sub process_args {
 
         # Don't add coderefs to GetOptions
         GetOptions(
-            'v|verbose'   => \$self->{verbose},
-            'f|failures'  => \$self->{failures},
-            'o|comments'  => \$self->{comments},
-            'l|lib'       => \$self->{lib},
-            'b|blib'      => \$self->{blib},
-            's|shuffle'   => \$self->{shuffle},
-            'color!'      => \$self->{color},
-            'colour!'     => \$self->{color},
-            'count!'      => \$self->{show_count},
-            'c'           => \$self->{color},
-            'D|dry'       => \$self->{dry},
-            'ext=s'       => \$self->{extension},
-            'harness=s'   => \$self->{harness},
-            'ignore-exit' => \$self->{ignore_exit},
-            'source=s@'   => $self->{sources},
-            'formatter=s' => \$self->{formatter},
-            'r|recurse'   => \$self->{recurse},
-            'reverse'     => \$self->{backwards},
-            'p|parse'     => \$self->{parse},
-            'q|quiet'     => \$self->{quiet},
-            'Q|QUIET'     => \$self->{really_quiet},
-            'e|exec=s'    => \$self->{exec},
-            'm|merge'     => \$self->{merge},
-            'I=s@'        => $self->{includes},
-            'M=s@'        => $self->{modules},
-            'P=s@'        => $self->{plugins},
-            'state=s@'    => $self->{state},
-            'directives'  => \$self->{directives},
-            'h|help|?'    => \$self->{show_help},
-            'H|man'       => \$self->{show_man},
-            'V|version'   => \$self->{show_version},
-            'a|archive=s' => \$self->{archive},
-            'j|jobs=i'    => \$self->{jobs},
-            'timer'       => \$self->{timer},
-            'T'           => \$self->{taint_fail},
-            't'           => \$self->{taint_warn},
-            'W'           => \$self->{warnings_fail},
-            'w'           => \$self->{warnings_warn},
-            'normalize'   => \$self->{normalize},
-            'rules=s@'    => $self->{rules},
+            'v|verbose'    => \$self->{verbose},
+            'f|failures'   => \$self->{failures},
+            'o|comments'   => \$self->{comments},
+            'l|lib'        => \$self->{lib},
+            'b|blib'       => \$self->{blib},
+            's|shuffle'    => \$self->{shuffle},
+            'color!'       => \$self->{color},
+            'colour!'      => \$self->{color},
+            'count!'       => \$self->{show_count},
+            'c'            => \$self->{color},
+            'D|dry'        => \$self->{dry},
+            'ext=s@'       => \$self->{extensions},
+            'harness=s'    => \$self->{harness},
+            'ignore-exit'  => \$self->{ignore_exit},
+            'source=s@'    => $self->{sources},
+            'formatter=s'  => \$self->{formatter},
+            'r|recurse'    => \$self->{recurse},
+            'reverse'      => \$self->{backwards},
+            'p|parse'      => \$self->{parse},
+            'q|quiet'      => \$self->{quiet},
+            'Q|QUIET'      => \$self->{really_quiet},
+            'e|exec=s'     => \$self->{exec},
+            'm|merge'      => \$self->{merge},
+            'I=s@'         => $self->{includes},
+            'M=s@'         => $self->{modules},
+            'P=s@'         => $self->{plugins},
+            'state=s@'     => $self->{state},
+            'directives'   => \$self->{directives},
+            'h|help|?'     => \$self->{show_help},
+            'H|man'        => \$self->{show_man},
+            'V|version'    => \$self->{show_version},
+            'a|archive=s'  => \$self->{archive},
+            'j|jobs=i'     => \$self->{jobs},
+            'timer'        => \$self->{timer},
+            'T'            => \$self->{taint_fail},
+            't'            => \$self->{taint_warn},
+            'W'            => \$self->{warnings_fail},
+            'w'            => \$self->{warnings_warn},
+            'normalize'    => \$self->{normalize},
+            'rules=s@'     => $self->{rules},
+            'tapversion=s' => \$self->{tapversion},
+            'trap'         => \$self->{trap},
         ) or croak('Unable to continue');
 
         # Stash the remainder of argv for later
@@ -286,6 +288,8 @@ sub _get_args {
 
     my %args;
 
+    $args{trap} = 1 if $self->trap;
+
     if ( defined $self->color ? $self->color : $self->_color_default ) {
         $args{color} = 1;
     }
@@ -357,6 +361,8 @@ sub _get_args {
     $args{exec} = [ split( /\s+/, $self->exec ) ]
       if ( defined( $self->exec ) );
 
+    $args{version} = $self->tapversion if defined( $self->tapversion );
+
     if ( defined( my $test_args = $self->test_args ) ) {
         $args{test_args} = $test_args;
     }
@@ -428,14 +434,24 @@ sub _parse_source {
     my %config;
     Getopt::Long::GetOptions(
         "$opt_name-option=s%" => sub {
-            my ( undef, $k, $v ) = @_;
-            if ( exists $config{$k} ) {
-                $config{$k} = [ $config{$k} ]
-                  unless ref $config{$k} eq 'ARRAY';
-                push @{ $config{$k} } => $v;
-            }
-            else {
-                $config{$k} = $v;
+            my ( $name, $k, $v ) = @_;
+            if ($v =~ /(?<!\\)=/) {
+                # It's a hash option.
+                croak "Option $name must be consistently used as a hash"
+                    if exists $config{$k} && ref $config{$k} ne 'HASH';
+                $config{$k} ||= {};
+                my ($hk, $hv) = split /(?<!\\)=/, $v, 2;
+                $config{$k}{$hk} = $hv;
+            } else {
+                $v =~ s/\\=/=/g;
+                if ( exists $config{$k} ) {
+                    $config{$k} = [ $config{$k} ]
+                        unless ref $config{$k} eq 'ARRAY';
+                    push @{ $config{$k} } => $v;
+                }
+                else {
+                    $config{$k} = $v;
+                }
             }
         }
     );
@@ -493,8 +509,8 @@ sub _get_tests {
     my $self = shift;
 
     my $state = $self->state_manager;
-    my $ext   = $self->extension;
-    $state->extension($ext) if defined $ext;
+    my $ext   = $self->extensions;
+    $state->extensions($ext) if defined $ext;
     if ( defined( my $state_switch = $self->state ) ) {
         $state->apply_switch(@$state_switch);
     }
@@ -656,7 +672,7 @@ calling C<run>.
 
 =item C<exec>
 
-=item C<extension>
+=item C<extensions>
 
 =item C<failures>
 
@@ -718,6 +734,10 @@ calling C<run>.
 
 =item C<warnings_warn>
 
+=item C<tapversion>
+
+=item C<trap>
+
 =back
 
 =head1 PLUGINS
index a1e821c..740c26a 100644 (file)
@@ -26,11 +26,11 @@ App::Prove::State - State storage for the C<prove> command.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
@@ -59,9 +59,9 @@ Accepts a hashref with the following key/value pairs:
 
 The filename of the data store holding the data that App::Prove::State reads.
 
-=item * C<extension> (optional)
+=item * C<extensions> (optional)
 
-The test name extension.  Defaults to C<.t>.
+The test name extensions.  Defaults to C<.t>.
 
 =item * C<result_class> (optional)
 
@@ -77,12 +77,11 @@ sub new {
     my %args = %{ shift || {} };
 
     my $self = bless {
-        select    => [],
-        seq       => 1,
-        store     => delete $args{store},
-        extension => ( delete $args{extension} || '.t' ),
-        result_class =>
-          ( delete $args{result_class} || 'App::Prove::State::Result' ),
+        select       => [],
+        seq          => 1,
+        store        => delete $args{store},
+        extensions   => ( delete $args{extensions} || ['.t'] ),
+        result_class => ( delete $args{result_class} || 'App::Prove::State::Result' ),
     }, $class;
 
     $self->{_} = $self->result_class->new(
@@ -105,17 +104,17 @@ identical interface.
 
 =cut
 
-=head2 C<extension>
+=head2 C<extensions>
 
-Get or set the extension files must have in order to be considered
-tests. Defaults to '.t'.
+Get or set the list of extensions that files must have in order to be
+considered tests. Defaults to ['.t'].
 
 =cut
 
-sub extension {
+sub extensions {
     my $self = shift;
-    $self->{extension} = shift if @_;
-    return $self->{extension};
+    $self->{extensions} = shift if @_;
+    return $self->{extensions};
 }
 
 =head2 C<results>
@@ -356,7 +355,7 @@ sub _get_raw_tests {
 
     # Do globbing on Win32.
     @argv = map { glob "$_" } @argv if NEED_GLOB;
-    my $extension = $self->{extension};
+    my $extensions = $self->{extensions};
 
     for my $arg (@argv) {
         if ( '-' eq $arg ) {
@@ -368,23 +367,25 @@ sub _get_raw_tests {
         push @tests,
             sort -d $arg
           ? $recurse
-              ? $self->_expand_dir_recursive( $arg, $extension )
-              : glob( File::Spec->catfile( $arg, "*$extension" ) )
+              ? $self->_expand_dir_recursive( $arg, $extensions )
+              : map { glob( File::Spec->catfile( $arg, "*$_" ) ) } @{$extensions}
           : $arg;
     }
     return @tests;
 }
 
 sub _expand_dir_recursive {
-    my ( $self, $dir, $extension ) = @_;
+    my ( $self, $dir, $extensions ) = @_;
 
     my @tests;
+    my $ext_string = join( '|', map { quotemeta } @{$extensions} );
+
     find(
         {   follow      => 1,      #21938
             follow_skip => 2,
             wanted      => sub {
-                -f 
-                  && /\Q$extension\E$/
+                -f
+                  && /(?:$ext_string)$/
                   && push @tests => $File::Find::name;
               }
         },
index 9d6cbd3..5ec497e 100644 (file)
@@ -14,11 +14,11 @@ App::Prove::State::Result - Individual test suite results.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 993699c..9fbb06c 100644 (file)
@@ -10,11 +10,11 @@ App::Prove::State::Result::Test - Individual test results.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 8285240..7ffd099 100644 (file)
@@ -14,11 +14,11 @@ and L<TAP::Harness>
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 use constant GOT_TIME_HIRES => do {
     eval 'use Time::HiRes qw(time);';
index 2ff384e..9d998b0 100644 (file)
@@ -47,11 +47,11 @@ TAP::Formatter::Base - Base class for harness output delegates
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
@@ -257,13 +257,15 @@ sub _output_success {
 
   $harness->summary( $aggregate );
 
-C<summary> prints the summary report after all tests are run.  The argument is
-an aggregate.
+C<summary> prints the summary report after all tests are run. The first
+argument is an aggregate to summarise. An optional second argument may
+be set to a true value to indicate that the summary is being output as a
+result of an interrupted test run.
 
 =cut
 
 sub summary {
-    my ( $self, $aggregate ) = @_;
+    my ( $self, $aggregate, $interrupted ) = @_;
 
     return if $self->silent;
 
@@ -279,6 +281,9 @@ sub summary {
         $self->_output( $self->_format_now(), "\n" );
     }
 
+    $self->_failure_output("Test run interrupted!\n")
+      if $interrupted;
+
     # TODO: Check this condition still works when all subtests pass but
     # the exit status is nonzero
 
index ea2eebe..4049f62 100644 (file)
@@ -71,11 +71,11 @@ TAP::Formatter::Color - Run Perl test scripts with color
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 8463a39..30bf85b 100644 (file)
@@ -14,11 +14,11 @@ TAP::Formatter::Console - Harness output delegate for default console output
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 47c4aca..46b2f1d 100644 (file)
@@ -42,11 +42,11 @@ TAP::Formatter::Console::ParallelSession - Harness output delegate for parallel
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index e24cb6c..adea552 100644 (file)
@@ -28,11 +28,11 @@ TAP::Formatter::Console::Session - Harness output delegate for default console o
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 38c8b49..31c413b 100644 (file)
@@ -15,11 +15,11 @@ TAP::Formatter::File - Harness output delegate for file output
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index a974224..8607c38 100644 (file)
@@ -13,11 +13,11 @@ TAP::Formatter::File::Session - Harness output delegate for file output
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 250b6f9..998696d 100644 (file)
@@ -25,11 +25,11 @@ TAP::Formatter::Session - Abstract base class for harness output delegate
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 METHODS
 
index 4774c00..4c6fe82 100644 (file)
@@ -19,11 +19,11 @@ TAP::Harness - Run test scripts with statistics
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 $ENV{HARNESS_ACTIVE}  = 1;
 $ENV{HARNESS_VERSION} = $VERSION;
@@ -85,6 +85,8 @@ BEGIN {
         ignore_exit       => sub { shift; shift },
         rules             => sub { shift; shift },
         sources           => sub { shift; shift },
+        version           => sub { shift; shift },
+        trap              => sub { shift; shift },
     );
 
     for my $method ( sort keys %VALIDATION_FOR ) {
@@ -268,6 +270,13 @@ L<TAP::Parser::Source>, and L<TAP::Parser::IteratorFactory>.
 The name of the class to use to aggregate test results. The default is
 L<TAP::Parser::Aggregator>.
 
+=item * C<version>
+
+I<NEW to 3.22>.
+
+Assume this TAP version for L<TAP::Parser> instead of default TAP
+version 12.
+
 =item * C<formatter_class>
 
 The name of the class to use to format output. The default is
@@ -340,6 +349,11 @@ interface may change.
 
 A filehandle for catching standard output.
 
+=item * C<trap>
+
+Attempt to print summary information if run is interrupted by
+SIGINT (Ctrl-C).
+
 =back
 
 Any keys for which the value is C<undef> will be ignored.
@@ -461,10 +475,28 @@ sub runtests {
 
     $self->_make_callback( 'before_runtests', $aggregate );
     $aggregate->start;
-    $self->aggregate_tests( $aggregate, @tests );
-    $aggregate->stop;
-    $self->summary($aggregate);
-    $self->_make_callback( 'after_runtests', $aggregate );
+    my $finish = sub {
+        my $interrupted = shift;
+        $aggregate->stop;
+        $self->summary( $aggregate, $interrupted );
+        $self->_make_callback( 'after_runtests', $aggregate );
+    };
+    my $run = sub {
+        $self->aggregate_tests( $aggregate, @tests );
+        $finish->();
+    };
+
+    if ( $self->trap ) {
+        local $SIG{INT} = sub {
+            print "\n";
+            $finish->(1);
+            exit;
+        };
+        $run->();
+    }
+    else {
+        $run->();
+    }
 
     return $aggregate;
 }
@@ -478,8 +510,8 @@ Output the summary for a L<TAP::Parser::Aggregator>.
 =cut
 
 sub summary {
-    my ( $self, $aggregate ) = @_;
-    $self->formatter->summary($aggregate);
+    my ( $self, @args ) = @_;
+    $self->formatter->summary(@args);
 }
 
 sub _after_test {
@@ -692,6 +724,7 @@ sub _get_parser_args {
     $args{spool}       = $self->_open_spool($test_prog);
     $args{merge}       = $self->merge;
     $args{ignore_exit} = $self->ignore_exit;
+    $args{version}     = $self->version if $self->version;
 
     if ( my $exec = $self->exec ) {
         $args{exec}
index 8704f52..ed77e13 100644 (file)
@@ -226,7 +226,8 @@ document:
   use base qw( TAP::Harness ); use YAML;
 
   sub summary {
-    my ( $self, $aggregate ) = @_; print Dump( $aggregate );
+    my ( $self, $aggregate ) = @_; 
+    print Dump( $aggregate );
     $self->SUPER::summary( $aggregate );
   }
 
@@ -261,8 +262,8 @@ myprove:
 
   my $app = App::Prove->new;
 
-  # Use custom TAP::Harness subclass $app->harness( 'My::TAP::Harness'
-  );
+  # Use custom TAP::Harness subclass
+  $app->harness( 'My::TAP::Harness' );
 
   $app->process_args( @ARGV ); exit( $app->run ? 0 : 1 );
 
index 591e435..08e0467 100644 (file)
@@ -9,11 +9,11 @@ TAP::Object - Base class that provides common functionality to all C<TAP::*> mod
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 92cefb7..773a30d 100644 (file)
@@ -24,11 +24,11 @@ TAP::Parser - Parse L<TAP|Test::Harness::TAP> output
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 my $DEFAULT_TAP_VERSION = 12;
 my $MAX_TAP_VERSION     = 13;
@@ -370,9 +370,7 @@ sub make_result           { shift->result_factory_class->make_result(@_); }
     my %initialize = (
         version       => $DEFAULT_TAP_VERSION,
         plan          => '',                    # the test plan (e.g., 1..3)
-        tap           => '',                    # the TAP
         tests_run     => 0,                     # actual current test numbers
-        results       => [],                    # TAP parser results
         skipped       => [],                    #
         todo          => [],                    #
         passed        => [],                    #
@@ -425,6 +423,7 @@ sub make_result           { shift->result_factory_class->make_result(@_); }
         my $iterator = delete $args{iterator};
         $iterator ||= delete $args{stream};    # deprecated
         my $tap         = delete $args{tap};
+        my $version     = delete $args{version};
         my $raw_source  = delete $args{source};
         my $sources     = delete $args{sources};
         my $exec        = delete $args{exec};
@@ -453,7 +452,7 @@ sub make_result           { shift->result_factory_class->make_result(@_); }
         }
         elsif ($exec) {
             $type = 'exec ' . $exec->[0];
-            $source->raw( { exec => [ @$exec, @$test_args ] } );
+            $source->raw( { exec => $exec } );
         }
         elsif ($raw_source) {
             $type = 'source ' . ref($raw_source) || $raw_source;
@@ -479,6 +478,7 @@ sub make_result           { shift->result_factory_class->make_result(@_); }
             $self->{$k} = 'ARRAY' eq ref $v ? [] : $v;
         }
 
+        $self->version($version) if $version;
         $self->_iterator($iterator);
         $self->_spool($spool);
         $self->ignore_exit($ignore_exit);
@@ -639,7 +639,7 @@ C<$result> object.
 Returns a list of pragmas each of which is a + or - followed by the
 pragma name.
  
-=head2 C<commment> methods
+=head2 C<comment> methods
 
  if ( $result->is_comment ) { ... }
 
@@ -716,7 +716,7 @@ line.
   my $explanation = $result->explanation;
 
 If a test had either a C<TODO> or C<SKIP> directive, this method will return
-the accompanying explantion, if present.
+the accompanying explanation, if present.
 
   not ok 17 - 'Pigs can fly' # TODO not enough acid
 
@@ -1044,7 +1044,7 @@ an executable, it returns the exit status of the executable.
 
 Once the parser is done, this will return the wait status.  If the parser ran
 an executable, it returns the wait status of the executable.  Otherwise, this
-mererely returns the C<exit> status.
+merely returns the C<exit> status.
 
 =head2 C<ignore_exit>
 
@@ -1309,7 +1309,7 @@ sub _make_state_table {
         UNPLANNED_AFTER_TEST => {
             test => { act  => sub { }, continue => 'UNPLANNED' },
             plan => { act  => sub { }, continue => 'UNPLANNED' },
-            yaml => { goto => 'PLANNED' },
+            yaml => { goto => 'UNPLANNED' },
         },
     );
 
@@ -1636,9 +1636,9 @@ passed instead.
 
 If you're looking for an EBNF grammar, see L<TAP::Parser::Grammar>.
 
-=head1 BACKWARDS COMPATABILITY
+=head1 BACKWARDS COMPATIBILITY
 
-The Perl-QA list attempted to ensure backwards compatability with
+The Perl-QA list attempted to ensure backwards compatibility with
 L<Test::Harness>.  However, there are some minor differences.
 
 =head2 Differences
@@ -1702,22 +1702,22 @@ Many C<TAP::*> classes have a I<SUBCLASSING> section to guide you.
 
 =item 3
 
-Note that C<TAP::Parser> is designed to be the central 'maker' - ie: it is
+Note that C<TAP::Parser> is designed to be the central "maker" - ie: it is
 responsible for creating most new objects in the C<TAP::Parser::*> namespace.
 
 This makes it possible for you to have a single point of configuring what
-subclasses should be used, which in turn means that in many cases you'll find
+subclasses should be used, which means that in many cases you'll find
 you only need to sub-class one of the parser's components.
 
 The exception to this rule are I<SourceHandlers> & I<Iterators>, but those are
-both created with customizeable I<IteratorFactory>.
+both created with customizable I<IteratorFactory>.
 
 =item 4
 
 By subclassing, you may end up overriding undocumented methods.  That's not
 a bad thing per se, but be forewarned that undocumented methods may change
 without warning from one release to the next - we cannot guarantee backwards
-compatability.  If any I<documented> method needs changing, it will be
+compatibility.  If any I<documented> method needs changing, it will be
 deprecated first, and changed in a later release.
 
 =back
@@ -1727,7 +1727,7 @@ deprecated first, and changed in a later release.
 =head3 Sources
 
 A TAP parser consumes input from a single I<raw source> of TAP, which could come
-from anywhere (a file, an executable, a database, an io handle, a uri, etc..).
+from anywhere (a file, an executable, a database, an IO handle, a URI, etc..).
 The source gets bundled up in a L<TAP::Parser::Source> object which gathers some
 meta data about it.  The parser then uses a L<TAP::Parser::IteratorFactory> to
 determine which L<TAP::Parser::SourceHandler> to use to turn the raw source
@@ -1753,7 +1753,7 @@ are now removed.
 A TAP parser uses I<iterators> to loop through the I<stream> of TAP read in
 from the I<source> it was given.  There are a few types of Iterators available
 by default, all sub-classes of L<TAP::Parser::Iterator>.  Choosing which
-iterator to use is the responsibility of the I<siterator factory>, though it
+iterator to use is the responsibility of the I<iterator factory>, though it
 simply delegates to the I<Source Handler> it uses.
 
 If you're writing your own L<TAP::Parser::SourceHandler>, you may need to
@@ -1791,7 +1791,7 @@ override L</make_result>.
 
 =head3 Grammar
 
-L<TAP::Parser::Grammar> is the heart of the parser - it tokenizes the TAP
+L<TAP::Parser::Grammar> is the heart of the parser.  It tokenizes the TAP
 input I<stream> and produces results.  If you need to customize its behaviour
 you should probably familiarize yourself with the source first.  Enough
 lecturing.
@@ -1802,7 +1802,7 @@ C<grammar_class> parameter.  See L</new> for more details.
 If you need to customize the objects on creation, subclass L<TAP::Parser> and
 override L</make_grammar>
 
-=head1 ACKNOWLEDGEMENTS
+=head1 ACKNOWLEDGMENTS
 
 All of the following have helped. Bug reports, patches, (im)moral
 support, or just words of encouragement have all been forthcoming.
@@ -1849,6 +1849,8 @@ support, or just words of encouragement have all been forthcoming.
 
 =item * Cosimo Streppone
 
+=item * Ville Skyttä
+
 =back
 
 =head1 AUTHORS
@@ -1869,6 +1871,8 @@ Nicholas Clark <nick@ccl4.org>
 
 Lee Johnson <notfadeaway at btinternet dot com>
 
+Philippe Bruhat <book@cpan.org>
+
 =head1 BUGS
 
 Please report any bugs or feature requests to
index 931656f..bae0e29 100644 (file)
@@ -14,11 +14,11 @@ TAP::Parser::Aggregator - Aggregate TAP::Parser results
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 7847098..05c1a5c 100644 (file)
@@ -15,11 +15,11 @@ TAP::Parser::Grammar - A grammar for the Test Anything Protocol.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
@@ -164,7 +164,7 @@ my %language_for;
             },
         },
         bailout => {
-            syntax  => qr/^Bail out!\s*(.*)/,
+            syntax  => qr/^\s*Bail out!\s*(.*)/,
             handler => sub {
                 my ( $self, $line ) = @_;
                 my $explanation = $1;
@@ -504,7 +504,7 @@ stream-based protocol.  In fact, it's quite legal to have an infinite stream.
 For the same reason that we don't apply regexes to streams, we're not using a
 formal grammar here.  Instead, we parse the TAP in lines.
 
-For purposes for forward compatability, any result which does not match the
+For purposes for forward compatibility, any result which does not match the
 following grammar is currently referred to as
 L<TAP::Parser::Result::Unknown>.  It is I<not> a parse error.
 
index a6d8916..02ce35f 100644 (file)
@@ -13,11 +13,11 @@ TAP::Parser::Iterator - Base class for TAP source iterators
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 99d98ca..484252f 100644 (file)
@@ -13,11 +13,11 @@ TAP::Parser::Iterator::Array - Iterator for array-based TAP sources
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 2621e75..f0032e6 100644 (file)
@@ -13,15 +13,15 @@ my $IS_WIN32 = ( $^O =~ /^(MS)?Win32$/ );
 
 =head1 NAME
 
-TAP::Parser::Iterator::Process - Iterator for proccess-based TAP sources
+TAP::Parser::Iterator::Process - Iterator for process-based TAP sources
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index d905695..183a3ac 100644 (file)
@@ -13,11 +13,11 @@ TAP::Parser::Iterator::Stream - Iterator for filehandle-based TAP sources
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index b269d00..30296d0 100644 (file)
@@ -18,11 +18,11 @@ TAP::Parser::IteratorFactory - Figures out which SourceHandler objects to use fo
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 9d33619..8c6b54a 100644 (file)
@@ -18,11 +18,11 @@ TAP::Parser::Multiplexer - Multiplex multiple TAP::Parsers
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 44287e8..bfbcc5c 100644 (file)
@@ -26,15 +26,15 @@ TAP::Parser::Result - Base class for TAP::Parser output objects
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
-  # abstract class - not meany to be used directly
+  # abstract class - not meant to be used directly
   # see TAP::Parser::ResultFactory for preferred usage
 
   # directly:
index 8aeecfa..617df42 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Result::Bailout - Bailout result token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index b5498ab..2fc0b30 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Result::Comment - Comment result token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 78b77c3..a617f0e 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Result::Plan - Plan result token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index bef77fd..7e12dde 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Result::Pragma - TAP pragma token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index fcae343..49f8af9 100644 (file)
@@ -14,11 +14,11 @@ TAP::Parser::Result::Test - Test result token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
@@ -101,7 +101,7 @@ sub directive { shift->{directive} }
   my $explanation = $result->explanation;
 
 If a test had either a C<TODO> or C<SKIP> directive, this method will return
-the accompanying explantion, if present.
+the accompanying explanation, if present.
 
   not ok 17 - 'Pigs can fly' # TODO not enough acid
 
index b08536e..bf41264 100644 (file)
@@ -14,11 +14,11 @@ TAP::Parser::Result::Unknown - Unknown result token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 06d63bf..b1dce7e 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Result::Version - TAP syntax version token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index aa7bc4c..18d72f8 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Result::YAML - YAML result token.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 DESCRIPTION
 
index 66ee9fb..29138bf 100644 (file)
@@ -30,11 +30,11 @@ TAP::Parser::ResultFactory - Factory for creating TAP::Parser output objects
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head2 DESCRIPTION
 
index c23f1ea..27711d0 100644 (file)
@@ -12,11 +12,11 @@ TAP::Parser::Scheduler - Schedule tests during parallel testing
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index f3a377c..c101f24 100644 (file)
@@ -10,11 +10,11 @@ TAP::Parser::Scheduler::Job - A single testing job.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 0d43716..cfea786 100644 (file)
@@ -10,11 +10,11 @@ TAP::Parser::Scheduler::Spinner - A no-op job.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 62d3795..ddcc9d7 100644 (file)
@@ -14,11 +14,11 @@ TAP::Parser::Source - a TAP source & meta data about it
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 51cff6f..407b770 100644 (file)
@@ -14,11 +14,11 @@ TAP::Parser::SourceHandler - Base class for different TAP source handlers
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
@@ -110,7 +110,7 @@ the easiest sub-class to use an an example.
 It's important to point out that if you want your subclass to be automatically
 used by L<TAP::Parser> you'll have to and make sure it gets loaded somehow.
 If you're using L<prove> you can write an L<App::Prove> plugin.  If you're
-using L<TAP::Parser> or L<TAP::Harness> directly (eg. through a custom script,
+using L<TAP::Parser> or L<TAP::Harness> directly (e.g. through a custom script,
 L<ExtUtils::MakeMaker>, or L<Module::Build>) you can use the C<config> option
 which will cause L<TAP::Parser::IteratorFactory/load_sources> to load your
 subclass).
index abfd5c5..494f6d2 100644 (file)
@@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::Executable - Stream output from an executable TAP so
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
@@ -39,13 +39,13 @@ $VERSION = '3.21';
 
 This is an I<executable> L<TAP::Parser::SourceHandler> - it has 2 jobs:
 
-1. Figure out if the L<TAP::Parser::Source> it's given is an executable command
-(L</can_handle>).
+1. Figure out if the L<TAP::Parser::Source> it's given is an executable
+   command (L</can_handle>).
 
 2. Creates an iterator for executable commands (L</make_iterator>).
 
-Unless you're writing a plugin or subclassing L<TAP::Parser>, you probably
-won't need to use this module directly.
+Unless you're writing a plugin or subclassing L<TAP::Parser>, you
+probably won't need to use this module directly.
 
 =head1 METHODS
 
@@ -55,10 +55,10 @@ won't need to use this module directly.
 
   my $vote = $class->can_handle( $source );
 
-Only votes if $source looks like an executable file.  Casts the following votes:
+Only votes if $source looks like an executable file. Casts the
+following votes:
 
   0.9  if it's a hash with an 'exec' key
-  0.8  if it's a .sh file
   0.8  if it's a .bat file
   0.75 if it's got an execute bit set
 
@@ -72,9 +72,8 @@ sub can_handle {
         my $file = $meta->{file};
 
         # Note: we go in low so we can be out-voted
-        return 0.8 if $file->{lc_ext} eq '.sh';
         return 0.8 if $file->{lc_ext} eq '.bat';
-        return 0.7 if $file->{execute};
+        return 0.25 if $file->{execute};
     }
     elsif ( $meta->{is_hash} ) {
         return 0.9 if $src->raw->{exec};
@@ -120,6 +119,8 @@ sub make_iterator {
     $class->_autoflush( \*STDOUT );
     $class->_autoflush( \*STDERR );
 
+    push @command, @{ $source->test_args || [] };
+
     return $class->iterator_class->new(
         {   command => \@command,
             merge   => $source->merge
index 4e41163..174df32 100644 (file)
@@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::File - Stream TAP from a text file.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 6a71eef..2a757f2 100644 (file)
@@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::Handle - Stream TAP from an IO::Handle or a GLOB.
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index 7ad427e..cdb951b 100644 (file)
@@ -22,11 +22,11 @@ TAP::Parser::SourceHandler::Perl - Stream TAP from a Perl executable
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
@@ -63,6 +63,7 @@ won't need to use this module directly.
 Only votes if $source looks like a file.  Casts the following votes:
 
   0.9  if it has a shebang ala "#!...perl"
+  0.75 if it has any shebang
   0.8  if it's a .t file
   0.9  if it's a .pl file
   0.75 if it's in a 't' directory
@@ -79,6 +80,11 @@ sub can_handle {
 
     if ( my $shebang = $file->{shebang} ) {
         return 0.9 if $shebang =~ /^#!.*\bperl/;
+        # We favour Perl as the interpreter for any shebang to preserve
+        # previous semantics: we used to execute everything via Perl and
+        # relied on it to pass the shebang off to the appropriate
+        # interpreter.
+        return 0.3;
     }
 
     return 0.8 if $file->{lc_ext} eq '.t';    # vote higher than Executable
@@ -121,6 +127,13 @@ Currently you need to write a plugin to get around this.
 
 =cut
 
+sub _autoflush_stdhandles {
+    my ($class) = @_;
+
+    $class->_autoflush( \*STDOUT );
+    $class->_autoflush( \*STDERR );
+}
+
 sub make_iterator {
     my ( $class, $source ) = @_;
     my $meta        = $source->meta;
@@ -129,10 +142,37 @@ sub make_iterator {
     $class->_croak("Cannot find ($perl_script)") unless $meta->{is_file};
 
     # TODO: does this really need to be done here?
-    $class->_autoflush( \*STDOUT );
-    $class->_autoflush( \*STDERR );
+    $class->_autoflush_stdhandles;
+
+    my ( $libs, $switches )
+      = $class->_mangle_switches(
+        $class->_filter_libs( $class->_switches($source) ) );
+
+    $class->_run( $source, $libs, $switches );
+}
+
+sub _mangle_switches {
+    my ( $class, $libs, $switches ) = @_;
+
+    # Taint mode ignores environment variables so we must retranslate
+    # PERL5LIB as -I switches and place PERL5OPT on the command line
+    # in order that it be seen.
+    if ( grep { $_ eq "-T" || $_ eq "-t" } @{$switches} ) {
+        return (
+            $libs,
+            [   @{$switches},
+                $class->_libs2switches($libs),
+                split_shell( $ENV{PERL5OPT} )
+            ],
+        );
+    }
+
+    return ( $libs, $switches );
+}
+
+sub _filter_libs {
+    my ( $class, @switches ) = @_;
 
-    my @switches = $class->_switches($source);
     my $path_sep = $Config{path_sep};
     my $path_re  = qr{$path_sep};
 
@@ -147,19 +187,26 @@ sub make_iterator {
     my @libs;
     my @filtered_switches;
     for (@switches) {
-        if ( !/$path_re/ && / ^ ['"]? -I ['"]? (.*?) ['"]? $ /x ) {
+        if ( !/$path_re/ && m/ ^ ['"]? -I ['"]? (.*?) ['"]? $ /x ) {
             push @libs, $1;
         }
         else {
             push @filtered_switches, $_;
         }
     }
-    @switches = @filtered_switches;
+
+    return \@libs, \@filtered_switches;
+}
+
+sub _iterator_hooks {
+    my ( $class, $source, $libs ) = @_;
 
     my $setup = sub {
-        if (@libs) {
-            $ENV{PERL5LIB}
-              = join( $path_sep, grep {defined} @libs, $ENV{PERL5LIB} );
+        if ( @{$libs} ) {
+            $ENV{PERL5LIB} = join(
+                $Config{path_sep}, grep {defined} @{$libs},
+                $ENV{PERL5LIB}
+            );
         }
     };
 
@@ -175,19 +222,25 @@ sub make_iterator {
         }
     };
 
-    # Taint mode ignores environment variables so we must retranslate
-    # PERL5LIB as -I switches and place PERL5OPT on the command line
-    # in order that it be seen.
-    if ( grep { $_ eq "-T" || $_ eq "-t" } @switches ) {
-        push @switches, $class->_libs2switches(@libs);
-        push @switches, split_shell( $ENV{PERL5OPT} );
-    }
+    return ( $setup, $teardown );
+}
+
+sub _run {
+    my ( $class, $source, $libs, $switches ) = @_;
 
-    my @command = $class->_get_command_for_switches( $source, @switches )
+    my @command = $class->_get_command_for_switches( $source, $switches )
       or $class->_croak("No command found!");
 
+    my ( $setup, $teardown ) = $class->_iterator_hooks( $source, $libs );
+
+    return $class->_create_iterator( $source, \@command, $setup, $teardown );
+}
+
+sub _create_iterator {
+    my ( $class, $source, $command, $setup, $teardown ) = @_;
+
     return TAP::Parser::Iterator::Process->new(
-        {   command  => \@command,
+        {   command  => $command,
             merge    => $source->merge,
             setup    => $setup,
             teardown => $teardown,
@@ -196,20 +249,20 @@ sub make_iterator {
 }
 
 sub _get_command_for_switches {
-    my ( $class, $source, @switches ) = @_;
+    my ( $class, $source, $switches ) = @_;
     my $file    = ${ $source->raw };
     my @args    = @{ $source->test_args || [] };
     my $command = $class->get_perl;
 
    # XXX don't need to quote if we treat the parts as atoms (except maybe vms)
    #$file = qq["$file"] if ( $file =~ /\s/ ) && ( $file !~ /^".*"$/ );
-    my @command = ( $command, @switches, $file, @args );
+    my @command = ( $command, @{$switches}, $file, @args );
     return @command;
 }
 
 sub _libs2switches {
     my $class = shift;
-    return map {"-I$_"} grep {$_} @_;
+    return map {"-I$_"} grep {$_} @{ $_[0] };
 }
 
 =head3 C<get_taint>
@@ -235,7 +288,6 @@ sub get_taint {
 sub _switches {
     my ( $class, $source ) = @_;
     my $file     = ${ $source->raw };
-    my @args     = @{ $source->test_args || [] };
     my @switches = @{ $source->switches || [] };
     my $shebang  = $source->meta->{file}->{shebang};
     return unless defined $shebang;
index 9978e5c..1c29cb1 100644 (file)
@@ -17,11 +17,11 @@ TAP::Parser::SourceHandler::RawTAP - Stream output from raw TAP in a scalar/arra
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
diff --git a/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/pgTAP.pm b/cpan/Test-Harness/lib/TAP/Parser/SourceHandler/pgTAP.pm
deleted file mode 100644 (file)
index 95c6e52..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-package TAP::Parser::SourceHandler::pgTAP;
-
-use strict;
-use vars qw($VERSION @ISA);
-
-use TAP::Parser::IteratorFactory   ();
-use TAP::Parser::Iterator::Process ();
-
-@ISA = qw(TAP::Parser::SourceHandler);
-TAP::Parser::IteratorFactory->register_handler(__PACKAGE__);
-
-=head1 NAME
-
-TAP::Parser::SourceHandler::pgTAP - Stream TAP from pgTAP test scripts
-
-=head1 VERSION
-
-Version 3.21
-
-=cut
-
-$VERSION = '3.21';
-
-=head1 SYNOPSIS
-
-In F<Build.PL> for your application with pgTAP tests in F<t/*.pg>:
-
-  Module::Build->new(
-      module_name        => 'MyApp',
-      test_file_exts     => [qw(.t .pg)],
-      use_tap_harness    => 1,
-      tap_harness_args   => {
-          sources => {
-              Perl  => undef,
-              pgTAP => {
-                  dbname => 'try',
-                  username => 'postgres',
-                  suffix => '.pg',
-              },
-          }
-      },
-      build_requires     => {
-          'Module::Build'                      => '0.30',
-          'TAP::Parser::SourceHandler::pgTAP' => '3.19',
-      },
-  )->create_build_script;
-
-If you're using L<C<prove>|prove>:
-
-  prove --source Perl \
-        --source pgTAP --pgtap-option dbname=try \
-                       --pgtap-option username=postgres \
-                       --pgtap-option suffix=.pg
-
-Direct use:
-
-  use TAP::Parser::Source;
-  use TAP::Parser::SourceHandler::pgTAP;
-
-  my $source = TAP::Parser::Source->new->raw(\'mytest.pg');
-  $source->config({ pgTAP => {
-      dbname   => 'testing',
-      username => 'postgres',
-      suffix   => '.pg',
-  });
-  $source->assemble_meta;
-
-  my $class = 'TAP::Parser::SourceHandler::pgTAP';
-  my $vote  = $class->can_handle( $source );
-  my $iter  = $class->make_iterator( $source );
-
-=head1 DESCRIPTION
-
-This source handler executes pgTAP tests. It does two things:
-
-=over
-
-=item 1.
-
-Looks at the L<TAP::Parser::Source> passed to it to determine whether or not
-the source in question is in fact a pgTAP test (L</can_handle>).
-
-=item 2.
-
-Creates an iterator that will call C<psql> to run the pgTAP tests
-(L</make_iterator>).
-
-=back
-
-Unless you're writing a plugin or subclassing L<TAP::Parser>, you probably
-won't need to use this module directly.
-
-=head1 METHODS
-
-=head2 Class Methods
-
-=head3 C<can_handle>
-
-  my $vote = $class->can_handle( $source );
-
-Looks at the source to determine whether or not it's a pgTAP test file and
-returns a score for how likely it is in fact a pgTAP test file. The scores are
-as follows:
-
-  1    if it has a suffix equal to that in the "suffix" config
-  1    if its suffix is ".pg"
-  0.8  if its suffix is ".sql"
-  0.75 if its suffix is ".s"
-
-The latter two scores are subject to change, so try to name your pgTAP tests
-ending in ".pg" or specify a suffix in the configuration to be sure.
-
-=cut
-
-sub can_handle {
-    my ( $class, $source ) = @_;
-    my $meta = $source->meta;
-
-    return 0 unless $meta->{is_file};
-
-    my $suf = $meta->{file}{lc_ext};
-
-    # If the config specifies a suffix, it's required.
-    if ( my $config = $source->config_for('pgTAP') ) {
-        if ( defined $config->{suffix} ) {
-            return $suf eq $config->{suffix} ? 1 : 0;
-        }
-    }
-
-    # Otherwise, return a score for our supported suffixes.
-    my %score_for = (
-        '.pg'  => 0.9,
-        '.sql' => 0.8,
-        '.s'   => 0.75,
-    );
-    return $score_for{$suf} || 0;
-}
-
-=head3 C<make_iterator>
-
-  my $iterator = $class->make_iterator( $source );
-
-Returns a new L<TAP::Parser::Iterator::Process> for the source. C<<
-$source->raw >> must be either a file name or a scalar reference to the file
-name.
-
-The pgTAP tests are run by executing C<psql>, the PostgreSQL command-line
-utility. A number of arguments are passed to it, many of which you can effect
-by setting up the source source configuration. The configuration must be a
-hash reference, and supports the following keys:
-
-=over
-
-=item C<psql>
-
-The path to the C<psql> command. Defaults to simply "psql", which should work
-well enough if it's in your path.
-
-=item C<dbname>
-
-The database to which to connect to run the tests. Defaults to the value of
-the C<$PGDATABASE> environment variable or, if not set, to the system
-username.
-
-=item C<username>
-
-The PostgreSQL username to use to connect to PostgreSQL. If not specified, no
-username will be used, in which case C<psql> will fall back on either the
-C<$PGUSER> environment variable or, if not set, the system username.
-
-=item C<host>
-
-Specifies the host name of the machine to which to connect to the PostgreSQL
-server. If the value begins with a slash, it is used as the directory for the
-Unix-domain socket. Defaults to the value of the C<$PGDATABASE> environment
-variable or, if not set, the local host.
-
-=item C<port>
-
-Specifies the TCP port or the local Unix-domain socket file extension on which
-the server is listening for connections. Defaults to the value of the
-C<$PGPORT> environment variable or, if not set, to the port specified at the
-time C<psql> was compiled, usually 5432.
-
-=begin comment
-
-=item C<search_path>
-
-The schema search path to use during the execution of the tests. Useful for
-overriding the default search path and you have pgTAP installed in a schema
-not included in that search path.
-
-=end comment
-
-=back
-
-=cut
-
-sub make_iterator {
-    my ( $class, $source ) = @_;
-    my $config = $source->config_for('pgTAP');
-
-    my @command = ( $config->{psql} || 'psql' );
-    push @command, qw(
-      --no-psqlrc
-      --no-align
-      --quiet
-      --pset pager=
-      --pset tuples_only=true
-      --set ON_ERROR_ROLLBACK=1
-      --set ON_ERROR_STOP=1
-    );
-
-    for (qw(username host port dbname)) {
-        push @command, "--$_" => $config->{$_} if defined $config->{$_};
-    }
-
-    my $fn = ref $source->raw ? ${ $source->raw } : $source->raw;
-    $class->_croak(
-        'No such file or directory: ' . ( defined $fn ? $fn : '' ) )
-      unless $fn && -e $fn;
-
-    push @command, '--file', $fn;
-
-  # XXX I'd like a way to be able to specify environment variables to set when
-  # the iterator executes the command...
-  # local $ENV{PGOPTIONS} = "--search_path=$config->{search_path}"
-  #     if $config->{search_path};
-
-    return TAP::Parser::Iterator::Process->new(
-        {   command => \@command,
-            merge   => $source->merge
-        }
-    );
-}
-
-=head1 SEE ALSO
-
-L<TAP::Object>,
-L<TAP::Parser>,
-L<TAP::Parser::IteratorFactory>,
-L<TAP::Parser::SourceHandler>,
-L<TAP::Parser::SourceHandler::Executable>,
-L<TAP::Parser::SourceHandler::Perl>,
-L<TAP::Parser::SourceHandler::File>,
-L<TAP::Parser::SourceHandler::Handle>,
-L<TAP::Parser::SourceHandler::RawTAP>
-
-=head1 AUTHOR
-
-David E. Wheeler <dwheeler@cpan.org>
-
-=cut
index e7c5345..eeaa6d3 100644 (file)
@@ -13,11 +13,11 @@ TAP::Parser::Utils - Internal TAP::Parser utilities
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 =head1 SYNOPSIS
 
index a577159..48ee022 100644 (file)
@@ -6,7 +6,7 @@ use vars qw($VERSION @ISA);
 use TAP::Object ();
 
 @ISA     = 'TAP::Object';
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 # TODO:
 #   Handle blessed object syntax
@@ -270,7 +270,7 @@ TAP::Parser::YAMLish::Reader - Read YAMLish data from iterator
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =head1 SYNOPSIS
 
index a20b625..aff30e8 100644 (file)
@@ -6,7 +6,7 @@ use vars qw($VERSION @ISA);
 use TAP::Object ();
 
 @ISA     = 'TAP::Object';
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 my $ESCAPE_CHAR = qr{ [ \x00-\x1f \" ] }x;
 my $ESCAPE_KEY  = qr{ (?: ^\W ) | $ESCAPE_CHAR }x;
@@ -147,7 +147,7 @@ TAP::Parser::YAMLish::Writer - Write YAMLish data
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =head1 SYNOPSIS
 
index a528301..6921fd8 100644 (file)
@@ -46,11 +46,11 @@ Test::Harness - Run Perl standard test scripts with statistics
 
 =head1 VERSION
 
-Version 3.21
+Version 3.22
 
 =cut
 
-$VERSION = '3.21';
+$VERSION = '3.22';
 
 # Backwards compatibility for exportable variable names.
 *verbose  = *Verbose;
@@ -134,7 +134,7 @@ sub _aggregate {
     _aggregate_tests( $harness, $aggregate, @tests );
 }
 
-# Make sure the child seens all the extra junk in @INC
+# Make sure the child sees all the extra junk in @INC
 sub _apply_extra_INC {
     my $harness = shift;
 
index c0d62b0..8bd0951 100644 (file)
@@ -23,6 +23,8 @@ sub has_crazy_patch {
 use Test::More (
       $^O eq 'VMS' ? ( skip_all => 'VMS' )
     : has_crazy_patch() ? ( skip_all => 'Incompatible @INC patch' )
+    : exists $ENV{HARNESS_PERL_SWITCHES}
+    ? ( skip_all => 'Someone messed with HARNESS_PERL_SWITCHES' )
     : ( tests => 2 )
 );
 
index e74ede0..05e8283 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  use lib 't/lib';
+    use lib 't/lib';
 }
 
 use strict;
@@ -26,11 +26,8 @@ sub _all_ok {
 
     tie *NULL, 'Dev::Null' or die $!;
     select NULL;
-    my ( $tot, $failed ) = Test::Harness::execute_tests(
-        tests => [
-            't/sample-tests/inc_taint'
-        ]
-    );
+    my ( $tot, $failed )
+      = Test::Harness::execute_tests( tests => ['t/sample-tests/inc_taint'] );
     select STDOUT;
 
     ok( _all_ok($tot), 'tests with taint on preserve @INC' );
index 0951c97..cae9a54 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -15,8 +15,7 @@ use Test::Harness qw(execute_tests);
 # unset this global when self-testing ('testcover' and etc issue)
 local $ENV{HARNESS_PERL_SWITCHES};
 
-my $TEST_DIR
-  = 't/sample-tests';
+my $TEST_DIR = 't/sample-tests';
 
 {
 
index 3f4a84d..1eeb68d 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -12,10 +12,8 @@ use TAP::Harness;
 
 my $HARNESS = 'TAP::Harness';
 
-my $source_tests
-  = 't/source_tests';
-my $sample_tests
-  = 't/sample-tests';
+my $source_tests = 't/source_tests';
+my $sample_tests = 't/sample-tests';
 
 plan tests => 56;
 
@@ -76,7 +74,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     my $status           = pop @output;
     my $expected_status  = qr{^Result: PASS$};
     my $summary          = pop @output;
-    my $expected_summary = qr{^Files=1, Tests=1,  \d+ wallclock secs};
+    my $expected_summary = qr{^Files=1, Tests=1, +\d+ wallclock secs};
 
     is_deeply \@output, \@expected, '... the output should be correct';
     like $status, $expected_status,
@@ -105,7 +103,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr{^Files=1, Tests=1,  \d+ wallclock secs};
+    $expected_summary = qr{^Files=1, Tests=1, +\d+ wallclock secs};
 
     is_deeply \@output, \@expected, '... the output should be correct';
     like $status, $expected_status,
@@ -140,7 +138,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr{^Files=2, Tests=2,  \d+ wallclock secs};
+    $expected_summary = qr{^Files=2, Tests=2, +\d+ wallclock secs};
 
     is_deeply \@output, \@expected, '... the output should be correct';
     like $status, $expected_status,
@@ -163,7 +161,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr/^Files=1, Tests=1,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=1, +\d+ wallclock secs/;
 
     is_deeply \@output, \@expected, '... the output should be correct';
     like $status, $expected_status,
@@ -184,7 +182,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr/^Files=1, Tests=1,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=1, +\d+ wallclock secs/;
 
     is_deeply \@output, \@expected, '... the output should be correct';
     like $status, $expected_status,
@@ -305,7 +303,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
 
     $status           = pop @output;
     $summary          = pop @output;
-    $expected_summary = qr/^Files=1, Tests=3,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=3, +\d+ wallclock secs/;
 
     is_deeply \@output, \@expected, '... the output should be correct';
     like $summary, $expected_summary,
@@ -372,7 +370,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $summary = pop @output;
 
     like $status, qr{^Result: FAIL$}, '... the status line should be correct';
-    $expected_summary = qr/^Files=1, Tests=2,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=2, +\d+ wallclock secs/;
     is_deeply \@output, \@expected, '... and the output should be correct';
 
     # check the status output for no tests
@@ -396,7 +394,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $summary = pop @output;
 
     like $status, qr{^Result: FAIL$}, '... the status line should be correct';
-    $expected_summary = qr/^Files=1, Tests=2,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=2, +\d+ wallclock secs/;
     is_deeply \@output, \@expected, '... and the output should be correct';
 
     # coverage testing for _should_show_comments
@@ -425,7 +423,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $summary = pop @output;
 
     like $status, qr{^Result: FAIL$}, '... the status line should be correct';
-    $expected_summary = qr/^Files=1, Tests=2,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=2, +\d+ wallclock secs/;
     is_deeply \@output, \@expected, '... and the output should be correct';
 
     # coverage testing for _should_show_comments and _should_show_failures
@@ -457,7 +455,7 @@ ok $ENV{HARNESS_VERSION}, 'HARNESS_VERSION env variable should be set';
     $summary = pop @output;
 
     like $status, qr{^Result: FAIL$}, '... the status line should be correct';
-    $expected_summary = qr/^Files=1, Tests=2,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=2, +\d+ wallclock secs/;
     is_deeply \@output, \@expected, '... and the output should be correct';
 
     #XXXX
index 51f45d2..d145c13 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use Test::More tests => 94;
index 95e740f..c6b46da 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
index 1ba4b49..a5f0c47 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-   unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -13,10 +13,8 @@ use TAP::Harness;
 
 my $HARNESS = 'TAP::Harness';
 
-my $source_tests
-  = 't/source_tests';
-my $sample_tests
-  = 't/sample-tests';
+my $source_tests = 't/source_tests';
+my $sample_tests = 't/sample-tests';
 
 plan tests => 128;
 
@@ -124,7 +122,7 @@ for my $test_args ( get_arg_sets() ) {
     my $status           = pop @output;
     my $expected_status  = qr{^Result: PASS$};
     my $summary          = pop @output;
-    my $expected_summary = qr{^Files=1, Tests=1,  \d+ wallclock secs};
+    my $expected_summary = qr{^Files=1, Tests=1, +\d+ wallclock secs};
 
     is_deeply \@output, \@expected, '... and the output should be correct';
     like $status, $expected_status,
@@ -157,7 +155,7 @@ for my $test_args ( get_arg_sets() ) {
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr{^Files=1, Tests=1,  \d+ wallclock secs};
+    $expected_summary = qr{^Files=1, Tests=1, +\d+ wallclock secs};
 
     is_deeply \@output, \@expected, '... and the output should be correct';
     like $status, $expected_status,
@@ -198,7 +196,7 @@ for my $test_args ( get_arg_sets() ) {
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr{^Files=2, Tests=2,  \d+ wallclock secs};
+    $expected_summary = qr{^Files=2, Tests=2, +\d+ wallclock secs};
 
     is_deeply \@output, \@expected, '... and the output should be correct';
     like $status, $expected_status,
@@ -221,7 +219,7 @@ for my $test_args ( get_arg_sets() ) {
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr/^Files=1, Tests=1,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=1, +\d+ wallclock secs/;
 
     is_deeply \@output, \@expected, '... and the output should be correct';
     like $status, $expected_status,
@@ -242,7 +240,7 @@ for my $test_args ( get_arg_sets() ) {
     $status           = pop @output;
     $expected_status  = qr{^Result: PASS$};
     $summary          = pop @output;
-    $expected_summary = qr/^Files=1, Tests=1,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=1, +\d+ wallclock secs/;
 
     is_deeply \@output, \@expected, '... and the output should be correct';
     like $status, $expected_status,
@@ -378,7 +376,7 @@ for my $test_args ( get_arg_sets() ) {
 
     $status           = pop @output;
     $summary          = pop @output;
-    $expected_summary = qr/^Files=1, Tests=3,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=3, +\d+ wallclock secs/;
 
     is_deeply \@output, \@expected, '... and the output should be correct';
     like $summary, $expected_summary,
@@ -488,7 +486,7 @@ for my $test_args ( get_arg_sets() ) {
 
     like $status, qr{^Result: FAIL$},
       '... and the status line should be correct';
-    $expected_summary = qr/^Files=1, Tests=2,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=2, +\d+ wallclock secs/;
     is_deeply \@output, \@expected, '... and the output should be correct';
 
     # check the status output for no tests
@@ -512,7 +510,7 @@ for my $test_args ( get_arg_sets() ) {
 
     like $status, qr{^Result: FAIL$},
       '... and the status line should be correct';
-    $expected_summary = qr/^Files=1, Tests=2,  \d+ wallclock secs/;
+    $expected_summary = qr/^Files=1, Tests=2, +\d+ wallclock secs/;
     is_deeply \@output, \@expected, '... and the output should be correct';
 
     #XXXX
@@ -536,12 +534,7 @@ SKIP: {
         }
     );
 
-    eval {
-        _runtests(
-            $harness,
-            't/data/catme.1'
-        );
-    };
+    eval { _runtests( $harness, 't/data/catme.1' ); };
 
     my @output = tied($$capture)->dump;
     my $status = pop @output;
@@ -634,8 +627,7 @@ SKIP: {
         {   verbosity => -2,
             stdout    => $capture,
             exec      => sub {
-                open my $fh,
-                  't/data/catme.1';
+                open my $fh, 't/data/catme.1';
                 return $fh;
             },
         }
@@ -965,9 +957,7 @@ sub _runtests {
 
     # coverage tests for the basically untested T::H::_open_spool
 
-    my @spool = (
-        't', 'spool'
-    );
+    my @spool = ( 't', 'spool' );
     $ENV{PERL_TEST_HARNESS_DUMP_TAP} = File::Spec->catfile(@spool);
 
 # now given that we're going to be writing stuff to the file system, make sure we have
index c0e3e5c..36abdff 100644 (file)
@@ -4,7 +4,7 @@
 ##
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -98,7 +98,7 @@ my @sources = (
         iterator => 'TAP::Parser::Iterator::Process',
     },
     {   file     => 'source.sh',
-        handler  => 'TAP::Parser::SourceHandler::Executable',
+        handler  => 'TAP::Parser::SourceHandler::Perl',
         iterator => 'TAP::Parser::Iterator::Process',
     },
     {   file     => 'source.bat',
diff --git a/cpan/Test-Harness/t/lib/MyShebangger.pm b/cpan/Test-Harness/t/lib/MyShebangger.pm
deleted file mode 100644 (file)
index 1606ea5..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-package MyShebangger;
-
-use strict;
-use warnings;
-
-use Config;
-
-=head1 NAME
-
-MyShebangger - Encapsulate EUMM / MB shebang magic
-
-=item fix_shebang
-
-  fix_shebang($file_in, $file_out);
-
-Inserts the sharpbang or equivalent magic number at the start of a file.
-
-=cut
-
-# stolen from ExtUtils::MakeMaker which said:
-# stolen from the pink Camel book, more or less
-sub fix_shebang {
-    my ( $file_in, $file_out ) = @_;
-
-    my ($does_shbang) = $Config{'sharpbang'} =~ /^\s*\#\!/;
-
-    open my $fixin, '<', $file_in or die "Can't process '$file_in': $!";
-    local $/ = "\n";
-    chomp( my $line = <$fixin> );
-
-    die "$file_in doesn't have a shebang line"
-      unless $line =~ s/^\s*\#!\s*//;
-
-    # Now figure out the interpreter name.
-    my ( $cmd, $arg ) = split ' ', $line, 2;
-    $cmd =~ s!^.*/!!;
-
-    my $interpreter;
-
-    die "$file_in is not perl"
-      unless $cmd =~ m{^perl(?:\z|[^a-z])};
-
-    if ($ENV{PERL_CORE}) {
-        $interpreter = $^X;
-    }
-    elsif ( $Config{startperl} =~ m,^\#!.*/perl, ) {
-        $interpreter = $Config{startperl};
-        $interpreter =~ s,^\#!,,;
-    }
-    else {
-        $interpreter = $Config{perlpath};
-    }
-
-    die "Can't figure out which interpreter to use."
-      unless defined $interpreter;
-
-    # Figure out how to invoke interpreter on this machine.
-    my $shb = '';
-
-    # this is probably value-free on DOSISH platforms
-    my $shb_line = join ' ', grep defined, $interpreter, $arg;
-    $shb .= "$Config{'sharpbang'}$shb_line\n"
-      if $does_shbang;
-    $shb .= qq{
-eval 'exec $shb_line -S \$0 \${1+"\$\@"}'
-    if 0; # not running under some shell
-} unless $^O eq 'MSWin32';    # this won't work on win32, so don't
-
-    open my $fixout, ">", "$file_out"
-      or die "Can't create new $file_out: $!\n";
-
-    # Print out the new #! line (or equivalent).
-    local $\;
-    local $/;
-    print $fixout $shb, <$fixin>;
-    close $fixin;
-    close $fixout;
-
-    system("$Config{'eunicefix'} $file_out") if $Config{'eunicefix'} ne ':';
-    chmod 0755, $file_out;    # ignore failure
-}
-
-{
-    my @cleanup = ();
-    my $seq     = 1;
-    END { unlink @cleanup }
-
-    sub make_perl_executable {
-        my $file     = shift;
-        my $tmp_file = "${file}_${$}_$seq.pl";
-        $seq++;
-        fix_shebang( $file, $tmp_file );
-        push @cleanup, $tmp_file;
-        return $tmp_file;
-    }
-}
-1;
diff --git a/cpan/Test-Harness/t/nested.t b/cpan/Test-Harness/t/nested.t
new file mode 100644 (file)
index 0000000..473e676
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/perl -wT
+
+use strict;
+use lib 't/lib';
+
+use Test::More tests => 5;
+
+use TAP::Parser;
+
+my $tap = <<'END_TAP';
+1..2
+ok 1 - input file opened
+... this is junk
+    Bail out!  We ran out of foobar.
+END_TAP
+my $parser = TAP::Parser->new( { tap => $tap } );
+isa_ok $parser, 'TAP::Parser',
+  '... we should be able to parse bailed out tests';
+
+my @results;
+while ( my $result = $parser->next ) {
+    push @results => $result;
+}
+my $bailout = pop @results;
+ok $bailout->is_bailout, 'We should be able to parse a nested bailout';
+is $bailout->as_string,  'We ran out of foobar.',
+  '... and as_string() should return the explanation';
+is $bailout->raw, '    Bail out!  We ran out of foobar.',
+  '... and raw() should return the explanation';
+is $bailout->explanation, 'We ran out of foobar.',
+  '... and it should have the correct explanation';
index bc26588..3b702a2 100644 (file)
@@ -1,11 +1,10 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  use lib 't/lib';
+    use lib 't/lib';
 }
 
 use strict;
 
 use NoFork;
-require(
-    't/multiplexer.t' );
+require('t/multiplexer.t');
index 00b8dd6..88c2e98 100644 (file)
@@ -4,7 +4,7 @@
 # NOTE maybe a good candidate for xt/author or something.
 
 BEGIN {
-  use lib 't/lib';
+    use lib 't/lib';
 }
 
 use strict;
@@ -51,11 +51,10 @@ my $mod = 'TAP::Parser::Iterator::Process';
             stdout    => $capture,
         }
     );
-    $harness->runtests( 
-        't/sample-tests/simple' );
+    $harness->runtests('t/sample-tests/simple');
     my @output = tied($$capture)->dump;
     is pop @output, "Result: PASS\n", 'status OK';
-    pop @output;    # get rid of summary line
+    pop @output;                 # get rid of summary line
     is( $output[-1], "All tests successful.\n", 'ran with no fork' );
 }
 
index 68c1df5..9cf5913 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 
 BEGIN {
-  use lib 't/lib';
+    use lib 't/lib';
 }
 
 use Test::More tests => 294;
@@ -447,8 +447,7 @@ is( scalar @results, 2, "Got two lines of TAP" );
 
 # Check source => $filehandle
 can_ok $PARSER, 'new';
-open my $fh,
-  't/data/catme.1';
+open my $fh, 't/data/catme.1';
 $parser = $PARSER->new( { source => $fh } );
 isa_ok $parser, $PARSER, '... and calling it should succeed';
 ok @results = _get_results($parser), 'The parser should return results';
index ca61b71..4fdd7cc 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -14,8 +14,8 @@ use TAP::Parser;
 use_ok('MyGrammar');
 use_ok('MyResultFactory');
 
-my @t_path = ();
-my $source = catfile( @t_path, 't', 'source_tests', 'source' );
+my @t_path    = ();
+my $source    = catfile( @t_path, 't', 'source_tests', 'source' );
 my %customize = (
     grammar_class        => 'MyGrammar',
     result_factory_class => 'MyResultFactory',
index a798bfd..4e8a2a7 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
index 37e2118..16a36da 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -12,6 +12,8 @@ use File::Spec;
 use App::Prove;
 use Getopt::Long;
 
+use TAP::Parser::Utils qw( split_shell );
+
 package FakeProve;
 use vars qw( @ISA );
 
@@ -80,7 +82,7 @@ BEGIN {    # START PLAN
 
     # list of attributes
     @ATTR = qw(
-      archive argv blib color directives exec extension failures
+      archive argv blib color directives exec extensions failures
       formatter harness includes lib merge parse quiet really_quiet
       recurse backwards shuffle taint_fail taint_warn verbose
       warnings_fail warnings_warn
@@ -1011,7 +1013,7 @@ BEGIN {    # START PLAN
             args => {
                 argv => [qw( one two three )],
             },
-            proverc => 't/proverc/emptyexec',
+            proverc  => 't/proverc/emptyexec',
             switches => [$dummy_test],
             expect   => { exec => '' },
             runlog   => [
@@ -1083,6 +1085,34 @@ BEGIN {    # START PLAN
             ],
         },
 
+        # Specify an oddball extension
+        {   name => 'Switch --ext=.wango',
+            switches => [ '--ext=.wango' ],
+            expect => { extensions => ['.wango'] },
+            runlog => [
+                [   '_runtests',
+                    {   verbosity  => 0,
+                        show_count => 1,
+                    },
+                    'TAP::Harness',
+                ]
+            ],
+        },
+
+        # Handle multiple extensions
+        {   name => 'Switch --ext=.foo --ext=.bar',
+            switches => [ '--ext=.foo', '--ext=.bar', ],
+            expect => { extensions => ['.foo','.bar'] },
+            runlog => [
+                [   '_runtests',
+                    {   verbosity  => 0,
+                        show_count => 1,
+                    },
+                    'TAP::Harness',
+                ]
+            ],
+        },
+
         # Source handlers
         {   name     => 'Switch --source simple',
             args     => { argv => [qw( one two three )] },
@@ -1118,13 +1148,20 @@ BEGIN {    # START PLAN
                 '--source',      'File',
                 '--file-option', 'extensions=.txt',
                 '--file-option', 'extensions=.tmp',
+                '--file-option', 'hash=this=that',
+                '--file-option', 'hash=foo=bar',
+                '--file-option', 'sep=foo\\=bar',
                 $dummy_test
             ],
             expect => {
                 sources => {
                     Perl     => { foo => 'bar baz', avg => 0.278 },
                     MyCustom => {},
-                    File => { extensions => [ '.txt', '.tmp' ] },
+                    File => {
+                        extensions => [ '.txt', '.tmp' ],
+                        hash => { this => 'that', foo => 'bar'},
+                        sep => 'foo=bar',
+                    },
                 },
             },
             runlog => [
@@ -1132,7 +1169,11 @@ BEGIN {    # START PLAN
                     {   sources => {
                             Perl     => { foo => 'bar baz', avg => 0.278 },
                             MyCustom => {},
-                            File => { extensions => [ '.txt', '.tmp' ] },
+                            File => {
+                                extensions => [ '.txt', '.tmp' ],
+                                hash => { this => 'that', foo => 'bar'},
+                                sep => 'foo=bar',
+                            },
                         },
                         verbosity  => 0,
                         show_count => 1,
@@ -1584,6 +1625,11 @@ for my $test (@SCHEDULE) {
                     $extra->($gotlog);
                 }
 
+                # adapt our expectations if HARNESS_PERL_SWITCHES is set
+                push @{ $runlog->[0][1]{switches} },
+                  split_shell( $ENV{HARNESS_PERL_SWITCHES} )
+                  if $ENV{HARNESS_PERL_SWITCHES};
+
                 unless (
                     is_deeply $gotlog, $runlog,
                     "$name: run results match"
index a8b647e..e3febcf 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
index cdbd148..736eb2e 100644 (file)
@@ -1,20 +1,19 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
 use Test::More;
 use File::Spec;
 use App::Prove;
+use TAP::Parser::Utils qw( split_shell );
 
 my @SCHEDULE;
 
 BEGIN {
-    my $t_dir = File::Spec->catdir(
-        't'
-    );
+    my $t_dir = File::Spec->catdir('t');
 
     # to add a new test to proverun, just list the name of the file in
     # t/sample-tests and a name for the test.  The rest is handled
@@ -47,6 +46,9 @@ BEGIN {
                         {   merge   => undef,
                             command => [
                                 'PERL',
+                                $ENV{HARNESS_PERL_SWITCHES}
+                                ? split_shell( $ENV{HARNESS_PERL_SWITCHES} )
+                                : (),
                                 $_->{file},
                             ],
                             setup    => \'CODE',
diff --git a/cpan/Test-Harness/t/proveversion.t b/cpan/Test-Harness/t/proveversion.t
new file mode 100644 (file)
index 0000000..a51e7ed
--- /dev/null
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+  unshift @INC, 't/lib';
+}
+
+sub _has_TAP_Formatter_HTML {
+    eval "use TAP::Formatter::HTML";
+    return $@ ? 0 : 1;
+}
+
+use strict;
+use Test::More tests => 1;
+use IO::c55Capture;    # for util
+
+SKIP: {
+    skip "requires TAP::Formatter::HTML", 1 unless _has_TAP_Formatter_HTML();
+
+    my $ans = util::stdout_of(
+        sub {
+            system( $^X,
+                "bin/prove",
+                "-l",
+                "--formatter=TAP::Formatter::HTML",
+                "--tapversion=13",
+                "t/sample-tests/simple_yaml_missing_version13"
+            ) and die "error $?";
+        }
+    );
+    like(
+        $ans, qr/li class="yml"/,
+        "prove --tapversion=13 simple_yaml_missing_version13"
+    );
+}
index b952ef5..aa3a194 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  push @INC, 't/lib';
+    push @INC, 't/lib';
 }
 
 use strict;
@@ -3123,6 +3123,70 @@ my %samples = (
         wait    => 0,
         version => 12,
     },
+    yaml_late_plan => {
+        results => [
+            {   is_version => TRUE,
+                raw        => 'TAP version 13',
+            },
+            {   actual_passed => TRUE,
+                is_actual_ok  => TRUE,
+                passed        => TRUE,
+                is_ok         => TRUE,
+                is_test       => TRUE,
+                has_skip      => FALSE,
+                has_todo      => FALSE,
+                number        => 1,
+                description   => "- test suite started",
+            },
+            {   actual_passed => TRUE,
+                is_actual_ok  => TRUE,
+                passed        => TRUE,
+                is_ok         => TRUE,
+                is_test       => TRUE,
+                has_skip      => FALSE,
+                has_todo      => FALSE,
+                number        => 2,
+                description   => "- bogomips",
+            },
+            {   is_yaml => TRUE,
+                data    => { 'Bogomips' => '5226.88' },
+                raw =>
+                  "  ---\n  Bogomips: 5226.88\n  ...",
+            },
+            {   actual_passed => TRUE,
+                is_actual_ok  => TRUE,
+                passed        => TRUE,
+                is_ok         => TRUE,
+                is_test       => TRUE,
+                has_skip      => FALSE,
+                has_todo      => FALSE,
+                number        => 3,
+                description   => "- test suite finished",
+            },
+            {   is_plan       => TRUE,
+                raw           => '1..3',
+                tests_planned => 3,
+                passed        => TRUE,
+                is_ok         => TRUE,
+            },
+        ],
+        plan          => '1..3',
+        passed        => [ 1 .. 3 ],
+        actual_passed => [ 1 .. 3 ],
+        failed        => [],
+        actual_failed => [],
+        todo          => [],
+        todo_passed   => [],
+        skipped       => [],
+        good_plan     => TRUE,
+        is_good_plan  => TRUE,
+        tests_planned => 3,
+        tests_run     => 3,
+        parse_errors  => [],
+        'exit'        => 0,
+        wait          => 0,
+        version       => 13,
+    },
 );
 
 my %HANDLER_FOR = (
diff --git a/cpan/Test-Harness/t/sample-tests/simple_yaml_missing_version13 b/cpan/Test-Harness/t/sample-tests/simple_yaml_missing_version13
new file mode 100644 (file)
index 0000000..6a06137
--- /dev/null
@@ -0,0 +1,26 @@
+print <<DUMMY_TEST;
+1..5
+ok 1
+ok 2
+  ---
+  -
+    fnurk: skib
+    ponk: gleeb
+  -
+    bar: krup
+    foo: plink
+  ...
+ok 3
+ok 4
+  ---
+  expected:
+    - 1
+    - 2
+    - 4
+  got:
+    - 1
+    - pong
+    - 4
+  ...
+ok 5
+DUMMY_TEST
diff --git a/cpan/Test-Harness/t/sample-tests/yaml_late_plan b/cpan/Test-Harness/t/sample-tests/yaml_late_plan
new file mode 100644 (file)
index 0000000..ea3dbd1
--- /dev/null
@@ -0,0 +1,10 @@
+print <<DUMMY_TEST;
+TAP version 13
+ok - test suite started
+ok - bogomips
+  ---
+  Bogomips: 5226.88
+  ...
+ok - test suite finished
+1..3
+DUMMY_TEST
index 3950143..77f6184 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
@@ -16,6 +16,15 @@ my $dir = File::Spec->catdir(
 
 use_ok('TAP::Parser::Source');
 
+sub ct($) {
+    my $hash = shift;
+    if ( $ENV{PERL_CORE} ) {
+        delete $hash->{is_symlink};
+        delete $hash->{lstat};
+    }
+    return $hash;
+}
+
 # Basic tests
 {
     my $source = TAP::Parser::Source->new;
@@ -131,8 +140,8 @@ use_ok('TAP::Parser::Source');
     # separate meta->file to break up the test
     my $file = delete $meta->{file};
     is_deeply(
-        $meta,
-        {   is_scalar    => 1,
+        ct $meta,
+        ct {is_scalar    => 1,
             has_newlines => 0,
             length       => length($test),
             is_object    => 0,
@@ -152,8 +161,8 @@ use_ok('TAP::Parser::Source');
     isnt( delete $file->{write},   undef, '... file->write set' );
     isnt( delete $file->{execute}, undef, '... file->execute set' );
     is_deeply(
-        $file,
-        {   basename   => 'source.t',
+        ct $file,
+        ct {basename   => 'source.t',
             ext        => '.t',
             lc_ext     => '.t',
             shebang    => '#!/usr/bin/perl',
@@ -164,9 +173,10 @@ use_ok('TAP::Parser::Source');
             is_dir     => 0,
             is_file    => 1,
             is_symlink => 0,
-            sticky     => 0,
-            setgid     => 0,
-            setuid     => 0,
+            # Fix for bizarre -k bug in Strawberry Perl
+            sticky     => ( -k $test )[-1] ? 1 : 0,
+            setgid     => -g $test ? 1 : 0,
+            setuid     => -u $test ? 1 : 0,
         },
         '... file->* set'
     );
@@ -174,7 +184,7 @@ use_ok('TAP::Parser::Source');
 
 # dir test
 {
-    my $test   = File::Spec->catfile($dir);
+    my $test   = $dir;
     my $source = TAP::Parser::Source->new;
 
     $source->raw( \$test );
@@ -183,8 +193,8 @@ use_ok('TAP::Parser::Source');
     # separate meta->file to break up the test
     my $file = delete $meta->{file};
     is_deeply(
-        $meta,
-        {   is_scalar    => 1,
+        ct $meta,
+        ct {is_scalar    => 1,
             has_newlines => 0,
             length       => length($test),
             is_object    => 0,
@@ -206,8 +216,8 @@ use_ok('TAP::Parser::Source');
     isnt( delete $file->{write},   undef, '... file->write set' );
     isnt( delete $file->{execute}, undef, '... file->execute set' );
     is_deeply(
-        $file,
-        {   basename   => 'source_tests',
+        ct $file,
+        ct {basename   => 'source_tests',
             ext        => '',
             lc_ext     => '',
             text       => 0,
@@ -215,9 +225,9 @@ use_ok('TAP::Parser::Source');
             is_dir     => 1,
             is_file    => 0,
             is_symlink => 0,
-            sticky     => 0,
-            setgid     => 0,
-            setuid     => 0,
+            sticky     => ( -k $test )[-1] ? 1 : 0,
+            setgid     => -g $test ? 1 : 0,
+            setuid     => -u $test ? 1 : 0,
         },
         '... file->* set'
     );
@@ -244,8 +254,8 @@ SKIP: {
     # separate meta->file to break up the test
     my $file = delete $meta->{file};
     is_deeply(
-        $meta,
-        {   is_scalar    => 1,
+        ct $meta,
+        ct {is_scalar    => 1,
             has_newlines => 0,
             length       => length($symlink),
             is_object    => 0,
@@ -267,8 +277,8 @@ SKIP: {
     isnt( delete $file->{write},   undef, '... file->write set' );
     isnt( delete $file->{execute}, undef, '... file->execute set' );
     is_deeply(
-        $file,
-        {   basename   => 'source_link.T',
+        ct $file,
+        ct {basename   => 'source_link.T',
             ext        => '.T',
             lc_ext     => '.t',
             shebang    => '#!/usr/bin/perl',
@@ -279,9 +289,9 @@ SKIP: {
             is_dir     => 0,
             is_file    => 1,
             is_symlink => 1,
-            sticky     => 0,
-            setgid     => 0,
-            setuid     => 0,
+            sticky     => ( -k $symlink )[-1] ? 1 : 0,
+            setgid     => -g $symlink ? 1 : 0,
+            setuid     => -u $symlink ? 1 : 0,
         },
         '... file->* set'
     );
index b16b9e2..77f675b 100644 (file)
@@ -1,17 +1,16 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-   unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
 
-use Test::More tests => 123;
+use Test::More tests => 79;
 
 use IO::File;
 use IO::Handle;
 use File::Spec;
-use MyShebangger;
 
 use TAP::Parser::Source;
 use TAP::Parser::SourceHandler;
@@ -28,7 +27,8 @@ my $dir = File::Spec->catdir(
 my $perl = $^X;
 
 my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
-  qw( source source.1 source.bat source.pl source.sh source.t source.tap );
+  qw( source source.1 source.bat source.pl source.sh source_args.sh source.t
+      source.tap );
 
 # Abstract base class tests
 {
@@ -60,7 +60,7 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
                     is_file => 1,
                     file    => { lc_ext => '.sh' }
                 },
-                vote => 0.8,
+                vote => 0,
             },
             {   name => '.bat',
                 meta => {
@@ -74,7 +74,7 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
                     is_file => 1,
                     file    => { lc_ext => '', execute => 1 }
                 },
-                vote => 0.7,
+                vote => 0.25,
             },
             {   name => 'exec hash',
                 raw  => { exec => 'foo' },
@@ -83,9 +83,12 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
             },
         ],
         make_iterator => [
-            {   name   => "valid executable",
-                raw    => [ $perl, ($ENV{PERL_CORE} ? '-I../../lib' : ()), '-It/lib', '-T', $file{source} ],
-                iclass => 'TAP::Parser::Iterator::Process',
+            {   name => "valid executable",
+                raw  => [
+                    $perl, ( $ENV{PERL_CORE} ? '-I../../lib' : () ),
+                    '-It/lib', '-T', $file{source}
+                ],
+                iclass        => 'TAP::Parser::Iterator::Process',
                 output        => [ '1..1', 'ok 1 - source' ],
                 assemble_meta => 1,
             },
@@ -105,6 +108,15 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
                 output        => [ '1..1', 'ok 1 - source.sh' ],
                 assemble_meta => 1,
             },
+            {   name        => $file{'source_args.sh'},
+                raw         => { exec => [ $file{'source_args.sh'} ] },
+                test_args   => [ 'foo' ],
+                skip        => $HAS_SH && $HAS_ECHO ? 0 : 1,
+                skip_reason => 'no /bin/sh, /bin/echo',
+                iclass      => 'TAP::Parser::Iterator::Process',
+                output        => [ '1..1', 'ok 1 - source_args.sh foo' ],
+                assemble_meta => 1,
+            },
             {   name        => $file{'source.bat'},
                 raw         => \$file{'source.bat'},
                 skip        => $IS_WIN32 ? 0 : 1,
@@ -304,111 +316,6 @@ my %file = map { $_ => File::Spec->catfile( $dir, $_ ) }
     test_handler( $class, $tests );
 }
 
-# pgTAP source tests
-{
-    my $class = 'TAP::Parser::SourceHandler::pgTAP';
-    my $test  = File::Spec->catfile( $dir, 'source.t' );
-    my $psql  = File::Spec->catfile( $dir, 'psql' );
-    if ( $^O eq 'MSWin32' ) {
-        $psql .= '.bat';
-    }
-    else {
-        $psql = MyShebangger::make_perl_executable($psql);
-    }
-    my @command = qw(
-      --no-psqlrc
-      --no-align
-      --quiet
-      --pset pager=
-      --pset tuples_only=true
-      --set ON_ERROR_ROLLBACK=1
-      --set ON_ERROR_STOP=1
-    );
-    my $tests = {
-        default_vote => 0,
-        can_handle   => [
-            {   name => '.pg',
-                meta => {
-                    is_file => 1,
-                    file    => { lc_ext => '.pg' }
-                },
-                config => {},
-                vote   => 0.9,
-            },
-            {   name => '.sql',
-                meta => {
-                    is_file => 1,
-                    file    => { lc_ext => '.sql' }
-                },
-                config => {},
-                vote   => 0.8,
-            },
-            {   name => '.s',
-                meta => {
-                    is_file => 1,
-                    file    => { lc_ext => '.s' }
-                },
-                config => {},
-                vote   => 0.75,
-            },
-            {   name => 'config_suffix',
-                meta => {
-                    is_file => 1,
-                    file    => { lc_ext => '.foo' }
-                },
-                config => { pgTAP => { suffix => '.foo' } },
-                vote   => 1,
-            },
-            {   name => 'not_file',
-                meta => {
-                    is_file => 0,
-                },
-                vote => 0,
-            },
-        ],
-        make_iterator => [
-            {   name   => 'psql',
-                raw    => \$test,
-                config => { pgTAP => { psql => $psql } },
-                iclass => 'TAP::Parser::Iterator::Process',
-                output => [ @command, '--file', $test ],
-            },
-            {   name   => 'config',
-                raw    => $test,
-                config => {
-                    pgTAP => {
-                        psql     => $psql,
-                        username => 'who',
-                        host     => 'f',
-                        port     => 2,
-                        dbname   => 'fred',
-                    }
-                },
-                iclass => 'TAP::Parser::Iterator::Process',
-                output => [
-                    @command,
-                    qw(--username who --host f --port 2 --dbname fred --file),
-                    $test
-                ],
-            },
-            {   name   => 'error',
-                raw    => 'blah.pg',
-                iclass => 'TAP::Parser::Iterator::Process',
-                error  => qr/^No such file or directory: blah[.]pg/,
-            },
-            {   name   => 'undef error',
-                raw    => undef,
-                iclass => 'TAP::Parser::Iterator::Process',
-                error  => qr/^No such file or directory: /,
-            },
-        ],
-    };
-
-    test_handler( $class, $tests );
-}
-
-exit;
-
 ###############################################################################
 # helper sub
 
@@ -451,6 +358,7 @@ sub test_handler {
 
             my $source = TAP::Parser::Source->new;
             $source->raw( $test->{raw} )       if $test->{raw};
+            $source->test_args( $test->{test_args} ) if $test->{test_args};
             $source->meta( $test->{meta} )     if $test->{meta};
             $source->config( $test->{config} ) if $test->{config};
             $source->assemble_meta             if $test->{assemble_meta};
diff --git a/cpan/Test-Harness/t/source_tests/psql b/cpan/Test-Harness/t/source_tests/psql
deleted file mode 100644 (file)
index f32e6a7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/perl
-
-print $_, $/ for @ARGV;
index 8f43ddd..29daf61 100644 (file)
@@ -1,12 +1,10 @@
 @rem = '--*-Perl-*--
 @echo off
-if (%PERL_CORE%)==() set PERL_CORE=perl
-if not exist %PERL_CORE% set PERL_CORE=perl
 if "%OS%" == "Windows_NT" goto WinNT
-%PERL_CORE% -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
+perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
 goto endofperl
 :WinNT
-%PERL_CORE% -x -S %0 %*
+perl -x -S %0 %*
 if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
 if %errorlevel% == 9009 echo You do not have Perl in your PATH.
 if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
diff --git a/cpan/Test-Harness/t/source_tests/source_args.sh b/cpan/Test-Harness/t/source_tests/source_args.sh
new file mode 100755 (executable)
index 0000000..c75f787
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "1..1"
+echo "ok 1 - source_args.sh $1"
index 1e80019..38afc46 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 # test T::H::_open_spool and _close_spool - these are good examples
index 668c24b..9d9f031 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
index e49ecd8..fe0b944 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-  unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 use strict;
index a535983..c6f5483 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 BEGIN {
-        unshift @INC, 't/lib';
+    unshift @INC, 't/lib';
 }
 
 # Test that options in PERL5OPT are propogated to tainted tests
@@ -37,7 +37,8 @@ sub run_test_file {
 }
 
 {
-    local $ENV{PERL5OPT} = $ENV{PERL_CORE} ? '-I../../lib -Mstrict' : '-Mstrict';
+    local $ENV{PERL5OPT}
+      = $ENV{PERL_CORE} ? '-I../../lib -Mstrict' : '-Mstrict';
     run_test_file(<<'END');
 #!/usr/bin/perl -T
 
index 5e9cc5c..cfbdd58 100644 (file)
@@ -3,39 +3,65 @@
 use strict;
 use lib 't/lib';
 
-use Test::More tests => 21;
+use Test::More;
 use File::Spec;
 use TAP::Parser;
 use TAP::Harness;
 use App::Prove;
 
+diag( "\n\n", bigness( join ' ', @ARGV ), "\n\n" ) if @ARGV;
+
+my @cleanup = ();
+END { unlink @cleanup }
+
 my $test = File::Spec->catfile(
     't',
     'sample-tests',
     'echo'
 );
 
-diag( "\n\n", bigness( join ' ', @ARGV ), "\n\n" ) if @ARGV;
+my @test = ( [ perl => $test ], make_shell_test($test) );
+
+plan tests => @test * 8 + 5;
 
 sub echo_ok {
-    my $options = shift;
-    my @args    = @_;
-    my $parser  = TAP::Parser->new( { %$options, test_args => \@args } );
-    my @got     = ();
+    my ( $type, $options ) = ( shift, shift );
+    my $name   = join( ', ', sort keys %$options ) . ", $type";
+    my @args   = @_;
+    my $parser = TAP::Parser->new( { %$options, test_args => \@args } );
+    my @got    = ();
     while ( my $result = $parser->next ) {
         push @got, $result;
     }
     my $plan = shift @got;
-    ok $plan->is_plan;
-    for (@got) {
-        is $_->description, shift(@args),
-          join( ', ', keys %$options ) . ": option passed OK";
+    ok $plan->is_plan, "$name: is_plan";
+    is_deeply [ map { $_->description } @got ], [@args],
+      "$name: option passed OK";
+}
+
+for my $t (@test) {
+    my ( $type, $test ) = @$t;
+    for my $args ( [qw( yes no maybe )], [qw( 1 2 3 )] ) {
+        echo_ok( $type, { source => $test }, @$args );
+        echo_ok( $type, { exec => [ $^X, $test ] }, @$args );
     }
 }
 
-for my $args ( [qw( yes no maybe )], [qw( 1 2 3 )] ) {
-    echo_ok( { source => $test }, @$args );
-    echo_ok( { exec => [ $^X, $test ] }, @$args );
+sub make_shell_test {
+    my $test  = shift;
+    my $shell = '/bin/sh';
+    return unless -x $shell;
+    my $script = "shell_$$.sh";
+
+    push @cleanup, $script;
+    {
+        open my $sh, '>', $script;
+        print $sh "#!$shell\n\n";
+        print $sh "$^X '$test' \$*\n";
+    }
+    chmod 0777, $script;
+    return unless -x $script;
+    return [ shell => $script ];
 }
 
 {