Plack-Test-AnyEvent-0.08000755001750001750 013133735773 13702 5ustar00robrob000000000000README100644001750001750 60713133735773 14626 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08 This archive contains the distribution Plack-Test-AnyEvent, version 0.08: Run Plack::Test on AnyEvent-based PSGI applications This software is copyright (c) 2017 by Rob Hoelz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.009. Changes100644001750001750 126413133735773 15261 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08Revision history for Plack-Test-AnyEvent 0.08 July 19 2017 Fix GH #3 - streaming apps hang on Windows (thanks to Alexandr Ciornii for reporting, and Paul Cochrane for helping me work on Windows) 0.07 July 03 2017 Fix some dist issues (thanks, Paul Cochrane!) 0.06 January 26 2015 Fix an issue with PSGI conformance (thanks, Daisuke Maki!) 0.05 October 20 2013 Allow on_content_received to work for non-streaming responses. Maki-Daisuke++ 0.04 May 23 2013 Fix broken test. 0.03 August 31 2011 Fix to work with AnyEvent 6. 0.02 August 16 2011 Added support for uncaught exceptions being thrown in applications. 0.01 June 20 2011 Initial release. LICENSE100644001750001750 4364413133735773 15023 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08This software is copyright (c) 2017 by Rob Hoelz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2017 by Rob Hoelz. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2017 by Rob Hoelz. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End META.yml100644001750001750 223013133735773 15231 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08--- abstract: 'Run Plack::Test on AnyEvent-based PSGI applications' author: - 'Rob Hoelz ' build_requires: File::Spec: '0' HTTP::Request::Common: '0' IO::Handle: '0' IPC::Open3: '0' Module::Build: '0.28' Test::Class: '0' Test::More: '0' parent: '0' configure_requires: Module::Build: '0.28' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Plack-Test-AnyEvent no_index: package: - Plack::Test::AE - Plack::Test::AnyEvent::Response provides: Plack::Test::AnyEvent: file: lib/Plack/Test/AnyEvent.pm version: '0.08' requires: AnyEvent: '0' Carp: '0' HTTP::Message::PSGI: '0' HTTP::Request: '0' IO::Handle: '0' Plack: '0' autodie: '0' perl: v5.8.8 strict: '0' warnings: '0' resources: bugtracker: https://github.com/hoelzro/plack-test-anyevent/issues homepage: https://github.com/hoelzro/plack-test-anyevent repository: https://github.com/hoelzro/plack-test-anyevent.git version: '0.08' x_serialization_backend: 'YAML::Tiny version 1.70' Build.PL100644001750001750 273213133735773 15263 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08 # This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.009. use strict; use warnings; use Module::Build 0.28; my %module_build_args = ( "build_requires" => { "Module::Build" => "0.28" }, "configure_requires" => { "Module::Build" => "0.28" }, "dist_abstract" => "Run Plack::Test on AnyEvent-based PSGI applications", "dist_author" => [ "Rob Hoelz " ], "dist_name" => "Plack-Test-AnyEvent", "dist_version" => "0.08", "license" => "perl", "module_name" => "Plack::Test::AnyEvent", "recursive_test_files" => 1, "requires" => { "AnyEvent" => 0, "Carp" => 0, "HTTP::Message::PSGI" => 0, "HTTP::Request" => 0, "IO::Handle" => 0, "Plack" => 0, "autodie" => 0, "perl" => "v5.8.8", "strict" => 0, "warnings" => 0 }, "test_requires" => { "File::Spec" => 0, "HTTP::Request::Common" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Class" => 0, "Test::More" => 0, "parent" => 0 } ); my %fallback_build_requires = ( "File::Spec" => 0, "HTTP::Request::Common" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Module::Build" => "0.28", "Test::Class" => 0, "Test::More" => 0, "parent" => 0 ); unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); $build->create_build_script; MANIFEST100644001750001750 156413133735773 15122 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.009. Build.PL Changes LICENSE MANIFEST META.json META.yml README lib/Plack/Test/AE.pm lib/Plack/Test/AnyEvent.pm lib/Plack/Test/AnyEvent/Response.pm t/00-compile.t t/01-ae.t t/02-anyevent.t t/03-cocoa.t t/03-ev.t t/03-event.t t/03-glib.t t/03-perl.t t/04-non-streaming-response-callback.t t/lib/Plack/Test/AnyEvent/Test.pm xt/author/critic.t xt/author/pod-coverage.t xt/author/pod-syntax.t xt/release/dist-manifest.t xt/release/kwalitee.t xt/release/localbrew-pristine-5.10.t xt/release/localbrew-pristine-5.12.t xt/release/localbrew-pristine-5.14.t xt/release/localbrew-pristine-5.16.t xt/release/localbrew-pristine-5.18.t xt/release/localbrew-pristine-5.20.t xt/release/localbrew-pristine-5.22.t xt/release/localbrew-pristine-5.24.t xt/release/localbrew-pristine-5.26.t xt/release/localbrew-pristine-5.8.t t000755001750001750 013133735773 14066 5ustar00robrob000000000000Plack-Test-AnyEvent-0.0801-ae.t100644001750001750 25213133735773 15175 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; sub impl_name { return 'AE'; } __PACKAGE__->runtests; 03-ev.t100644001750001750 45113133735773 15225 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; use Test::More; sub impl_name { return 'AnyEvent'; } eval { require EV; }; if($@) { plan skip_all => "You need EV to run this test"; } else { __PACKAGE__->runtests; } META.json100644001750001750 446613133735773 15416 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08{ "abstract" : "Run Plack::Test on AnyEvent-based PSGI applications", "author" : [ "Rob Hoelz " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.009, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Plack-Test-AnyEvent", "no_index" : { "package" : [ "Plack::Test::AE", "Plack::Test::AnyEvent::Response" ] }, "prereqs" : { "build" : { "requires" : { "Module::Build" : "0.28" } }, "configure" : { "requires" : { "Module::Build" : "0.28" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Kwalitee" : "1.21", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "requires" : { "AnyEvent" : "0", "Carp" : "0", "HTTP::Message::PSGI" : "0", "HTTP::Request" : "0", "IO::Handle" : "0", "Plack" : "0", "autodie" : "0", "perl" : "v5.8.8", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "HTTP::Request::Common" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Class" : "0", "Test::More" : "0", "parent" : "0" } } }, "provides" : { "Plack::Test::AnyEvent" : { "file" : "lib/Plack/Test/AnyEvent.pm", "version" : "0.08" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/hoelzro/plack-test-anyevent/issues" }, "homepage" : "https://github.com/hoelzro/plack-test-anyevent", "repository" : { "type" : "git", "url" : "https://github.com/hoelzro/plack-test-anyevent.git", "web" : "https://github.com/hoelzro/plack-test-anyevent" } }, "version" : "0.08", "x_serialization_backend" : "Cpanel::JSON::XS version 3.0233" } 03-glib.t100644001750001750 45413133735773 15533 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; use Test::More; sub impl_name { return 'AnyEvent'; } eval { require Glib; }; if($@) { plan skip_all => "You need Glib to run this test"; } else { __PACKAGE__->runtests; } 03-perl.t100644001750001750 31713133735773 15556 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; sub impl_name { return 'AnyEvent'; } require AnyEvent::Impl::Perl; __PACKAGE__->runtests; 03-cocoa.t100644001750001750 50413133735773 15676 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; use Test::More; sub impl_name { return 'AnyEvent'; } eval { require Cocoa::EventLoop; }; if($@) { plan skip_all => "You need Cocoa::EventLoop to run this test"; } else { __PACKAGE__->runtests; } 03-event.t100644001750001750 45613133735773 15741 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; use Test::More; sub impl_name { return 'AnyEvent'; } eval { require Event; }; if($@) { plan skip_all => "You need Event to run this test"; } else { __PACKAGE__->runtests; } 00-compile.t100644001750001750 274213133735773 16265 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.056 use Test::More; plan tests => 3 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Plack/Test/AE.pm', 'Plack/Test/AnyEvent.pm', 'Plack/Test/AnyEvent/Response.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; 02-anyevent.t100644001750001750 26013133735773 16441 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/tuse strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; use parent 'Plack::Test::AnyEvent::Test'; sub impl_name { return 'AnyEvent'; } __PACKAGE__->runtests; author000755001750001750 013133735773 15560 5ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xtcritic.t100644001750001750 20113133735773 17333 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/author#!perl use strict; use warnings; use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; all_critic_ok(); Test000755001750001750 013133735773 16342 5ustar00robrob000000000000Plack-Test-AnyEvent-0.08/lib/PlackAE.pm100644001750001750 35013133735773 17303 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/lib/Plack/Testpackage Plack::Test::AE; use strict; use warnings; BEGIN { require Plack::Test::AnyEvent; *test_psgi = \&Plack::Test::AnyEvent::test_psgi; } 1; =pod =begin comment =over =item test_psgi =back =end comment =cut release000755001750001750 013133735773 15676 5ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xtkwalitee.t100644001750001750 27513133735773 20014 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; pod-syntax.t100644001750001750 25213133735773 20172 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); pod-coverage.t100644001750001750 33413133735773 20440 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/author#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); AnyEvent.pm100644001750001750 2217613133735773 20621 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/lib/Plack/Test## no critic (RequireUseStrict) package Plack::Test::AnyEvent; $Plack::Test::AnyEvent::VERSION = '0.08'; ## use critic (RequireUseStrict) use strict; use warnings; use AnyEvent::Handle; use AnyEvent::Util qw (portable_pipe); use Carp; use HTTP::Request; use HTTP::Message::PSGI; use IO::Handle; use Plack::Test::AnyEvent::Response; # code adapted from Plack::Test::MockHTTP sub test_psgi { my ( %args ) = @_; my $client = delete $args{client} or croak "client test code needed"; my $app = delete $args{app} or croak "app needed"; my $cb = sub { my ( $req ) = @_; $req->uri->scheme('http') unless defined $req->uri->scheme; $req->uri->host('localhost') unless defined $req->uri->host; my $env = $req->to_psgi; $env->{'psgi.streaming'} = 1; $env->{'psgi.nonblocking'} = 1; my $res = $app->($env); if(ref($res) eq 'CODE') { my ( $status, $headers, $body ); my ( $read, $write ); my $cond = AnyEvent->condvar; $res->(sub { my ( $ref ) = @_; ( $status, $headers, $body ) = @$ref; $cond->send; unless(defined $body) { ( $read, $write ) = portable_pipe or die $!; $write = IO::Handle->new_from_fd($write, 'w'); $write->autoflush(1); return $write; } }); unless(defined $status) { local $SIG{__DIE__} = __PACKAGE__->exception_handler($cond); my $ex = $cond->recv; die $ex if defined $ex; } if(defined $body) { $res = Plack::Test::AnyEvent::Response->from_psgi([ $status, $headers, $body ]); $res->{'_cond'} = AnyEvent->condvar; $res->{'_cond'}->send; } else { push @$headers, 'Transfer-Encoding', 'chunked'; $res = Plack::Test::AnyEvent::Response->from_psgi([ $status, $headers, [] ]); my $h; $res->{'_cond'} = AnyEvent->condvar(cb => sub { undef $h; close $read; close $write; }); $res->on_content_received(sub {}); $h = AnyEvent::Handle->new( fh => $read, on_read => sub { my $buf = $h->rbuf; $h->rbuf = ''; $res->content($res->content . $buf); $res->on_content_received->($buf); }, on_eof => sub { $res->send; }, on_error => sub { my ( undef, undef, $msg ) = @_; warn $msg; $res->send; }, ); } } else { unless(ref($res) eq 'Plack::Test::AnyEvent::Response') { $res = Plack::Test::AnyEvent::Response->from_psgi($res); } my $cond = AnyEvent->condvar; $res->{'_cond'} = $cond; $res->on_content_received(sub {}); # make sure that the on_content_received callback is invoked inside # of the event loop my $faux_timer; $faux_timer = AnyEvent->timer( after => 0.001, cb => sub { undef $faux_timer; $res->on_content_received->($res->content); $cond->send; }, ); $res->request($req); } return $res; }; $client->($cb); } sub exception_handler { my ( $class, $cond ) = @_; return sub { my $i = 0; my @last_eval_frame; while(my @info = caller($i)) { my ( $subroutine, $evaltext ) = @info[3, 6]; if($subroutine eq '(eval)' && !defined($evaltext)) { @last_eval_frame = caller($i + 1); last; } } continue { $i++; } if(@last_eval_frame) { my ( $subroutine ) = $last_eval_frame[3]; if($subroutine =~ /^AnyEvent::Impl|AnyEvent::CondVar::Base/) { $cond->send($_[0]); } } }; } 1; =pod =encoding UTF-8 =head1 NAME Plack::Test::AnyEvent - Run Plack::Test on AnyEvent-based PSGI applications =head1 VERSION version 0.08 =head1 SYNOPSIS use HTTP::Request::Common; use Plack::Test; $Plack::Test::Impl = 'AnyEvent'; # or 'AE' for short test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/streaming-response'); is $res->header('Transfer-Encoding'), 'chunked'; $res->on_content_received(sub { my ( $content ) = @_; # test chunk of streaming response }); $res->recv; } =head1 DESCRIPTION This L implementation allows you to easily test your L-based PSGI applications. Normally, L or L work fine for this, but this implementation comes in handy when you'd like to test your streaming results as they come in, or if your application uses long-polling. For non-streaming requests, you can use this module exactly like Plack::Test::MockHTTP; otherwise, you can set up a content handler and call C<$res-Erecv>. The event loop will then run until the PSGI application closes its writer handle or until your test client calls C on the response. =head1 FUNCTIONS =head2 test_psgi This function behaves almost identically to L; the main difference is that the returned response object supports a few additional methods on top of those normally found in an L object: =head3 $res->recv Calls C on an internal AnyEvent condition variable. Use this after you get the response object to run the event loop. =head3 $res->send Calls C on an internal AnyEvent condition variable. Use this to stop the event loop when you're done testing. =head3 $res->on_content_received($cb) Sets a callback to be called when a chunk is received from the application. A single argument is passed to the callback; namely, the chunk itself. =head1 EXCEPTION HANDLING As of version 0.02, this module handles uncaught exceptions thrown by your code. If the exception occurs before your PSGI application returns a response, or directly in the response subroutine ref (if you return a subroutine as your application's response), C<$cb> will propagate the exception. Otherwise, the exception is propagated by C<$res-Erecv>. Here's an example: my $app = sub { die 'thrown by $cb'; return sub { my ( $respond ) = @_; die 'still thrown by $cb'; if($streaming) { my $writer = $respond->([ 200, ['Content-Type' => 'text/plain'], ]); die 'still thrown by $cb'; my $timer; $timer = AnyEvent->timer( after => 2, cb => sub { die 'thrown by $res->recv'; $writer->write("Ok"); $writer->close; undef $timer; }, ); } else { $respond->([ 200, ['Content-Type' => 'text/plain'], ['Ok'], ]); die 'still thrown by $cb'; } }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); $res->on_content_received(sub { ... }); $res->recv; }; Note: The exception handling code may or may not work with your event loop. Please run the tests in this distribution with L set to see if it works with your event loop of choice. Patches will be accepted to accommodate loops, as long as it doesn't break known good ones. The known good event loops are: =over =item Default =item Cocoa =item EV =item Event =item Glib =item Perl =back This list isn't exclusive; ie. just because your event loop isn't on this list doesn't mean it doesn't work. Also, even if your event loop doesn't pass the exception tests, the general usage of this module (testing requests, handling streaming results and long polling) should work on any AnyEvent loop. Just don't throw any uncaught exceptions =). =head1 SEE ALSO L, L, L =begin comment =over =item exception_handler =back =end comment =head1 AUTHOR Rob Hoelz =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2017 by Rob Hoelz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =cut __END__ # ABSTRACT: Run Plack::Test on AnyEvent-based PSGI applications dist-manifest.t100644001750001750 23013133735773 20745 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); AnyEvent000755001750001750 013133735773 20336 5ustar00robrob000000000000Plack-Test-AnyEvent-0.08/t/lib/Plack/TestTest.pm100644001750001750 3136513133735773 22003 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/t/lib/Plack/Test/AnyEventpackage Plack::Test::AnyEvent::Test; use strict; use warnings; use parent 'Test::Class'; use AnyEvent; use HTTP::Request::Common; use Test::Exception; use Test::More; use Plack::Test; sub startup :Test(startup) { my ( $self ) = @_; $Plack::Test::Impl = $self->impl_name; my $timer = AnyEvent->timer( after => 1, cb => sub {}, ); # just get the ball rolling diag "Running on $AnyEvent::MODEL"; do { no warnings 'once'; ## no critic (TestingAndDebugging::ProhibitNoWarnings) $EV::DIED = sub { unless($@ =~ /bad apple/) { warn $@; } }; $Event::DIED = sub { my ( undef, $error ) = @_; unless($error =~ /bad apple/ || $error eq '?') { warn $error; } }; eval { Glib->install_exception_handler(sub { my ( $error ) = @_; unless($error =~ /bad apple/) { warn $error; } return 1; })}; }; } sub test_simple_app :Test(3) { my $app = sub { return [ 200, ['Content-Type' => 'text/plain'], ['OK'], ]; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; is $res->content_type, 'text/plain'; is $res->content, 'OK'; }; } sub test_delayed_app :Test(3) { my $app = sub { return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 1, cb => sub { undef $timer; $respond->([ 200, ['Content-Type' => 'text/plain'], ['OK'], ]); }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; is $res->content_type, 'text/plain'; is $res->content, 'OK'; }; } sub test_streaming_app :Test(6) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $writer = $respond->([ 200, ['Content-Type' => 'text/plain'], ]); my $timer; my $i = 0; $timer = AnyEvent->timer( interval => 1, cb => sub { $writer->write($i++); if($i > 2) { $writer->close; undef $timer; } }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; is $res->content_type, 'text/plain'; is $res->content, ''; my $i = 0; $res->on_content_received(sub { my ( $chunk ) = @_; is $chunk, $i++; }); $res->recv; }; } sub test_infinite_app :Test(6) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $writer = $respond->([ 200, ['Content-Type' => 'text/plain'], ]); my $timer; my $i = 0; $timer = AnyEvent->timer( interval => 1, cb => sub { local $SIG{__WARN__} = sub {}; # $writer complains if its # been closed, and # rightfully so. We just # don't want trouble during # testing. $writer->write($i++); ( undef ) = $timer; # keep a reference to $timer }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; is $res->content_type, 'text/plain'; is $res->content, ''; my $i = 0; $res->on_content_received(sub { my ( $chunk ) = @_; is $chunk, $i++; if($i > 2) { $res->send; } }); $res->recv; }; } sub test_bad_app :Test(1) { my $app = sub { die "bad apple"; }; test_psgi $app, sub { my ( $cb ) = @_; throws_ok { $cb->(GET '/'); } qr/bad apple/; }; } sub test_responsible_app :Test { my $app = sub { eval { die "good apple"; }; return [ 200, ['Content-Type' => 'text/plain'], ['All Alright'], ]; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; }; } sub test_bad_delayed_app :Test { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 0.5, cb => sub { undef $timer; die "bad apple"; }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; throws_ok { my $res = $cb->(GET '/'); } qr/bad apple/; }; } sub test_responsible_delayed_app :Test { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 0.5, cb => sub { undef $timer; eval { die "bad apple"; }; $respond->([ 200, ['Content-Type' => 'text/plain'], ['All Alright'], ]); }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; }; } sub test_bad_app_die_post_response :Test(2) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 0.5, cb => sub { undef $timer; $respond->([ 200, ['Content-Type' => 'text/plain'], 'Hey!', ]); die "bad apple"; }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; throws_ok { $cb->(GET '/'); } qr/bad apple/; }; } sub test_responsible_app_die_post_response :Test(2) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 0.5, cb => sub { undef $timer; $respond->([ 200, ['Content-Type' => 'text/plain'], ['Hey!'], ]); eval { die "bad apple"; }; }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; like $res->content, qr/Hey!/; }; } sub test_bad_app_die_in_response :Test(2) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; die "bad apple"; }; }; test_psgi $app, sub { my ( $cb ) = @_; throws_ok { $cb->(GET '/'); } qr/bad apple/; }; } sub test_responsible_app_die_in_response :Test(2) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; eval { die "bad apple"; }; $respond->([ 200, ['Content-Type' => 'text/plain'], ['All Alright'], ]); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; like $res->content, qr/All Alright/; }; } sub test_bad_app_streaming :Test(2) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 0.5, cb => sub { my $writer = $respond->([ 200, ['Content-Type' => 'text/plain'], ]); $timer = AnyEvent->timer( after => 0.5, cb => sub { undef $timer; die "bad apple"; }, ); }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); my $timer = AnyEvent->timer( after => 5, cb => sub { $res->send; # self-inflicted timeout }, ); is $res->code, 200; $res->on_content_received(sub { # no-op }); throws_ok { $res->recv; } qr/bad apple/; }; } sub test_responsible_app_streaming :Test(2) { my $app = sub { my ( $env ) = @_; return sub { my ( $respond ) = @_; my $timer; $timer = AnyEvent->timer( after => 0.5, cb => sub { my $writer = $respond->([ 200, ['Content-Type' => 'text/plain'], ]); $timer = AnyEvent->timer( after => 0.5, cb => sub { eval { die "bad apple"; }; $writer->write('All Alright'); $writer->close; undef $timer; }, ); }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); is $res->code, 200; $res->on_content_received(sub { # no-op }); lives_ok { $res->recv; }; }; } sub test_infinite_request_shutdown :Test { my $app = sub { return sub { my ( $respond ) = @_; my $writer = $respond->([ 200, ['Content-Type' => 'text/plain'], ]); my $timer; my $count = 0; $timer = AnyEvent->timer( interval => 0.1, cb => sub { $writer->write($count++); ( undef ) = ( $timer ); ## keep a reference to $timer around }, ); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); my $expecting_call = 1; my $seen_bad_call; $res->on_content_received(sub { my ( $chunk ) = @_; unless($expecting_call) { $seen_bad_call = 1; } if($chunk >= 5) { $res->send; } }); $res->recv; $expecting_call = 0; my $res2 = $cb->(GET '/'); $res2->on_content_received(sub { my ( $chunk ) = @_; if($chunk >= 5) { $res2->send; } }); $res2->recv; ok !$seen_bad_call, "Don't want to see a callback after I've finished testing it"; }; } sub test_three_element_delayed_response :Test(3) { my $app = sub { return sub { my ( $respond ) = @_; $respond->([ 200, [ 'Content-Type' => 'text/plain' ], ['OK'] ]); }; }; test_psgi $app, sub { my ( $cb ) = @_; my $res = $cb->(GET '/'); $res->on_content_received(sub{ is $res->code, 200, 'Status code should match'; is $res->content_type, 'text/plain', 'Content-Type header should match'; is $res->content, 'OK', 'Content should match'; }); $res->recv; }; } 1; AnyEvent000755001750001750 013133735773 20073 5ustar00robrob000000000000Plack-Test-AnyEvent-0.08/lib/Plack/TestResponse.pm100644001750001750 157313133735773 22375 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/lib/Plack/Test/AnyEventpackage Plack::Test::AnyEvent::Response; use strict; use warnings; use parent 'HTTP::Response'; sub from_psgi { my $class = shift; my $self = HTTP::Response::from_psgi($class, @_); bless $self, $class; return $self; } sub send { my ( $self, @values ) = @_; $self->{'_cond'}->send(@values); } sub recv { my ( $self ) = @_; my $cond = $self->{'_cond'}; local $SIG{__DIE__} = Plack::Test::AnyEvent->exception_handler($cond); my $ex = $cond->recv; if($ex) { die $ex; } } sub on_content_received { my ( $self, $cb ) = @_; if($cb) { $self->{'_on_content_received'} = $cb; $cb->($self->content) if $self->{_cond}->ready; } return $self->{'_on_content_received'}; } 1; =pod =begin comment =over =item from_psgi =item send =item recv =item on_content_received =back =end comment =cut localbrew-pristine-5.8.t100644001750001750 614613133735773 22347 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.8]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.10.t100644001750001750 614713133735773 22421 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.10]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.12.t100644001750001750 614713133735773 22423 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.12]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.14.t100644001750001750 614713133735773 22425 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.14]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.16.t100644001750001750 614713133735773 22427 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.16]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.18.t100644001750001750 614713133735773 22431 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.18]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.20.t100644001750001750 614713133735773 22422 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.20]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.22.t100644001750001750 614713133735773 22424 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.22]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.24.t100644001750001750 614713133735773 22426 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.24]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } localbrew-pristine-5.26.t100644001750001750 614713133735773 22430 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/xt/release#!perl use strict; use warnings; use FindBin; use File::Copy qw(copy); use File::Spec; use File::Temp; use Test::More; sub copy_log_file { my ( $home ) = @_; my $log_file = File::Spec->catfile($home, '.cpanm', 'build.log'); my $tempfile = File::Temp->new( SUFFIX => '.log', UNLINK => 0, ); copy($log_file, $tempfile->filename); diag("For details, please consult $tempfile") } sub is_dist_root { my ( @path ) = @_; return -e File::Spec->catfile(@path, 'Makefile.PL') || -e File::Spec->catfile(@path, 'Build.PL'); } delete @ENV{qw/AUTHOR_TESTING RELEASE_TESTING PERL5LIB/}; unless($ENV{'PERLBREW_ROOT'}) { plan skip_all => "Environment variable 'PERLBREW_ROOT' not found"; exit; } my $brew = q[pristine-5.26]; my $cpanm_path = qx(which cpanm 2>/dev/null); unless($cpanm_path) { plan skip_all => "The 'cpanm' program is required to run this test"; exit; } chomp $cpanm_path; my $perlbrew_bin = File::Spec->catdir($ENV{'PERLBREW_ROOT'}, 'perls', $brew, 'bin'); my $perlbrew_path = $ENV{'PATH'}; if(my $local_lib_root = $ENV{'PERL_LOCAL_LIB_ROOT'}) { my @path = File::Spec->path; while(@path && $path[0] =~ /^$local_lib_root/) { shift @path; } if($^O eq 'MSWin32') { $perlbrew_path = join(';', @path); } else { $perlbrew_path = join(':', @path); } } my ( $env, $status ) = do { local $ENV{'PATH'} = $perlbrew_path; local $ENV{'SHELL'} = '/bin/bash'; # fool perlbrew ( scalar(qx(perlbrew env $brew)), $? ) }; unless($status == 0) { plan skip_all => "No such perlbrew environment '$brew'"; exit; } my @lines = split /\n/, $env; foreach my $line (@lines) { if($line =~ /^\s*export\s+([0-9a-zA-Z_]+)=(.*)$/) { my ( $k, $v ) = ( $1, $2 ); if($v =~ /^("|')(.*)\1$/) { $v = $2; $v =~ s!\\(.)!$1!ge; } $ENV{$k} = $v; } elsif($line =~ /^unset\s+([0-9a-zA-Z_]+)/) { delete $ENV{$1}; } } my $pristine_path = do { local $ENV{'PATH'} = $perlbrew_path; qx(perlbrew display-pristine-path); }; chomp $pristine_path; $ENV{'PATH'} = join(':', $ENV{'PERLBREW_PATH'}, $pristine_path); plan tests => 1; my $tmpdir = File::Temp->newdir; my $tmphome = File::Temp->newdir; my $pid = fork; if(!defined $pid) { fail "Forking failed!"; exit 1; } elsif($pid) { waitpid $pid, 0; ok !$?, "cpanm should successfully install your dist with no issues" or copy_log_file($tmphome->dirname); } else { open STDIN, '<', File::Spec->devnull; open STDOUT, '>', File::Spec->devnull; open STDERR, '>', File::Spec->devnull; my @path = File::Spec->splitdir($FindBin::Bin); while(@path && !is_dist_root(@path)) { pop @path; } unless(@path) { die "Unable to find dist root\n"; } chdir File::Spec->catdir(@path); # exit test directory # override where cpanm puts its log file $ENV{'HOME'} = $tmphome->dirname; # We use system here instead of exec so that $tmpdir gets cleaned up # after cpanm finishes system 'perl', $cpanm_path, '-L', $tmpdir->dirname, '.'; exit($? >> 8); } 04-non-streaming-response-callback.t100644001750001750 240213133735773 23001 0ustar00robrob000000000000Plack-Test-AnyEvent-0.08/t#!/usr/bin/env perl use strict; use Test::More tests => 5; use Plack::Test; $Plack::Test::Impl = 'AnyEvent'; use AnyEvent; use HTTP::Request::Common; my $app = sub { my ( $env ) = @_; if($env->{QUERY_STRING} =~ /non-blocking/) { return sub { my ( $respond ) = @_; my $writer = $respond->([200, ['Content-Type' => 'text/plain']]); my $timer; $timer = AnyEvent->timer( after => 1, cb => sub { undef $timer; $writer->write("ok"); $writer->close; }, ); }; } else { return [200, ['Content-Type' => 'text/plain'], ['ok']]; } }; test_psgi $app, sub { my ( $cb ) = @_; my $num_callbacks_invoked = 0; my $res = $cb->(GET '/?non-blocking'); is $res->code, 200; $res->on_content_received(sub { $num_callbacks_invoked++; is $res->content, 'ok'; }); $res->recv; my $res = $cb->(GET '/'); is $res->code, 200; $res->on_content_received(sub{ $num_callbacks_invoked++; is $res->content, 'ok'; }); $res->recv; is $num_callbacks_invoked, 2, 'make sure that both callbacks have been invoked'; };