Test-Reporter-1.62/000755 000765 000024 00000000000 12510527023 014410 5ustar00davidstaff000000 000000 Test-Reporter-1.62/Changes000644 000765 000024 00000027312 12510527023 015710 0ustar00davidstaff000000 000000 Revision history for Perl extension Test::Reporter. For the complete changelog, visit: http://github.com/dagolden/test-reporter/commits/master 1.62 2015-04-06 12:02:21-04:00 America/New_York - no changes from 1.61-TRIAL 1.61 2015-03-30 10:13:06-04:00 America/New_York (TRIAL RELEASE) [FIXED} - protect whitespace in perl path from shell 1.60 2013-11-04 13:49:54 America/New_York [FIXED] - read() now fixes up the architecture name - fixed documentation example for transport arguments involving File transport 1.59 2013-06-05 23:10:30 America/New_York [FIXED] - Fixed bug in finding right perl for -V output [rt.cpan.org #85823] 1.58 2011-07-19 12:07:53 America/New_York - Deprecates email-transport related attributes and methods - Adds new 'Null' transport as default - Removes legacy transport classes (See Test::Reporter::Transport::Legacy if needed) - Removes 'cpantest' command line program 1.57 2010-03-26 00:13:18 EST5EDT - Includes full 'perl -V' output, not just Config::mychanges - Adds new 'X-Test-Reporter-Perl' header with Perl version and optional "RCx" suffix to positively identify tests from RC Perls - Minimum perl version is now 5.006, matching the rest of the Perl toolchain 1.56 2010-03-14 23:26:00 EST5EDT - Convert line endings during read() [Issue identified by Serguei Trouchelle] 1.55 2010-03-12 11:44:05 EST5EDT - Preserve distfile through write() and read() [patch by Dan Collins] - Regenerate _myconfig data during read() method - Switched to Dist::Zilla for release management 1.54 Sun May 31 21:39:12 EDT 2009 - POD updates. - Update Module::Install to 0.91. 1.53_03 Thu Apr 16 12:30:49 EDT 2009 - Transmit report body line-by-line with Net::SMTP (or Net::SMTP::TLS). 1.53_02 Wed Apr 15 13:30:53 EDT 2009 - With Net::SMTP transport, if lines are longer than 100 characters, the email will be encoded with quoted-printable. 1.53_01 Tue Apr 7 11:01:37 EDT 2009 - Added optional 'distfile' argument to support T::R::Transport::Metabase. - Reports link to the wiki rather than www.cpantesters.org; also added cpan-testers-discuss as place to send Q's. - Improved diagnostic output if editor fails to launch. - Changed Makefile.Pl to Module::Install. 1.5203 Tue Jan 20 15:25:07 EST 2009 - Updates CPAN Testers urls to www.cpantesters.org (David Westbrook). 1.5202 Mon Nov 3 11:48:44 EST 2008 - Fixed bug in Mail::Send transport (GoogleCode issue 19; patch by Moshe Kamensky). 1.5201 Tue Sep 23 11:18:34 EDT 2008 - All tests now use Test::More (not Test) for better diagnostics. - Removed unused signature test. 1.52 Mon Sep 8 11:45:12 EDT 2008 - Fixed extraneous-newlines bug in reading reports saved to a file (Sleven Rezick). 1.51_02 Sun Sep 7 23:24:47 EDT 2008 - Cache mail domain; shorten mail domain timeout; add 'smtp' as a hostname to check (KANE). 1.51_01 Sat Sep 6 14:34:13 EDT 2008 - Avoid exclusive lock on tempfile for editing report (Slaven Rezick). 1.50 Sat Sep 6 14:04:22 EDT 2008 - Deprecated sending reports to anywhere other than the cpan-testers mailing list. This means that authors will no longer be copied on report emails by individual testers. (CPAN Testers is switching to an opt-in philosophy with central author notifications). - Doc fix on usage of read() in Test::Reporter::Transport::File. 1.4002 Wed Jun 25 17:21:10 EDT 2008 - Fixed bug in error handling when using TLS transport. 1.4001 Wed May 21 12:34:28 EDT 2008 - Fixed bug where send() would crash when no explicit transport was set. 1.40 Sun May 18 14:54:46 EDT 2008 - No change from 1.39_06. 1.39_06 Thu Apr 17 06:15:45 EDT 2008 - Fixed bug setting transport_args in constructor. 1.39_05 Wed Apr 9 12:43:55 EDT 2008 - Removed use of File::Temp->newdir() for backwards compatibility with older versions of File::Temp. 1.39_04 Mon Apr 7 17:25:35 EDT 2008 - Added Test::Reporter::Transport::File subclass. 1.39_03 Mon Apr 7 10:00:00 EDT 2008 - Added documentation for transport. 1.39_02 Sun Apr 6 14:40:00 EDT 2008 - Refactored transport into Test::Reporter::Transport subclasses. 1.39_01 Sun Apr 6 01:16:10 EDT 2008 - Whoops! Devel versions are supposed to be odd. - t/2-http-transport.t left out of MANIFEST. - Copyright notice updates. 1.38_01 Sat Apr 5 18:00:00 EDT 2008 - Add support for 'HTTP' transport to a Test::Reporter::HTTPGateway server. 1.38 Tue Oct 09 21:00:00 EDT 2007 - Additional compatibility improvements for VMS. Many thanks to Peter (Stig) Edwards! 1.36 Mon Oct 08 21:00:00 EDT 2007 - Compat for perl-5.005_05 per David Golden and Slaven Rezic. - Per 29690@RT cleaning up cpantest's -dump output (thanks janus!). - Per 9@Google compat fixes for VMS courtesy of Peter (Stig) Edwards. 1.34 Sun Aug 12 23:00:00 EDT 2007 - It is now possible to override the automatic selection of a transport by making use of the transport() method (per WYANT and ANDK). - A dozen new tests added to support transport(). - Internal debugging improvements. - Various documentation improvements. - Removing subversion artifacts; This project is now under git control. 1.32 Sun Jul 29 06:30:00 EDT 2007 - Fixed an issue (8@Google) whereby test reports had Date headers that were not RFC-822 complaint (reported by Serguei Trouchelle). 1.30 Wed Jul 18 04:50:00 EDT 2007 - Public release of all activity against 1.29_0* (see below). - Additionally, updated some documentation and added more tests. 1.29_04 Wed Jun 27 13:20:00 CDT 2007 - Added t/0-signature.t to test the SIGNATURE. - Renamed t/reporter.t to t/1-reporter.t. - Adjusted Makefile.PL to support dist-time signing. 1.29_03 Wed Jun 27 02:30:00 CDT 2007 - We now explicitly specify the license (same terms as perl itself) in the Makefile.PL, which eventually makes it into the auto-generated META.yml. 1.29_02 Tue Jun 26 16:00:00 CDT 2007 - Fixed a portability bug in t/reporter.t. Reported by David Golden. See 6@Google for more information. 1.29_01 Tue Jun 26 01:30:00 CDT 2007 - Switched from RT to Google Code for defect and enhancement tracking. Please visit: http://code.google.com/p/test-reporter/ - warnings enabled for Reporter.pm. - TODO file removed; moved to POD. - MacPerl (i.e., pre OS X) support dropped for Test::Reporter. - MacPerl (i.e., pre OS X) support dropped for cpantest. - Incorporated suggestion from MIROD; add documentation to describe what a package should look like (14376). - Incorporated patch from SAPER; compatibility for write() under 5.004 (14148). - Incorporated suggestion from CLACO; updated MX for perl.org (11370). - Incorporated suggestion from an anonymous individual: when an MX connection failure occurs, show the failing MX server, if debugging is on (14626). - Changes indentation style of code from tabs to spaces. - Added Id and HeadURL subversion tokens. - Removed dependencies on Date::Format and Time::Zone. - Unbundled Mail::Util; Now integrated into Reporter.pm. - Incorporated patch from MIROD; support for reporting tests on non-standard versions of perl (14375). - Added more tests to the T::R test suite (more than doubled quantity). - We now refuse to report results against perl itself; use perlbug. - Added Message-IDs to emails sent via SMTP per tom at eborcom dot com. 1.27 Mon Jan 17 15:51:00 EDT 2005 - Don't try to use Mail::Send on Windows. 1.26 Thu Dec 30 19:03:00 EDT 2004 - Add support for a user-specified suffix in edit_comments(). - Add a suffix of '.txt' to the tempfile when editing comments. - Update changes. 1.25 Thu Dec 30 19:02:00 EDT 2004 - Reintegrate Reporter.pod into Reporter.pm. 1.24 Thu Dec 30 19:02:00 EDT 2004 - Correct MAN3EXT in Makefile.PL for Reporter.pod. 1.23 Sun Dec 26 10:17:00 EDT 2004 - Add cpantest -from and -dump. - Update T:R->write() to accept a second argument, filehandle object. - ucfirst'd globals that were lowercase. - Fix pod man3 extension. - Make tests autodetect release version. 1.22 Sun Dec 26 09:23:00 EDT 2004 - Restructured mx, recipient filter logic. - Remove commented $VERSION to fix mlc 0.06 (cpanplus <= 0.050_04). 1.21 Sun Dec 26 07:57:00 EDT 2004 - Fixed local hostname logic to skip /\.local$/ domains under OS X. 1.20 Wed Mar 5 04:03:07 EDT 2003 - Fixed a minor bug with read(). 1.19 Wed Mar 5 03:03:07 EDT 2003 - Added dir() -- specifies default directory to write report files to. - Added write() -- writes a test report to disk. - Added read() -- reads a test report from disk. - These three methods are used in situations where you test on a machine that has port 25 blocked and there is no local MTA. You use write() on the machine that you are testing from, and use read() on the machine that you want to actually submit the reports from. 1.16 Tue Feb 25 04:00:00 EDT 2003 - Abstract now matches PAUSE meta-data for this distribution. - Better POD documentation. - Header pass-through for X-Reported-Via, via via(). This is useful for third-party distributions, like CPANPLUS, that use Test::Reporter. - Added 'debug' get/set method -- this is extremely verbose and primarily of use for debugging Test::Reporter itself. - Added 'address' get/set method -- specifies the e-mail address that the reports should be sent to -- you shouldn't need this unless the CPAN Tester's change the e-mail address to send report's to. - Added 'from' get/set method -- specifies the e-mail address of the individual doing the reporting -- you generally shouldn't need this as Test::Reporter tries very hard to guess your e-mail address automatically. - Added 'mx' get/set method -- specifies the MX's for perl.org -- you really shouldn't need to use this unless the hardcoded MX's have become wrong and you don't have Net::DNS installed. - The constructor now takes named parameters. - We now use Net::DNS to get MX's if Net::DNS is available. - We now use Net::Domain to better auto-guess the reporter's email address. - We now use Mail::Send to send reports, if it's available. - Now cycles through all available MX servers, when using Net::SMTP. - Added bin/cpantest. - T::R now allows testers to edit the report interactively via the edit_comments() method. - T::R report's have been made less susceptible to being marked as spam. - "can't call method "mail" on an undefined value" bug fixed. - Doubled the number of tests. - Memoized certain methods. - Bundling Date::Format and Time::Zone to assist in SMTP sends (for 'Date'). - Bundling an updated Mail::Util. 1.13 Sun Aug 12 03:20:08 EDT 2002 - Initial beta release. Test-Reporter-1.62/CONTRIBUTING.mkdn000644 000765 000024 00000005751 12510527023 017202 0ustar00davidstaff000000 000000 ## HOW TO CONTRIBUTE Thank you for considering contributing to this distribution. This file contains instructions that will help you work with the source code. The distribution is managed with Dist::Zilla. This means than many of the usual files you might expect are not in the repository, but are generated at release time, as is much of the documentation. Some generated files are kept in the repository as a convenience (e.g. Makefile.PL or cpanfile). Generally, **you do not need Dist::Zilla to contribute patches**. You do need Dist::Zilla to create a tarball. See below for guidance. ### Getting dependencies If you have App::cpanminus 1.6 or later installed, you can use `cpanm` to satisfy dependencies like this: $ cpanm --installdeps . Otherwise, look for either a `Makefile.PL` or `cpanfile` file for a list of dependencies to satisfy. ### Running tests You can run tests directly using the `prove` tool: $ prove -l $ prove -lv t/some_test_file.t For most of my distributions, `prove` is entirely sufficient for you to test any patches you have. I use `prove` for 99% of my testing during development. ### Code style and tidying Please try to match any existing coding style. If there is a `.perltidyrc` file, please install Perl::Tidy and use perltidy before submitting patches. If there is a `tidyall.ini` file, you can also install Code::TidyAll and run `tidyall` on a file or `tidyall -a` to tidy all files. ### Patching documentation Much of the documentation Pod is generated at release time. Some is generated boilerplate; other documentation is built from pseudo-POD directives in the source like C<=method> or C<=func>. If you would like to submit a documentation edit, please limit yourself to the documentation you see. If you see typos or documentation issues in the generated docs, please email or open a bug ticket instead of patching. ### Installing and using Dist::Zilla Dist::Zilla is a very powerful authoring tool, optimized for maintaining a large number of distributions with a high degree of automation, but it has a large dependency chain, a bit of a learning curve and requires a number of author-specific plugins. To install it from CPAN, I recommend one of the following approaches for the quickest installation: # using CPAN.pm, but bypassing non-functional pod tests $ cpan TAP::Harness::Restricted $ PERL_MM_USE_DEFAULT=1 HARNESS_CLASS=TAP::Harness::Restricted cpan Dist::Zilla # using cpanm, bypassing *all* tests $ cpanm -n Dist::Zilla In either case, it's probably going to take about 10 minutes. Go for a walk, go get a cup of your favorite beverage, take a bathroom break, or whatever. When you get back, Dist::Zilla should be ready for you. Then you need to install any plugins specific to this distribution: $ cpan `dzil authordeps` $ dzil authordeps | cpanm Once installed, here are some dzil commands you might try: $ dzil build $ dzil test $ dzil xtest You can learn more about Dist::Zilla at http://dzil.org/ Test-Reporter-1.62/cpanfile000644 000765 000024 00000002675 12510527023 016126 0ustar00davidstaff000000 000000 requires "Carp" => "0"; requires "Cwd" => "0"; requires "File::Temp" => "0"; requires "FileHandle" => "0"; requires "Sys::Hostname" => "0"; requires "Time::Local" => "0"; requires "base" => "0"; requires "constant" => "0"; requires "perl" => "5.006"; requires "strict" => "0"; requires "vars" => "0"; requires "warnings" => "0"; recommends "Mail::Send" => "0"; recommends "Net::DNS" => "0"; recommends "Net::Domain" => "0"; recommends "Net::SMTP" => "0"; on 'test' => sub { requires "Data::Dumper" => "0"; requires "ExtUtils::MakeMaker" => "0"; requires "File::Find" => "0"; requires "File::Spec" => "0"; requires "Test::More" => "0.88"; requires "perl" => "5.006"; }; on 'test' => sub { recommends "CPAN::Meta" => "2.120900"; }; on 'configure' => sub { requires "ExtUtils::MakeMaker" => "6.17"; requires "perl" => "5.006"; }; on 'develop' => sub { requires "Dist::Zilla" => "5"; requires "Dist::Zilla::Plugin::Prereqs" => "0"; requires "Dist::Zilla::Plugin::RemovePrereqs" => "0"; requires "Dist::Zilla::PluginBundle::DAGOLDEN" => "0.072"; requires "File::Spec" => "0"; requires "File::Temp" => "0"; requires "IO::Handle" => "0"; requires "IPC::Open3" => "0"; requires "Pod::Coverage::TrustPod" => "0"; requires "Test::CPAN::Meta" => "0"; requires "Test::More" => "0"; requires "Test::Pod" => "1.41"; requires "Test::Pod::Coverage" => "1.08"; requires "Test::Spelling" => "0.12"; requires "Test::Version" => "1"; }; Test-Reporter-1.62/dist.ini000644 000765 000024 00000001235 12510527023 016055 0ustar00davidstaff000000 000000 name = Test-Reporter author = Adam J. Foxson author = David Golden author = Kirrily "Skud" Robert author = Ricardo Signes author = Richard Soderberg author = Kurt Starsinic license = Perl_5 copyright_holder = Authors and Contributors [@DAGOLDEN] :version = 0.072 stopwords = Metabase stopwords = dir stopwords = errstr stopwords = mx ; these are conditional [RemovePrereqs] remove = Mail::Send remove = Net::DNS remove = Net::Domain remove = Net::SMTP [Prereqs / RuntimeRecommends] Mail::Send = 0 Net::DNS = 0 Net::Domain = 0 Net::SMTP = 0 Test-Reporter-1.62/lib/000755 000765 000024 00000000000 12510527023 015156 5ustar00davidstaff000000 000000 Test-Reporter-1.62/LICENSE000644 000765 000024 00000043721 12510527023 015424 0ustar00davidstaff000000 000000 This software is copyright (c) 2015 by Authors and Contributors. 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) 2015 by Authors and Contributors. 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) 2015 by Authors and Contributors. 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 Test-Reporter-1.62/Makefile.PL000644 000765 000024 00000003512 12510527023 016363 0ustar00davidstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.034. use strict; use warnings; use 5.006; use ExtUtils::MakeMaker 6.17; my %WriteMakefileArgs = ( "ABSTRACT" => "sends test results to cpan-testers\@perl.org", "AUTHOR" => "Adam J. Foxson , David Golden , Kirrily \"Skud\" Robert , Ricardo Signes , Richard Soderberg , Kurt Starsinic ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.17" }, "DISTNAME" => "Test-Reporter", "EXE_FILES" => [], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.006", "NAME" => "Test::Reporter", "PREREQ_PM" => { "Carp" => 0, "Cwd" => 0, "File::Temp" => 0, "FileHandle" => 0, "Sys::Hostname" => 0, "Time::Local" => 0, "base" => 0, "constant" => 0, "strict" => 0, "vars" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Data::Dumper" => 0, "ExtUtils::MakeMaker" => 0, "File::Find" => 0, "File::Spec" => 0, "Test::More" => "0.88" }, "VERSION" => "1.62", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Cwd" => 0, "Data::Dumper" => 0, "ExtUtils::MakeMaker" => "6.17", "File::Find" => 0, "File::Spec" => 0, "File::Temp" => 0, "FileHandle" => 0, "Sys::Hostname" => 0, "Test::More" => "0.88", "Time::Local" => 0, "base" => 0, "constant" => 0, "strict" => 0, "vars" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); Test-Reporter-1.62/MANIFEST000644 000765 000024 00000001212 12510527023 015535 0ustar00davidstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.034. CONTRIBUTING.mkdn Changes LICENSE MANIFEST META.json META.yml Makefile.PL README cpanfile dist.ini lib/Test/Reporter.pm lib/Test/Reporter/Transport.pm lib/Test/Reporter/Transport/File.pm lib/Test/Reporter/Transport/Null.pm perlcritic.rc t/00-report-prereqs.dd t/00-report-prereqs.t t/1-reporter.t t/3-file-transport.t t/6-write-read-crlf.t t/rt-89404.t xt/author/00-compile.t xt/author/critic.t xt/author/pod-spell.t xt/release/distmeta.t xt/release/minimum-version.t xt/release/pod-coverage.t xt/release/pod-syntax.t xt/release/portability.t xt/release/test-version.t Test-Reporter-1.62/META.json000644 000765 000024 00000007277 12510527023 016046 0ustar00davidstaff000000 000000 { "abstract" : "sends test results to cpan-testers@perl.org", "author" : [ "Adam J. Foxson ", "David Golden ", "Kirrily \"Skud\" Robert ", "Ricardo Signes ", "Richard Soderberg ", "Kurt Starsinic " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.150001", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Test-Reporter", "no_index" : { "directory" : [ "t", "xt", "examples", "corpus" ], "package" : [ "DB" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.17", "perl" : "5.006" } }, "develop" : { "requires" : { "Dist::Zilla" : "5", "Dist::Zilla::Plugin::Prereqs" : "0", "Dist::Zilla::Plugin::RemovePrereqs" : "0", "Dist::Zilla::PluginBundle::DAGOLDEN" : "0.072", "File::Spec" : "0", "File::Temp" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Meta" : "0", "Test::More" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Spelling" : "0.12", "Test::Version" : "1" } }, "runtime" : { "recommends" : { "Mail::Send" : "0", "Net::DNS" : "0", "Net::Domain" : "0", "Net::SMTP" : "0" }, "requires" : { "Carp" : "0", "Cwd" : "0", "File::Temp" : "0", "FileHandle" : "0", "Sys::Hostname" : "0", "Time::Local" : "0", "base" : "0", "constant" : "0", "perl" : "5.006", "strict" : "0", "vars" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Data::Dumper" : "0", "ExtUtils::MakeMaker" : "0", "File::Find" : "0", "File::Spec" : "0", "Test::More" : "0.88", "perl" : "5.006" } } }, "provides" : { "Test::Reporter" : { "file" : "lib/Test/Reporter.pm", "version" : "1.62" }, "Test::Reporter::Transport" : { "file" : "lib/Test/Reporter/Transport.pm", "version" : "1.62" }, "Test::Reporter::Transport::File" : { "file" : "lib/Test/Reporter/Transport/File.pm", "version" : "1.62" }, "Test::Reporter::Transport::Null" : { "file" : "lib/Test/Reporter/Transport/Null.pm", "version" : "1.62" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/cpan-testers/Test-Reporter/issues" }, "homepage" : "https://github.com/cpan-testers/Test-Reporter", "repository" : { "type" : "git", "url" : "https://github.com/cpan-testers/Test-Reporter.git", "web" : "https://github.com/cpan-testers/Test-Reporter" } }, "version" : "1.62", "x_authority" : "cpan:DAGOLDEN", "x_contributors" : [ "Andreas Koenig ", "Ed J ", "Tatsuhiko Miyagawa ", "Vincent Pit " ] } Test-Reporter-1.62/META.yml000644 000765 000024 00000003567 12510527023 015674 0ustar00davidstaff000000 000000 --- abstract: 'sends test results to cpan-testers@perl.org' author: - 'Adam J. Foxson ' - 'David Golden ' - 'Kirrily "Skud" Robert ' - 'Ricardo Signes ' - 'Richard Soderberg ' - 'Kurt Starsinic ' build_requires: Data::Dumper: '0' ExtUtils::MakeMaker: '0' File::Find: '0' File::Spec: '0' Test::More: '0.88' perl: '5.006' configure_requires: ExtUtils::MakeMaker: '6.17' perl: '5.006' dynamic_config: 0 generated_by: 'Dist::Zilla version 5.034, CPAN::Meta::Converter version 2.150001' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Test-Reporter no_index: directory: - t - xt - examples - corpus package: - DB provides: Test::Reporter: file: lib/Test/Reporter.pm version: '1.62' Test::Reporter::Transport: file: lib/Test/Reporter/Transport.pm version: '1.62' Test::Reporter::Transport::File: file: lib/Test/Reporter/Transport/File.pm version: '1.62' Test::Reporter::Transport::Null: file: lib/Test/Reporter/Transport/Null.pm version: '1.62' recommends: Mail::Send: '0' Net::DNS: '0' Net::Domain: '0' Net::SMTP: '0' requires: Carp: '0' Cwd: '0' File::Temp: '0' FileHandle: '0' Sys::Hostname: '0' Time::Local: '0' base: '0' constant: '0' perl: '5.006' strict: '0' vars: '0' warnings: '0' resources: bugtracker: https://github.com/cpan-testers/Test-Reporter/issues homepage: https://github.com/cpan-testers/Test-Reporter repository: https://github.com/cpan-testers/Test-Reporter.git version: '1.62' x_authority: cpan:DAGOLDEN x_contributors: - 'Andreas Koenig ' - 'Ed J ' - 'Tatsuhiko Miyagawa ' - 'Vincent Pit ' Test-Reporter-1.62/perlcritic.rc000644 000765 000024 00000001166 12510527023 017102 0ustar00davidstaff000000 000000 severity = 5 verbose = 8 [Variables::ProhibitPunctuationVars] allow = $@ $! [TestingAndDebugging::ProhibitNoStrict] allow = refs [Variables::ProhibitEvilVariables] variables = $DB::single # Turn these off [-BuiltinFunctions::ProhibitStringyEval] [-ControlStructures::ProhibitPostfixControls] [-ControlStructures::ProhibitUnlessBlocks] [-Documentation::RequirePodSections] [-InputOutput::ProhibitInteractiveTest] [-References::ProhibitDoubleSigils] [-RegularExpressions::RequireExtendedFormatting] [-InputOutput::ProhibitTwoArgOpen] [-Modules::ProhibitEvilModules] # Turn this on [Lax::ProhibitStringyEval::ExceptForRequire] Test-Reporter-1.62/README000644 000765 000024 00000023574 12510527023 015303 0ustar00davidstaff000000 000000 NAME Test::Reporter - sends test results to cpan-testers@perl.org VERSION version 1.62 SYNOPSIS use Test::Reporter; my $reporter = Test::Reporter->new( transport => 'File', transport_args => [ '/tmp' ], ); $reporter->grade('pass'); $reporter->distribution('Mail-Freshmeat-1.20'); $reporter->send() || die $reporter->errstr(); # or my $reporter = Test::Reporter->new( transport => 'File', transport_args => [ '/tmp' ], ); $reporter->grade('fail'); $reporter->distribution('Mail-Freshmeat-1.20'); $reporter->comments('output of a failed make test goes here...'); $reporter->edit_comments(); # if you want to edit comments in an editor $reporter->send() || die $reporter->errstr(); # or my $reporter = Test::Reporter->new( transport => 'File', transport_args => [ '/tmp' ], grade => 'fail', distribution => 'Mail-Freshmeat-1.20', from => 'whoever@wherever.net (Whoever Wherever)', comments => 'output of a failed make test goes here...', via => 'CPANPLUS X.Y.Z', ); $reporter->send() || die $reporter->errstr(); DESCRIPTION Test::Reporter reports the test results of any given distribution to the CPAN Testers project. Test::Reporter has wide support for various perl5's and platforms. CPAN Testers no longer receives test reports by email, but reports still resemble an email message. This module has numerous legacy "features" left over from the days of email transport. Transport mechanism The choice of transport is set with the "transport" argument. CPAN Testers should usually install Test::Reporter::Transport::Metabase and use 'Metabase' as the "transport". See that module for necessary transport arguments. Advanced testers may wish to test on a machine different from the one used to send reports. Consult the CPAN Testers Wiki for examples using other transport classes. The legacy email-based transports have been split out into a separate Test::Reporter::Transport::Legacy distribution and methods solely related to email have been deprecated. ATTRIBUTES Required attributes * distribution Gets or sets the name of the distribution you're working on, for example Foo-Bar-0.01. There are no restrictions on what can be put here. * from Gets or sets the e-mail address of the individual submitting the test report, i.e. "John Doe ". * grade Gets or sets the success or failure of the distributions's 'make test' result. This must be one of: grade meaning ----- ------- pass all tests passed fail one or more tests failed na distribution will not work on this platform unknown tests did not exist or could not be run Transport attributes * transport Gets or sets the transport type. The transport type argument is refers to a 'Test::Reporter::Transport' subclass. The default is 'Null', which uses the Test::Reporter::Transport::Null class and does nothing when "send" is called. You can add additional arguments after the transport selection. These will be passed to the constructor of the lower-level transport. See "transport_args". $reporter->transport( 'File', '/tmp' ); This is not designed to be an extensible platform upon which to build transport plugins. That functionality is planned for the next-generation release of Test::Reporter, which will reside in the CPAN::Testers namespace. * transport_args Optional. Gets or sets transport arguments that will used in the constructor for the selected transport, as appropriate. Optional attributes * comments Gets or sets the comments on the test report. This is most commonly used for distributions that did not pass a 'make test'. * debug Gets or sets the value that will turn debugging on or off. Debug messages are sent to STDERR. 1 for on, 0 for off. Debugging generates very verbose output and is useful mainly for finding bugs in Test::Reporter itself. * dir Defaults to the current working directory. This method specifies the directory that write() writes test report files to. * timeout Gets or sets the timeout value for the submission of test reports. Default is 120 seconds. * via Gets or sets the value that will be appended to X-Reported-Via, generally this is useful for distributions that use Test::Reporter to report test results. This would be something like "CPANPLUS 0.036". Deprecated attributes CPAN Testers no longer uses email for submitting reports. These attributes are deprecated. * address * mail_send_args * mx METHODS * new This constructor returns a Test::Reporter object. * perl_version Returns a hashref containing _archname, _osvers, and _myconfig based upon the perl that you are using. Alternatively, you may supply a different perl (path to the binary) as an argument, in which case the supplied perl will be used as the basis of the above data. Make sure you protect it from the shell in case there are spaces in the path: $reporter->perl_version(qq{"$^X"}); * subject Returns the subject line of a report, i.e. "PASS Mail-Freshmeat-1.20 Darwin 6.0". 'grade' and 'distribution' must first be specified before calling this method. * report Returns the actual content of a report, i.e. "This distribution has been tested as part of the cpan-testers...". 'comments' must first be specified before calling this method, if you have comments to make and expect them to be included in the report. * send Sends the test report to cpan-testers@perl.org via the defined "transport" mechanism. You must check errstr() on a send() in order to be guaranteed delivery. * edit_comments Allows one to interactively edit the comments within a text editor. comments() doesn't have to be first specified, but it will work properly if it was. Accepts an optional hash of arguments: * suffix Optional. Allows one to specify the suffix ("extension") of the temp file used by edit_comments. Defaults to '.txt'. * errstr Returns an error message describing why something failed. You must check errstr() on a send() in order to be guaranteed delivery. * write and read These methods are used in situations where you wish to save reports locally rather than transmitting them to CPAN Testers immediately. You use write() on the machine that you are testing from, transfer the written test reports from the testing machine to the sending machine, and use read() on the machine that you actually want to submit the reports from. write() will write a file in an internal format that contains 'From', 'Subject', and the content of the report. The filename will be represented as: grade.distribution.archname.osvers.seconds_since_epoch.pid.rpt. write() uses the value of dir() if it was specified, else the cwd. On the machine you are testing from: my $reporter = Test::Reporter->new ( grade => 'pass', distribution => 'Test-Reporter-1.16', )->write(); On the machine you are submitting from: # wrap in an opendir if you've a lot to submit my $reporter; $reporter = Test::Reporter->new()->read( 'pass.Test-Reporter-1.16.i686-linux.2.2.16.1046685296.14961.rpt' )->send() || die $reporter->errstr(); write() also accepts an optional filehandle argument: my $fh; open $fh, '>-'; # create a STDOUT filehandle object $reporter->write($fh); # prints the report to STDOUT Deprecated methods * message_id CAVEATS If you experience a long delay sending reports with Test::Reporter, you may be experiencing a wait as Test::Reporter attempts to determine your email address. Always use the "from" parameter to set your email address explicitly. SEE ALSO For more about CPAN Testers: * CPAN Testers reports * CPAN Testers wiki SUPPORT Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at . You will be notified automatically of any progress on your issue. Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. git clone https://github.com/cpan-testers/Test-Reporter.git AUTHORS * Adam J. Foxson * David Golden * Kirrily "Skud" Robert * Ricardo Signes * Richard Soderberg * Kurt Starsinic CONTRIBUTORS * Andreas Koenig * Ed J * Tatsuhiko Miyagawa * Vincent Pit COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Authors and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Test-Reporter-1.62/t/000755 000765 000024 00000000000 12510527023 014653 5ustar00davidstaff000000 000000 Test-Reporter-1.62/xt/000755 000765 000024 00000000000 12510527023 015043 5ustar00davidstaff000000 000000 Test-Reporter-1.62/xt/author/000755 000765 000024 00000000000 12510527023 016345 5ustar00davidstaff000000 000000 Test-Reporter-1.62/xt/release/000755 000765 000024 00000000000 12510527023 016463 5ustar00davidstaff000000 000000 Test-Reporter-1.62/xt/release/distmeta.t000644 000765 000024 00000000172 12510527023 020462 0ustar00davidstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); Test-Reporter-1.62/xt/release/minimum-version.t000644 000765 000024 00000000266 12510527023 022012 0ustar00davidstaff000000 000000 #!perl use Test::More; eval "use Test::MinimumVersion"; plan skip_all => "Test::MinimumVersion required for testing minimum versions" if $@; all_minimum_version_ok( qq{5.010} ); Test-Reporter-1.62/xt/release/pod-coverage.t000644 000765 000024 00000000334 12510527023 021223 0ustar00davidstaff000000 000000 #!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' }); Test-Reporter-1.62/xt/release/pod-syntax.t000644 000765 000024 00000000220 12510527023 020750 0ustar00davidstaff000000 000000 #!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Test-Reporter-1.62/xt/release/portability.t000644 000765 000024 00000000332 12510527023 021210 0ustar00davidstaff000000 000000 #!perl use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; options(test_one_dot => 0); run_tests(); Test-Reporter-1.62/xt/release/test-version.t000644 000765 000024 00000000604 12510527023 021312 0ustar00davidstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 0.003001 use Test::Version; my @imports = ( 'version_all_ok' ); my $params = { is_strict => 0, has_version => 1, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; Test-Reporter-1.62/xt/author/00-compile.t000644 000765 000024 00000002325 12510527023 020401 0ustar00davidstaff000000 000000 use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.052 use Test::More; plan tests => 5; my @module_files = ( 'Test/Reporter.pm', 'Test/Reporter/Transport.pm', 'Test/Reporter/Transport/File.pm', 'Test/Reporter/Transport/Null.pm' ); # fake home for cpan-testers use File::Temp; local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); my $inc_switch = -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; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); 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) ); Test-Reporter-1.62/xt/author/critic.t000644 000765 000024 00000000435 12510527023 020011 0ustar00davidstaff000000 000000 #!perl use strict; use warnings; use Test::More; use English qw(-no_match_vars); eval "use Test::Perl::Critic"; plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; all_critic_ok(); Test-Reporter-1.62/xt/author/pod-spell.t000644 000765 000024 00000001004 12510527023 020424 0ustar00davidstaff000000 000000 use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::PodSpelling 2.006008 use Test::Spelling 0.12; use Pod::Wordlist; add_stopwords(); all_pod_files_spelling_ok( qw( bin lib ) ); __DATA__ Metabase dir errstr mx Adam Foxson afoxson David Golden dagolden Kirrily Skud Robert skud Ricardo Signes rjbs Richard Soderberg rsod Kurt Starsinic Authors and Contributors Andreas Koenig andk Ed mohawk2 Tatsuhiko Miyagawa miyagawa Vincent Pit perl lib Test Reporter Transport File Null Test-Reporter-1.62/t/00-report-prereqs.dd000644 000765 000024 00000006064 12510527023 020401 0ustar00davidstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '6.17', 'perl' => '5.006' } }, 'develop' => { 'requires' => { 'Dist::Zilla' => '5', 'Dist::Zilla::Plugin::Prereqs' => '0', 'Dist::Zilla::Plugin::RemovePrereqs' => '0', 'Dist::Zilla::PluginBundle::DAGOLDEN' => '0.072', 'File::Spec' => '0', 'File::Temp' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Pod::Coverage::TrustPod' => '0', 'Test::CPAN::Meta' => '0', 'Test::More' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Spelling' => '0.12', 'Test::Version' => '1' } }, 'runtime' => { 'recommends' => { 'Mail::Send' => '0', 'Net::DNS' => '0', 'Net::Domain' => '0', 'Net::SMTP' => '0' }, 'requires' => { 'Carp' => '0', 'Cwd' => '0', 'File::Temp' => '0', 'FileHandle' => '0', 'Sys::Hostname' => '0', 'Time::Local' => '0', 'base' => '0', 'constant' => '0', 'perl' => '5.006', 'strict' => '0', 'vars' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Data::Dumper' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Find' => '0', 'File::Spec' => '0', 'Test::More' => '0.88', 'perl' => '5.006' } } }; $x; }Test-Reporter-1.62/t/00-report-prereqs.t000644 000765 000024 00000012731 12510527023 020253 0ustar00davidstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.021 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do 't/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; if ( $source && $HAS_CPAN_META ) { if ( my $meta = eval { CPAN::Meta->load_file($source) } ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } } else { $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( @dep_errors ) { diag join("\n", "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n", "The following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: Test-Reporter-1.62/t/1-reporter.t000644 000765 000024 00000017673 12510527023 017056 0ustar00davidstaff000000 000000 #!/usr/bin/perl -w use strict; use FileHandle; use Test::More 0.88; use Test::Reporter; use Data::Dumper; $Test::Reporter::VERSION ||= 999; # dzil will set it for us on release my $distro = "Foo-Bar-1.23"; my $distfile = "AUTHOR/" . $distro . ".tar.gz"; my $reporter = Test::Reporter->new(); isa_ok($reporter, 'Test::Reporter'); $reporter->grade('pass'); $reporter->distribution('Mail-Freshmeat-1.20'); $reporter->distfile('ASPIERS/Mail-Freshmeat-1.20.tar.gz'); like($reporter->subject, '/^PASS Mail-Freshmeat-1.20\s/'); like($reporter->report, '/This distribution has been tested/'); like($reporter->report, '/Summary of my/'); is($reporter->grade, 'pass'); is($reporter->distribution, 'Mail-Freshmeat-1.20'); is($reporter->timeout, 120); undef $reporter; $reporter = Test::Reporter->new(); isa_ok($reporter, 'Test::Reporter'); $reporter->grade('fail'); $reporter->distribution('Foo-Bar-1.50'); $reporter->distfile('ASPIERS/Mail-Freshmeat-1.20.tar.gz'); $reporter->comments('blah'); $reporter->timeout(60); $reporter->via('CPANPLUS'); $reporter->from('foo@bar.com'); $reporter->address('send@reports.here'); $reporter->mx([1, 2, 3, 4, 5, 6, 7, 8, 9]); like($reporter->subject, '/^FAIL Foo-Bar-1.50\s/'); like($reporter->report, '/This distribution has been tested/'); like($reporter->report, '/Summary of my/'); like($reporter->report, '/blah/'); is($reporter->grade, 'fail'); is($reporter->distribution, 'Foo-Bar-1.50'); is($reporter->timeout, 60); is($reporter->comments, 'blah'); is($reporter->via, 'CPANPLUS'); is($reporter->from, 'foo@bar.com'); is($reporter->address, 'send@reports.here'); is($reporter->debug, 0); is(scalar @{$reporter->mx}, 9); undef $reporter; $reporter = Test::Reporter->new(); isa_ok($reporter, 'Test::Reporter'); $reporter->grade('na'); is($reporter->grade, 'na'); is($reporter->timeout, 120); undef $reporter; $reporter = Test::Reporter->new(); isa_ok($reporter, 'Test::Reporter'); $reporter->grade('unknown'); is($reporter->grade, 'unknown'); undef $reporter; $reporter = Test::Reporter->new ( mx => [1, 2, 3, 4, 5], address => 'foo@bar', grade => 'pass', distribution => 'Bar-1.0', from => 'me@me.com', comments => 'woo', via => 'something', timeout => 500, debug => 0, dir => '/tmp', ); isa_ok($reporter, 'Test::Reporter'); like($reporter->subject, '/^PASS Bar-1.0\s/'); like($reporter->report, '/This distribution has been tested/'); like($reporter->report, '/Summary of my/'); like($reporter->report, '/woo/'); is($reporter->grade, 'pass'); is($reporter->distribution, 'Bar-1.0'); is($reporter->timeout, 500); is($reporter->comments, 'woo'); is($reporter->via, 'something'); is($reporter->from, 'me@me.com'); is($reporter->address, 'foo@bar'); is($reporter->debug, 0); is(scalar @{$reporter->mx}, 5); is($reporter->dir, '/tmp'); # --- undef $reporter; $reporter = Test::Reporter->new ( grade => 'pass', distribution => $distro, distfile => $distfile, from => 'johndoe@example.net', ); isa_ok($reporter, 'Test::Reporter'); my $file = $reporter->write(); like($file, "/$distro/"); ok(-e $file); my $orig_subject = $reporter->subject; my $orig_from = $reporter->from; my $orig_report = $reporter->report; my $orig_perl_version = $reporter->perl_version->{_version}; undef $reporter; $reporter = Test::Reporter->new ( )->read($file); isa_ok($reporter, 'Test::Reporter'); like($reporter->subject,"/^PASS $distro\\s/"); like($reporter->report, '/This distribution has been tested/'); like($reporter->report,'/Summary of my/'); is($reporter->grade, 'pass'); is($reporter->distribution, $distro); is($reporter->distfile, $distfile); like($reporter->perl_version->{_myconfig}, '/Summary of my/', "Regenerated _myconfig"); # confirm roundtrip -- particularly newlines is($reporter->subject, $orig_subject); is($reporter->from, $orig_from); is($reporter->report, $orig_report); is($reporter->perl_version->{_version}, $orig_perl_version, 'perl version roundtrip'); unlink $file; # testing perl-version with the current perl my $alt_perl = 'alt_perl.pl'; my $no_version = $reporter->perl_version; my $same_version = $reporter->perl_version(qq{"$^X"}); for my $field ( qw( _archname _osvers _myconfig) ) { is( $no_version->{$field}, $same_version->{$field}); } # testing error { my $fh = FileHandle->new(); open( $fh, ">$alt_perl") or die "cannot create (fake, not working) $alt_perl: $!"; # fake perl, gives wrong output print {$fh} qq{print "booh"; }; close $fh; eval { $reporter->perl_version( qq{"$^X" $alt_perl}); }; like($@, q{/^Test::Reporter: cannot get perl version info from/}); 1 while (unlink $alt_perl); } ok($reporter->_is_a_perl_release('perl-5.9.3')); ok($reporter->_is_a_perl_release('perl-5.9.2')); ok($reporter->_is_a_perl_release('perl-5.9.1')); ok($reporter->_is_a_perl_release('perl-5.9.0')); ok($reporter->_is_a_perl_release('perl-5.8.7')); ok($reporter->_is_a_perl_release('perl-5.8.6')); ok($reporter->_is_a_perl_release('perl-5.8.5')); ok($reporter->_is_a_perl_release('perl-5.8.4')); ok($reporter->_is_a_perl_release('perl-5.8.3')); ok($reporter->_is_a_perl_release('perl-5.8.2')); ok($reporter->_is_a_perl_release('perl-5.8.1')); ok($reporter->_is_a_perl_release('perl-5.8.0')); ok($reporter->_is_a_perl_release('perl-5.7.3')); ok($reporter->_is_a_perl_release('perl-5.7.2')); ok($reporter->_is_a_perl_release('perl-5.7.1')); ok($reporter->_is_a_perl_release('perl-5.7.0')); ok($reporter->_is_a_perl_release('perl-5.6.2')); ok($reporter->_is_a_perl_release('perl-5.6.1-TRIAL3')); ok($reporter->_is_a_perl_release('perl-5.6.1-TRIAL2')); ok($reporter->_is_a_perl_release('perl-5.6.1-TRIAL1')); ok($reporter->_is_a_perl_release('perl-5.6.1')); ok($reporter->_is_a_perl_release('perl-5.6.0')); ok($reporter->_is_a_perl_release('perl-5.6-info')); ok($reporter->_is_a_perl_release('perl5.005_04')); ok($reporter->_is_a_perl_release('perl5.005_03')); ok($reporter->_is_a_perl_release('perl5.005_02')); ok($reporter->_is_a_perl_release('perl5.005_01')); ok($reporter->_is_a_perl_release('perl5.005')); ok($reporter->_is_a_perl_release('perl5.004_05')); ok($reporter->_is_a_perl_release('perl5.004_04')); ok($reporter->_is_a_perl_release('perl5.004_03')); ok($reporter->_is_a_perl_release('perl5.004_02')); ok($reporter->_is_a_perl_release('perl5.004_01')); ok($reporter->_is_a_perl_release('perl5.004')); ok($reporter->_is_a_perl_release('perl5.003_07')); ok($reporter->_is_a_perl_release('perl-1.0_16')); ok($reporter->_is_a_perl_release('perl-1.0_15')); ok(not $reporter->_is_a_perl_release('Perl-BestPractice-0.01')); ok(not $reporter->_is_a_perl_release('Perl-Compare-0.10')); ok(not $reporter->_is_a_perl_release('Perl-Critic-0.2')); ok(not $reporter->_is_a_perl_release('Perl-Dist-0.0.5')); ok(not $reporter->_is_a_perl_release('Perl-Dist-Strawberry-0.1.2')); ok(not $reporter->_is_a_perl_release('Perl-Dist-Vanilla-7')); ok(not $reporter->_is_a_perl_release('Perl-Editor-0.02')); ok(not $reporter->_is_a_perl_release('Perl-Editor-Plugin-Squish-0.01')); ok(not $reporter->_is_a_perl_release('Perl-Metrics-0.06')); ok(not $reporter->_is_a_perl_release('Perl-MinimumVersion-0.13')); ok(not $reporter->_is_a_perl_release('Perl-Repository-APC-1.216')); ok(not $reporter->_is_a_perl_release('Perl-SAX-0.07')); ok(not $reporter->_is_a_perl_release('Perl-Signature-0.08')); ok(not $reporter->_is_a_perl_release('Perl-Tags-0.23')); ok(not $reporter->_is_a_perl_release('Perl-Tidy-20060719')); ok(not $reporter->_is_a_perl_release('Perl-Squish-0.02')); ok(not $reporter->_is_a_perl_release('Perl-Visualize-1.02')); like($reporter->message_id, '/^<\d+\.[^.]+\.\d+@[^>]+>$/'); undef $reporter; # Default transport is Null $reporter = Test::Reporter->new(); isa_ok($reporter, 'Test::Reporter'); is($reporter->transport(), 'Null'); is($reporter->{_transport}, 'Null'); # Arguments stored in _tls $reporter->transport('File', dir => "/foo"); my %tls_args = $reporter->transport_args(); is( $tls_args{dir}, '/foo' ); eval { $reporter->transport('Invalid'); }; like($@, q{/could not load 'Test::Reporter::Transport::Invalid'/}) or print "# $@\n"; done_testing; Test-Reporter-1.62/t/3-file-transport.t000644 000765 000024 00000002127 12510527023 020153 0ustar00davidstaff000000 000000 #!/usr/bin/perl -w use strict; use Test::More 0.88; use File::Temp; use File::Find; $Test::Reporter::VERSION ||= 999; # dzil will set it for us on release #--------------------------------------------------------------------------# my $from = 'johndoe@example.net'; my $dir = File::Temp::tempdir( CLEANUP => 1 ); #--------------------------------------------------------------------------# require_ok( 'Test::Reporter' ); my $reporter = Test::Reporter->new(); ok(ref $reporter, 'Test::Reporter'); $reporter->grade('pass'); $reporter->distribution('Mail-Freshmeat-1.20'); $reporter->distfile('ASPIERS/Mail-Freshmeat-1.20.tar.gz'); $reporter->from($from); my $form = { key => 123456789, via => my $via = "Test::Reporter ${Test::Reporter::VERSION}", from => $from, subject => $reporter->subject(), report => $reporter->report(), }; $reporter->transport("File", $dir); eval { $reporter->send }; is( $@, "", "report sent ok" ); my @reports; find( sub { push @reports, $_ if -f; }, $dir ); is( scalar @reports, 1, "found a report in the directory" ); done_testing; Test-Reporter-1.62/t/6-write-read-crlf.t000644 000765 000024 00000003025 12510527023 020172 0ustar00davidstaff000000 000000 #!/usr/bin/perl -w use strict; use FileHandle; use Test::More 0.88; use Test::Reporter; use Data::Dumper; $Test::Reporter::VERSION ||= 999; # dzil will set it for us on release plan tests => 14; my $CR = "\015"; my $LF = "\012"; my $distro = "Foo-Bar-1.23"; my $distfile = "AUTHOR/" . $distro . ".tar.gz"; my $reporter = Test::Reporter->new ( grade => 'pass', distribution => $distro, distfile => $distfile, from => 'johndoe@example.net', ); isa_ok($reporter, 'Test::Reporter'); my $file = $reporter->write(); like($file, "/$distro/"); ok(-e $file); my $orig_subject = $reporter->subject; my $orig_from = $reporter->from; my $orig_report = $reporter->report; undef $reporter; # convert line endings open my $in_fh, "<", $file; my $slurp = do { local $/; <$in_fh> }; close $in_fh; $slurp =~ s{$CR?$LF}{$CR$LF}g; open my $out_fh, ">", $file; binmode $out_fh; print {$out_fh} $slurp; close $out_fh; # read in $reporter = Test::Reporter->new ( )->read($file); isa_ok($reporter, 'Test::Reporter'); like($reporter->subject,"/^PASS $distro\\s/"); like($reporter->report, '/This distribution has been tested/'); like($reporter->report,'/Summary of my/'); is($reporter->grade, 'pass'); is($reporter->distribution, $distro); is($reporter->distfile, $distfile); like($reporter->perl_version->{_myconfig}, '/Summary of my/', "Regenerated _myconfig"); # confirm roundtrip -- particularly newlines is($reporter->subject, $orig_subject); is($reporter->from, $orig_from); is($reporter->report, $orig_report); unlink $file; done_testing; Test-Reporter-1.62/t/rt-89404.t000644 000765 000024 00000001737 12510527023 016163 0ustar00davidstaff000000 000000 use Test::More tests => 1; use File::Temp; use Test::Reporter; my($ft) = File::Temp->new(TEMPLATE => "bugdemo-XXXX", SUFFIX=>".rpt"); print $ft <flush; my $file = $ft->filename; my $r = Test::Reporter->new( transport => 'Null', )->read($file); is $r->{_perl_version}{_archname}, "amd64-freebsd"; Test-Reporter-1.62/lib/Test/000755 000765 000024 00000000000 12510527023 016075 5ustar00davidstaff000000 000000 Test-Reporter-1.62/lib/Test/Reporter/000755 000765 000024 00000000000 12510527023 017677 5ustar00davidstaff000000 000000 Test-Reporter-1.62/lib/Test/Reporter.pm000644 000765 000024 00000075614 12510527023 020252 0ustar00davidstaff000000 000000 use 5.006; use strict; use warnings; package Test::Reporter; our $VERSION = '1.62'; use Cwd; use Config; use Carp; use FileHandle; use File::Temp; use Sys::Hostname; use Time::Local (); use vars qw($AUTOLOAD $Tempfile $Report $DNS $Domain $Send); use constant FAKE_NO_NET_DNS => 0; # for debugging only use constant FAKE_NO_NET_DOMAIN => 0; # for debugging only use constant FAKE_NO_MAIL_SEND => 0; # for debugging only local $^W = 1; sub new { my $type = shift; my $class = ref($type) || $type; my $self = { '_grade' => undef, '_distribution' => undef, # XXX distfile => undef would break old clients :-( -- dagolden, 2009-03-30 '_distfile' => '', '_report' => undef, '_subject' => undef, '_from' => undef, '_comments' => '', '_errstr' => '', '_via' => '', '_timeout' => 120, '_debug' => 0, '_dir' => '', '_subject_lock' => 0, '_report_lock' => 0, '_perl_version' => { '_archname' => $Config{archname}, '_osvers' => $Config{osvers}, }, '_transport' => '', '_transport_args' => [], # DEPRECATED ARGS '_address' => 'cpan-testers@perl.org', '_mx' => ['mx.develooper.com'], '_mail_send_args' => '', }; bless $self, $class; $self->{_perl_version}{_myconfig} = $self->_get_perl_V; $self->{_perl_version}{_version} = $self->_normalize_perl_version; $self->{_attr} = { map {$_ => 1} qw( _address _distribution _distfile _comments _errstr _via _timeout _debug _dir ) }; warn __PACKAGE__, ": new\n" if $self->debug(); croak __PACKAGE__, ": new: even number of named arguments required" unless scalar @_ % 2 == 0; $self->_process_params(@_) if @_; $self->transport('Null') unless $self->transport(); $self->_get_mx(@_) if $self->_have_net_dns(); return $self; } sub debug { my $self = shift; return $self->{_debug}; } sub _get_mx { my $self = shift; warn __PACKAGE__, ": _get_mx\n" if $self->debug(); my %params = @_; return if exists $params{'mx'}; my $dom = $params{'address'} || $self->address(); my @mx; $dom =~ s/^.+\@//; for my $mx (sort {$a->preference() <=> $b->preference()} Net::DNS::mx($dom)) { push @mx, $mx->exchange(); } if (not @mx) { warn __PACKAGE__, ": _get_mx: unable to find MX's for $dom, using defaults\n" if $self->debug(); return; } $self->mx(\@mx); } sub _process_params { my $self = shift; warn __PACKAGE__, ": _process_params\n" if $self->debug(); my %params = @_; my @defaults = qw( mx address grade distribution distfile from comments via timeout debug dir perl_version transport_args transport ); my %defaults = map {$_ => 1} @defaults; for my $param (keys %params) { croak __PACKAGE__, ": new: parameter '$param' is invalid." unless exists $defaults{$param}; } # XXX need to process transport_args directly rather than through # the following -- store array ref directly for my $param (keys %params) { $self->$param($params{$param}); } } sub subject { my $self = shift; warn __PACKAGE__, ": subject\n" if $self->debug(); croak __PACKAGE__, ": subject: grade and distribution must first be set" if not defined $self->{_grade} or not defined $self->{_distribution}; return $self->{_subject} if $self->{_subject_lock}; my $subject = uc($self->{_grade}) . ' ' . $self->{_distribution} . " $self->{_perl_version}->{_archname} $self->{_perl_version}->{_osvers}"; return $self->{_subject} = $subject; } sub report { my $self = shift; warn __PACKAGE__, ": report\n" if $self->debug(); return $self->{_report} if $self->{_report_lock}; my $report; $report .= "This distribution has been tested as part of the CPAN Testers\n"; $report .= "project, supporting the Perl programming language. See\n"; $report .= "http://wiki.cpantesters.org/ for more information or email\n"; $report .= "questions to cpan-testers-discuss\@perl.org\n\n"; if (not $self->{_comments}) { $report .= "\n\n--\n\n"; } else { $report .= "\n--\n" . $self->{_comments} . "\n--\n\n"; } $report .= $self->{_perl_version}->{_myconfig}; chomp $report; chomp $report; return $self->{_report} = $report; } sub grade { my ($self, $grade) = @_; warn __PACKAGE__, ": grade\n" if $self->debug(); my %grades = ( 'pass' => "all tests passed", 'fail' => "one or more tests failed", 'na' => "distribution will not work on this platform", 'unknown' => "distribution did not include tests", ); return $self->{_grade} if scalar @_ == 1; croak __PACKAGE__, ":grade: '$grade' is invalid, choose from: " . join ' ', keys %grades unless $grades{$grade}; return $self->{_grade} = $grade; } sub transport { my $self = shift; warn __PACKAGE__, ": transport\n" if $self->debug(); return $self->{_transport} unless scalar @_; my $transport = shift; my $transport_class = "Test::Reporter::Transport::$transport"; unless ( eval "require $transport_class; 1" ) { ## no critic croak __PACKAGE__ . ": could not load '$transport_class'\n$@\n"; } my @args = @_; # XXX keep this for legacy support if ( @args && $transport eq 'Mail::Send' && ref $args[0] eq 'ARRAY' ) { # treat as old form of Mail::Send arguments and convert to list $self->transport_args(@{$args[0]}); } elsif ( @args ) { $self->transport_args(@args); } return $self->{_transport} = $transport; } sub edit_comments { my($self, %args) = @_; warn __PACKAGE__, ": edit_comments\n" if $self->debug(); my %tempfile_args = ( UNLINK => 1, SUFFIX => '.txt', EXLOCK => 0, ); if (exists $args{'suffix'} && defined $args{'suffix'} && length $args{'suffix'}) { $tempfile_args{SUFFIX} = $args{'suffix'}; # prefix the extension with a period, if the user didn't. $tempfile_args{SUFFIX} =~ s/^(?!\.)(?=.)/./; } ($Tempfile, $Report) = File::Temp::tempfile(%tempfile_args); print $Tempfile $self->{_comments}; $self->_start_editor(); my $comments; { local $/; open my $fh, "<", $Report or die __PACKAGE__, ": Can't open comment file '$Report': $!"; $comments = <$fh>; close $fh or die __PACKAGE__, ": Can't close comment file '$Report': $!"; } chomp $comments; $self->{_comments} = $comments; return; } sub send { my ($self) = @_; warn __PACKAGE__, ": send\n" if $self->debug(); $self->from(); $self->report(); $self->subject(); return unless $self->_verify(); if ($self->_is_a_perl_release($self->distribution())) { $self->errstr(__PACKAGE__ . ": use perlbug for reporting test " . "results against perl itself"); return; } my $transport_type = $self->transport() || 'Null'; my $transport_class = "Test::Reporter::Transport::$transport_type"; my $transport = $transport_class->new( $self->transport_args() ); unless ( eval { $transport->send( $self ) } ) { $self->errstr(__PACKAGE__ . ": error from '$transport_class:'\n$@\n"); return; } return 1; } sub _normalize_perl_version { my $self = shift; my $perl_version = sprintf("v%vd",$^V); my $perl_V = $self->perl_version->{_myconfig}; my ($rc) = $perl_V =~ /Locally applied patches:\n\s+(RC\d+)/m; $perl_version .= " $rc" if $rc; return $perl_version; } sub write { my $self = shift; warn __PACKAGE__, ": write\n" if $self->debug(); my $from = $self->from(); my $report = $self->report(); my $subject = $self->subject(); my $distribution = $self->distribution(); my $grade = $self->grade(); my $dir = $self->dir() || cwd; my $distfile = $self->{_distfile} || ''; my $perl_version = $self->perl_version->{_version}; return unless $self->_verify(); $distribution =~ s/[^A-Za-z0-9\.\-]+//g; my($fh, $file); unless ($fh = $_[0]) { $file = "$grade.$distribution.$self->{_perl_version}->{_archname}.$self->{_perl_version}->{_osvers}.${\(time)}.$$.rpt"; if ($^O eq 'VMS') { $file = "$grade.$distribution.$self->{_perl_version}->{_archname}"; my $ext = "$self->{_perl_version}->{_osvers}.${\(time)}.$$.rpt"; # only 1 period in filename # we also only have 39.39 for filename $file =~ s/\./_/g; $ext =~ s/\./_/g; $file = $file . '.' . $ext; } $file = File::Spec->catfile($dir, $file); warn $file if $self->debug(); $fh = FileHandle->new(); open $fh, ">", $file or die __PACKAGE__, ": Can't open report file '$file': $!"; } print $fh "From: $from\n"; if ($distfile ne '') { print $fh "X-Test-Reporter-Distfile: $distfile\n"; } print $fh "X-Test-Reporter-Perl: $perl_version\n"; print $fh "Subject: $subject\n"; print $fh "Report: $report"; unless ($_[0]) { close $fh or die __PACKAGE__, ": Can't close report file '$file': $!"; warn $file if $self->debug(); return $file; } else { return $fh; } } sub read { my ($self, $file) = @_; warn __PACKAGE__, ": read\n" if $self->debug(); # unlock these; if not locked later, we have a parse error $self->{_report_lock} = $self->{_subject_lock} = 0; my $buffer; { local $/; open my $fh, "<", $file or die __PACKAGE__, ": Can't open report file '$file': $!"; $buffer = <$fh>; close $fh or die __PACKAGE__, ": Can't close report file '$file': $!"; } # convert line endings my $CR = "\015"; my $LF = "\012"; $buffer =~ s{$CR$LF}{$LF}g; $buffer =~ s{$CR}{$LF}g; # parse out headers foreach my $line (split(/\n/, $buffer)) { if ($line =~ /^(.+):\s(.+)$/) { my ($header, $content) = ($1, $2); if ($header eq "From") { $self->{_from} = $content; } elsif ($header eq "Subject") { $self->{_subject} = $content; my ($grade, $distribution, $archname) = (split /\s/, $content)[0..2]; $self->{_grade} = lc $grade; $self->{_distribution} = $distribution; $self->{_perl_version}{_archname} = $archname; $self->{_subject_lock} = 1; } elsif ($header eq "X-Test-Reporter-Distfile") { $self->{_distfile} = $content; } elsif ($header eq "X-Test-Reporter-Perl") { $self->{_perl_version}{_version} = $content; } elsif ($header eq "Report") { last; } } } # parse out body if ( $self->{_from} && $self->{_subject} ) { ($self->{_report}) = ($buffer =~ /^.+?Report:\s(.+)$/s); my ($perlv) = $self->{_report} =~ /(^Summary of my perl5.*)\z/ms; $self->{_perl_version}{_myconfig} = $perlv if $perlv; $self->{_report_lock} = 1; } # check that the full report was parsed if ( ! $self->{_report_lock} ) { die __PACKAGE__, ": Failed to parse report file '$file'\n"; } return $self; } sub _verify { my $self = shift; warn __PACKAGE__, ": _verify\n" if $self->debug(); my @undefined; for my $key (keys %{$self}) { push @undefined, $key unless defined $self->{$key}; } $self->errstr(__PACKAGE__ . ": Missing values for: " . join ', ', map {$_ =~ /^_(.+)$/} @undefined) if scalar @undefined > 0; return $self->errstr() ? return 0 : return 1; } # Courtesy of Email::MessageID sub message_id { my $self = shift; warn __PACKAGE__, ": message_id\n" if $self->debug(); my $unique_value = 0; my @CHARS = ('A'..'F','a'..'f',0..9); my $length = 3; $length = rand(8) until $length > 3; my $pseudo_random = join '', (map $CHARS[rand $#CHARS], 0 .. $length), $unique_value++; my $user = join '.', time, $pseudo_random, $$; return '<' . $user . '@' . Sys::Hostname::hostname() . '>'; } sub from { my $self = shift; warn __PACKAGE__, ": from\n" if $self->debug(); if (@_) { $self->{_from} = shift; return $self->{_from}; } else { return $self->{_from} if defined $self->{_from} and $self->{_from}; $self->{_from} = $self->_mailaddress(); return $self->{_from}; } } sub mx { my $self = shift; warn __PACKAGE__, ": mx\n" if $self->debug(); if (@_) { my $mx = shift; croak __PACKAGE__, ": mx: array reference required" if ref $mx ne 'ARRAY'; $self->{_mx} = $mx; } return $self->{_mx}; } # Deprecated, but kept for backwards compatibility # Passes through to transport_args -- converting from array ref to list to # store and converting from list to array ref to get sub mail_send_args { my $self = shift; warn __PACKAGE__, ": mail_send_args\n" if $self->debug(); croak __PACKAGE__, ": mail_send_args cannot be called unless Mail::Send is installed\n" unless $self->_have_mail_send(); if (@_) { my $mail_send_args = shift; croak __PACKAGE__, ": mail_send_args: array reference required\n" if ref $mail_send_args ne 'ARRAY'; $self->transport_args(@$mail_send_args); } return [ $self->transport_args() ]; } sub transport_args { my $self = shift; warn __PACKAGE__, ": transport_args\n" if $self->debug(); if (@_) { $self->{_transport_args} = ref $_[0] eq 'ARRAY' ? $_[0] : [ @_ ]; } return @{ $self->{_transport_args} }; } # quote for command-line perl sub _get_sh_quote { ( ($^O eq "MSWin32") || ($^O eq 'VMS') ) ? '"' : "'" } sub perl_version { my $self = shift; warn __PACKAGE__, ": perl_version\n" if $self->debug(); if( @_) { my $perl = shift; my $q = $self->_get_sh_quote; my $magick = int(rand(1000)); # just to check that we get a valid result back my $cmd = "$perl -MConfig -e$q print qq{$magick\n\$Config{archname}\n\$Config{osvers}\n};$q"; if($^O eq 'VMS'){ my $sh = $Config{'sh'}; $cmd = "$sh $perl $q-MConfig$q -e$q print qq{$magick\\n\$Config{archname}\\n\$Config{osvers}\\n};$q"; } my $conf = `$cmd`; chomp $conf; my %conf; ( @conf{ qw( magick _archname _osvers) } ) = split( /\n/, $conf, 3); croak __PACKAGE__, ": cannot get perl version info from $perl: $conf" if( $conf{magick} ne $magick); delete $conf{magick}; $conf{_myconfig} = $self->_get_perl_V($perl); chomp $conf; $self->{_perl_version} = \%conf; } return $self->{_perl_version}; } sub _get_perl_V { my $self = shift; my $perl = shift || qq{"$^X"}; my $q = $self->_get_sh_quote; my $cmdv = "$perl -V"; if($^O eq 'VMS'){ my $sh = $Config{'sh'}; $cmdv = "$sh $perl $q-V$q"; } my $perl_V = `$cmdv`; chomp $perl_V; return $perl_V; } sub AUTOLOAD { my $self = $_[0]; my ($package, $method) = ($AUTOLOAD =~ /(.*)::(.*)/); return if $method =~ /^DESTROY$/; unless ($self->{_attr}->{"_$method"}) { croak __PACKAGE__, ": No such method: $method; aborting"; } my $code = q{ sub { my $self = shift; warn __PACKAGE__, ": METHOD\n" if $self->{_debug}; $self->{_METHOD} = shift if @_; return $self->{_METHOD}; } }; $code =~ s/METHOD/$method/g; { no strict 'refs'; *$AUTOLOAD = eval $code; ## no critic } goto &$AUTOLOAD; } sub _have_net_dns { my $self = shift; warn __PACKAGE__, ": _have_net_dns\n" if $self->debug(); return $DNS if defined $DNS; return 0 if FAKE_NO_NET_DNS; $DNS = eval {require Net::DNS}; } sub _have_net_domain { my $self = shift; warn __PACKAGE__, ": _have_net_domain\n" if $self->debug(); return $Domain if defined $Domain; return 0 if FAKE_NO_NET_DOMAIN; $Domain = eval {require Net::Domain}; } sub _have_mail_send { my $self = shift; warn __PACKAGE__, ": _have_mail_send\n" if $self->debug(); return $Send if defined $Send; return 0 if FAKE_NO_MAIL_SEND; $Send = eval {require Mail::Send}; } sub _start_editor { my $self = shift; warn __PACKAGE__, ": _start_editor\n" if $self->debug(); my $editor = $ENV{VISUAL} || $ENV{EDITOR} || $ENV{EDIT} || ($^O eq 'VMS' and "edit/tpu") || ($^O eq 'MSWin32' and "notepad") || 'vi'; $editor = $self->_prompt('Editor', $editor); die __PACKAGE__, ": The editor `$editor' could not be run on '$Report': $!" if system "$editor $Report"; die __PACKAGE__, ": Report has disappeared; terminated" unless -e $Report; die __PACKAGE__, ": Empty report; terminated" unless -s $Report > 2; } sub _prompt { my $self = shift; warn __PACKAGE__, ": _prompt\n" if $self->debug(); my ($label, $default) = @_; printf "$label%s", (" [$default]: "); my $input = scalar ; chomp $input; return (length $input) ? $input : $default; } # From Mail::Util 1.74 (c) 1995-2001 Graham Barr (c) 2002-2005 Mark Overmeer { # cache the mail domain, so we don't try to resolve this *every* time # (thanks you kane) my $domain; sub _maildomain { my $self = shift; warn __PACKAGE__, ": _maildomain\n" if $self->debug(); # use cached value if set return $domain if defined $domain; # prefer MAILDOMAIN if set if ( defined $ENV{MAILDOMAIN} ) { return $domain = $ENV{MAILDOMAIN}; } local $_; my @sendmailcf = qw( /etc /etc/sendmail /etc/ucblib /etc/mail /usr/lib /var/adm/sendmail ); my $config = (grep(-r, map("$_/sendmail.cf", @sendmailcf)))[0]; if (defined $config && open(my $cf, "<", $config)) { my %var; while (<$cf>) { if (my ($v, $arg) = /^D([a-zA-Z])([\w.\$\-]+)/) { $arg =~ s/\$([a-zA-Z])/exists $var{$1} ? $var{$1} : '$'.$1/eg; $var{$v} = $arg; } } close($cf) || die $!; $domain = $var{j} if defined $var{j}; $domain = $var{M} if defined $var{M}; $domain = $1 if ($domain && $domain =~ m/([A-Za-z0-9](?:[\.\-A-Za-z0-9]+))/); undef $domain if $^O eq 'darwin' && $domain =~ /\.local$/; return $domain if (defined $domain && $domain !~ /\$/); } if (open(my $cf, "<", "/usr/lib/smail/config")) { while (<$cf>) { if (/\A\s*hostnames?\s*=\s*(\S+)/) { $domain = (split(/:/,$1))[0]; undef $domain if $^O eq 'darwin' && $domain =~ /\.local$/; last if defined $domain and $domain; } } close($cf) || die $!; return $domain if defined $domain; } if (eval {require Net::SMTP}) { for my $host (qw(mailhost smtp localhost)) { # default timeout is 120, which is Very Very Long, so lower # it to 5 seconds. Total slowdown will not be more than # 15 seconds ( 5 x @hosts ) --kane my $smtp = eval {Net::SMTP->new($host, Timeout => 5)}; if (defined $smtp) { $domain = $smtp->domain; $smtp->quit; undef $domain if $^O eq 'darwin' && $domain =~ /\.local$/; last if defined $domain and $domain; } } } unless (defined $domain) { if ($self->_have_net_domain()) { ################################################################### # The below statement might possibly exhibit intermittent blocking # behavior. Be advised! ################################################################### $domain = Net::Domain::domainname(); undef $domain if $^O eq 'darwin' && $domain =~ /\.local$/; } } $domain = "localhost" unless defined $domain; return $domain; } } # From Mail::Util 1.74 (c) 1995-2001 Graham Barr (c) 2002-2005 Mark Overmeer sub _mailaddress { my $self = shift; warn __PACKAGE__, ": _mailaddress\n" if $self->debug(); my $mailaddress = $ENV{MAILADDRESS}; $mailaddress ||= $ENV{USER} || $ENV{LOGNAME} || eval {getpwuid($>)} || "postmaster"; $mailaddress .= '@' . $self->_maildomain() unless $mailaddress =~ /\@/; $mailaddress =~ s/(^.*<|>.*$)//g; my $realname = $self->_realname(); if ($realname) { $mailaddress = "$mailaddress ($realname)"; } return $mailaddress; } sub _realname { my $self = shift; warn __PACKAGE__, ": _realname\n" if $self->debug(); my $realname = ''; $realname = eval {(split /,/, (getpwuid($>))[6])[0]} || $ENV{QMAILNAME} || $ENV{REALNAME} || $ENV{USER}; return $realname; } sub _is_a_perl_release { my $self = shift; warn __PACKAGE__, ": _is_a_perl_release\n" if $self->debug(); my $perl = shift; return $perl =~ /^perl-?\d\.\d/; } 1; # ABSTRACT: sends test results to cpan-testers@perl.org =pod =encoding UTF-8 =head1 NAME Test::Reporter - sends test results to cpan-testers@perl.org =head1 VERSION version 1.62 =head1 SYNOPSIS use Test::Reporter; my $reporter = Test::Reporter->new( transport => 'File', transport_args => [ '/tmp' ], ); $reporter->grade('pass'); $reporter->distribution('Mail-Freshmeat-1.20'); $reporter->send() || die $reporter->errstr(); # or my $reporter = Test::Reporter->new( transport => 'File', transport_args => [ '/tmp' ], ); $reporter->grade('fail'); $reporter->distribution('Mail-Freshmeat-1.20'); $reporter->comments('output of a failed make test goes here...'); $reporter->edit_comments(); # if you want to edit comments in an editor $reporter->send() || die $reporter->errstr(); # or my $reporter = Test::Reporter->new( transport => 'File', transport_args => [ '/tmp' ], grade => 'fail', distribution => 'Mail-Freshmeat-1.20', from => 'whoever@wherever.net (Whoever Wherever)', comments => 'output of a failed make test goes here...', via => 'CPANPLUS X.Y.Z', ); $reporter->send() || die $reporter->errstr(); =head1 DESCRIPTION Test::Reporter reports the test results of any given distribution to the CPAN Testers project. Test::Reporter has wide support for various perl5's and platforms. CPAN Testers no longer receives test reports by email, but reports still resemble an email message. This module has numerous legacy "features" left over from the days of email transport. =head2 Transport mechanism The choice of transport is set with the C argument. CPAN Testers should usually install L and use 'Metabase' as the C. See that module for necessary transport arguments. Advanced testers may wish to test on a machine different from the one used to send reports. Consult the L for examples using other transport classes. The legacy email-based transports have been split out into a separate L distribution and methods solely related to email have been deprecated. =head1 ATTRIBUTES =head2 Required attributes =over =item * B Gets or sets the name of the distribution you're working on, for example Foo-Bar-0.01. There are no restrictions on what can be put here. =item * B Gets or sets the e-mail address of the individual submitting the test report, i.e. "John Doe ". =item * B Gets or sets the success or failure of the distributions's 'make test' result. This must be one of: grade meaning ----- ------- pass all tests passed fail one or more tests failed na distribution will not work on this platform unknown tests did not exist or could not be run =back =head2 Transport attributes =over =item * B Gets or sets the transport type. The transport type argument is refers to a 'Test::Reporter::Transport' subclass. The default is 'Null', which uses the L class and does nothing when C is called. You can add additional arguments after the transport selection. These will be passed to the constructor of the lower-level transport. See C. $reporter->transport( 'File', '/tmp' ); This is not designed to be an extensible platform upon which to build transport plugins. That functionality is planned for the next-generation release of Test::Reporter, which will reside in the CPAN::Testers namespace. =item * B Optional. Gets or sets transport arguments that will used in the constructor for the selected transport, as appropriate. =back =head2 Optional attributes =over =item * B Gets or sets the comments on the test report. This is most commonly used for distributions that did not pass a 'make test'. =item * B Gets or sets the value that will turn debugging on or off. Debug messages are sent to STDERR. 1 for on, 0 for off. Debugging generates very verbose output and is useful mainly for finding bugs in Test::Reporter itself. =item * B Defaults to the current working directory. This method specifies the directory that write() writes test report files to. =item * B Gets or sets the timeout value for the submission of test reports. Default is 120 seconds. =item * B Gets or sets the value that will be appended to X-Reported-Via, generally this is useful for distributions that use Test::Reporter to report test results. This would be something like "CPANPLUS 0.036". =back =head2 Deprecated attributes CPAN Testers no longer uses email for submitting reports. These attributes are deprecated. =over =item * B
=item * B =item * B =back =head1 METHODS =over =item * B This constructor returns a Test::Reporter object. =item * B Returns a hashref containing _archname, _osvers, and _myconfig based upon the perl that you are using. Alternatively, you may supply a different perl (path to the binary) as an argument, in which case the supplied perl will be used as the basis of the above data. Make sure you protect it from the shell in case there are spaces in the path: $reporter->perl_version(qq{"$^X"}); =item * B Returns the subject line of a report, i.e. "PASS Mail-Freshmeat-1.20 Darwin 6.0". 'grade' and 'distribution' must first be specified before calling this method. =item * B Returns the actual content of a report, i.e. "This distribution has been tested as part of the cpan-testers...". 'comments' must first be specified before calling this method, if you have comments to make and expect them to be included in the report. =item * B Sends the test report to cpan-testers@perl.org via the defined C mechanism. You must check errstr() on a send() in order to be guaranteed delivery. =item * B Allows one to interactively edit the comments within a text editor. comments() doesn't have to be first specified, but it will work properly if it was. Accepts an optional hash of arguments: =over =item * B Optional. Allows one to specify the suffix ("extension") of the temp file used by B. Defaults to '.txt'. =back =item * B Returns an error message describing why something failed. You must check errstr() on a send() in order to be guaranteed delivery. =item * B These methods are used in situations where you wish to save reports locally rather than transmitting them to CPAN Testers immediately. You use write() on the machine that you are testing from, transfer the written test reports from the testing machine to the sending machine, and use read() on the machine that you actually want to submit the reports from. write() will write a file in an internal format that contains 'From', 'Subject', and the content of the report. The filename will be represented as: grade.distribution.archname.osvers.seconds_since_epoch.pid.rpt. write() uses the value of dir() if it was specified, else the cwd. On the machine you are testing from: my $reporter = Test::Reporter->new ( grade => 'pass', distribution => 'Test-Reporter-1.16', )->write(); On the machine you are submitting from: # wrap in an opendir if you've a lot to submit my $reporter; $reporter = Test::Reporter->new()->read( 'pass.Test-Reporter-1.16.i686-linux.2.2.16.1046685296.14961.rpt' )->send() || die $reporter->errstr(); write() also accepts an optional filehandle argument: my $fh; open $fh, '>-'; # create a STDOUT filehandle object $reporter->write($fh); # prints the report to STDOUT =back =head2 Deprecated methods =over =item * B =back =head1 CAVEATS If you experience a long delay sending reports with Test::Reporter, you may be experiencing a wait as Test::Reporter attempts to determine your email address. Always use the C parameter to set your email address explicitly. =head1 SEE ALSO For more about CPAN Testers: =over 4 =item * L =item * L =back =for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 SUPPORT =head2 Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at L. You will be notified automatically of any progress on your issue. =head2 Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. L git clone https://github.com/cpan-testers/Test-Reporter.git =head1 AUTHORS =over 4 =item * Adam J. Foxson =item * David Golden =item * Kirrily "Skud" Robert =item * Ricardo Signes =item * Richard Soderberg =item * Kurt Starsinic =back =head1 CONTRIBUTORS =for stopwords Andreas Koenig Ed J Tatsuhiko Miyagawa Vincent Pit =over 4 =item * Andreas Koenig =item * Ed J =item * Tatsuhiko Miyagawa =item * Vincent Pit =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Authors and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut __END__ 1; Test-Reporter-1.62/lib/Test/Reporter/Transport/000755 000765 000024 00000000000 12510527023 021673 5ustar00davidstaff000000 000000 Test-Reporter-1.62/lib/Test/Reporter/Transport.pm000644 000765 000024 00000005550 12510527023 022236 0ustar00davidstaff000000 000000 use strict; BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } package Test::Reporter::Transport; our $VERSION = '1.62'; sub new { die "Not implemented" } sub send { die "Not implemented" } 1; # ABSTRACT: base class for Test::Reporter transports __END__ =pod =encoding UTF-8 =head1 NAME Test::Reporter::Transport - base class for Test::Reporter transports =head1 VERSION version 1.62 =head1 SYNOPSIS # Defines API that must be implemented by subclasses my $sender = Test::Reporter::Transport::Subclass->new( @args ); $sender->send( $report ) =head1 DESCRIPTION Transport subclasses provide the means by which CPAN Testers reports are transmitted to the CPAN Testers mailing list. This module is an abstract base class that define an API for Test::Reporter::Transport subclasses. Individual subclasses MUST implement the methods described below. =head1 USAGE A transport method is specified to Test::Reporter using the C option. The C option expects just the module "suffix" that follows C. For example: # use Test::Reporter::Transport::Null for transport my $report = Test::Reporter->new( transport => 'Null' ); Configuration of the transport is specified with the C option: my $report = Test::Reporter->new( transport => 'File', transport_args => [ dir => '/tmp' ], ); These may also be specified with the C or C methods: $report->transport_args( dir => '/tmp' ); These may also be combined in the C method itself: $report->transport( 'File', dir => '/tmp' ); =head1 METHODS The terms 'may', 'must', 'should', etc. used below have their usual RFC meanings. =head2 new my $sender = $subclass->new( @args ); The C method is the object constructor. It MAY take a list of any necessary configuration options. It MUST return a transport object if one is successfully created or undef if the object can not be created. =head2 send $sender->send( $report ); The C method MUST take a Test::Reporter object as its only argument. It MUST return true if the report is successfully sent. It SHOULD die with a message describing the failure if a report cannot be sent. It MUST NOT return a true value if the report cannot be sent. =head1 AUTHORS =over 4 =item * Adam J. Foxson =item * David Golden =item * Kirrily "Skud" Robert =item * Ricardo Signes =item * Richard Soderberg =item * Kurt Starsinic =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Authors and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Test-Reporter-1.62/lib/Test/Reporter/Transport/File.pm000644 000765 000024 00000004204 12510527023 023110 0ustar00davidstaff000000 000000 use strict; BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } package Test::Reporter::Transport::File; our $VERSION = '1.62'; use base 'Test::Reporter::Transport'; sub new { my ($class, $dir) = @_; die "target directory '$dir' doesn't exist or can't be written to" unless -d $dir && -w $dir; return bless { dir => $dir } => $class; } sub send { my ($self, $report) = @_; $report->dir( $self->{dir} ); return $report->write(); } 1; # ABSTRACT: File transport for Test::Reporter __END__ =pod =encoding UTF-8 =head1 NAME Test::Reporter::Transport::File - File transport for Test::Reporter =head1 VERSION version 1.62 =head1 SYNOPSIS my $report = Test::Reporter->new( transport => 'File', transport_args => [ $dir ], ); =head1 DESCRIPTION This module saves a Test::Reporter report to the specified directory (using the C method from Test::Reporter. This lets you save reports during offline operation. The files may later be uploaded using C<< Test::Reporter->read() >>. Test::Reporter->new->read( $file )->send(); =head1 USAGE See L and L for general usage information. =head2 Transport Arguments $report->transport_args( $dir ); This transport class must have a writeable directory as its argument. =head1 METHODS These methods are only for internal use by Test::Reporter. =head2 new my $sender = Test::Reporter::Transport::File->new( $dir ); The C method is the object constructor. =head2 send $sender->send( $report ); The C method transmits the report. =head1 AUTHORS =over 4 =item * Adam J. Foxson =item * David Golden =item * Kirrily "Skud" Robert =item * Ricardo Signes =item * Richard Soderberg =item * Kurt Starsinic =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Authors and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut Test-Reporter-1.62/lib/Test/Reporter/Transport/Null.pm000644 000765 000024 00000002467 12510527023 023154 0ustar00davidstaff000000 000000 use strict; BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } package Test::Reporter::Transport::Null; our $VERSION = '1.62'; use base 'Test::Reporter::Transport'; sub new { return bless {}, shift; } sub send { return 1; # do nothing } 1; # ABSTRACT: Null transport for Test::Reporter __END__ =pod =encoding UTF-8 =head1 NAME Test::Reporter::Transport::Null - Null transport for Test::Reporter =head1 VERSION version 1.62 =head1 SYNOPSIS my $report = Test::Reporter->new( transport => 'Null', ); =head1 DESCRIPTION This module provides a "null" transport option that does nothing when C is called. =head1 USAGE See L and L for general usage information. =for Pod::Coverage new send =head1 AUTHORS =over 4 =item * Adam J. Foxson =item * David Golden =item * Kirrily "Skud" Robert =item * Ricardo Signes =item * Richard Soderberg =item * Kurt Starsinic =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2015 by Authors and Contributors. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut